I heavily use the Eclipse organize imports function but a major annoyance for me is its tendency to add some incredibly niche type from a dependency with the same name as a class from the JRE.
For example, when I declare Map map;
and run "organize imports", Eclipse may add import net.some.dependency.of.my.dependency.i.never.use.Map
instead of import java.util.Map
and then valuable time is lost as I figure out why map.entrySet()
does not work anymore.
Is there some way of imposing a priority system on imports? For example:
I use Eclipse Neon 4.6.0M7.
P.S.: My dependencies are managed with Maven 3.3.9, in case that makes a difference.
I don't know about support for priorities, but you could simply say you are not interested in some types or packages in the preference page Java
/ Appearance
/ Type filters
. Types here are not shown in content assist.
E.g. I never develop in AWT or Swing, so I turn them off for the content assist as can be seen in the screenshot
I would take a close look at the Eclipse .classpath
file in the project folder. If classpath entries are ordered in some way, maybe this ordering is also controllable in the IDE option dialogs.
See What's in an Eclipse .classpath/.project file?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With