Reputation: 62836
My eclipse is configured so that when I save the java source file, it automatically inserts the missing import declarations. Except when the reference is ambiguous. Fpr instance, the most annoying ambiguity is with List<T>
- both java.util
and java.awt
declare it. Here eclipse demands manual resolution.
I was wondering if it was possible to configure somewhere that whenever List<T>
is used then java.util
should be imported. Or alternatively, since I am not using java.awt
, I could just remove it from the list of possible suggestions.
Any ideas?
Thanks.
Upvotes: 3
Views: 763
Reputation: 32954
This sounds like a possible duplicate of Exclude packages from Eclipse's organize imports.
Basically, you want to change your Type Filters preference to exclude java.awt.*
packages. Keep in mind that doing so will make things harder/confusing if you ever try to write AWT/Swing code.
Upvotes: 1
Reputation: 20003
Manually invoke Organize Imports and it will ask you when an ambiguity is found.
Upvotes: 0
Reputation: 6039
One thing that pops into my mind is altering the class template in the preferences to include the line:
import java.util.List
Unless you are going to use the AWT version of a List, or care about unused import statements, that should solve this annoying issue ..
Upvotes: 0