Community
Participate
Working Groups
I am not sure if this feature is already there, but... I think Eclipse could look through the fully qualified class names and import those classes instead. And also change the fully qualified name to just the class name. This could either be done in the "Organize imports" menu or as a separate menu item. I think one of the hurdles will be when two classes (from different packages) are being used in the same class: like java.util.Date and java.sql.Date
Isn't organize imports already doing it ? Moving to JDT/UI.
the feature exists: if your code contains something like java.util.Vector vec; select Vector, do 'Add Import': The qualification will be removed, and the import added. The reason why 'Organize import' doesn't do this is that never touches the code. There are sometimes reasons to have a fully qualified import. Personal taste, conflicts ect...
Thanks - I tried that - but I think that there is still a problem: I have 3 places where I use java.util.Iterator (fully qualified names). When I follow the above steps on one of the locations - it adds the import and changes the name to just 'Iterator' in that location - but does not do it for the other locations (when I do the process for one location, I would think that it would go through the rest of the code and do the same automatically for all locations where there is no conflict for 'java.util.Iterator'. Also, when the process was not done automatically, I tried to redo the process for the rest of the locations - and it did not work - the fully qualified names were still being used.
I would like to know if this is being fixed in 2.1?
martin can you pls answer
yes, that's a drawback, you have to do it for each invocation. no plans for 2.1
Can we reopen this now that we are beyond 2.1?
Please let us decide what to reopen. Thanks.
*** This bug has been marked as a duplicate of 12330 ***