Organize Imports and import static xxx.yyy.* [message #690498] |
Wed, 29 June 2011 11:40  |
Eclipse User |
|
|
|
Should "Organize Imports" be customized to allow import static xxx.yyy.* to be left alone?[ 2 votes ] |
1. | No | 0 / 0% | 2. | Yes | 2 / 100% |
It would be nice if Organize Imports worked differently with import static, at least optionally.
While I DO agree that Organize Imports should convert stuff like
to a list of imports actually used, since I consider the above an abomination when reading someone else's code, I would rather not have Eclipse perform the same logic on something like
import static java.awt.event.KeyEvent.*;
I might, for example, want to do that in developing a custom keyboard handling class that did a lot of referencing of VK_this and VK_that. But, since I am in the habit of using OrganizeImports a lot, this always messes with me, and forces me to change my import list whenever I want to reference a new VK_something that wasn't used before.
Could Eclipse be enhanced to allow some customizing of how Organize Imports works?
[Updated on: Wed, 29 June 2011 12:04] by Moderator
|
|
|
|
Re: Organize Imports and import static xxx.yyy.* [message #1129697 is a reply to message #690498] |
Tue, 08 October 2013 18:31  |
Eclipse User |
|
|
|
This seems to be a rather old topic. However, it came to my mind recently while writing lots of unit tests using JUnit's Asset and Mockito.
In my opinion it would be nice to have the ability to specify a list of classes or packages for which the import optimizer would recognize each of its static members.
This could be a simple list on the bottom half of the settings dialog, similar to the import order definition. This way, typing often used static methods / constants etc. would compile after optimizing imports.
|
|
|
Powered by
FUDForum. Page generated in 0.04342 seconds