Project: JDT
Bug 30553 Quick fix suggestions for unresolved type after "new" could be ordered better [quick fix]
Reported: 2003-01-29 17:17:35 | Status: resolved fixed

(Build I20030107, GTK, Sun JDK 1.4.1-b21, Gentoo Linux 2.4.19) I often use statements like this: Map map = new HashMap(); If java.util.Map has been imported, but java.util.HashMap hasn't then there will be quick fix suggestions for 'HashMap'. The suggestions are: Change to 'Map' Import 'java.util.HashMap' ... I suggest that a better order would reverse the top two suggestions. ie: Import 'java.util.HashMap' Change to 'Map' ... I know there is an algorithm for determining the order of suggestions. When a suggestion is made to fix an unresolved type after a "new" statement, classes which can be instantiated should be shown higher than interfaces and abstract classes. Interfaces and abstract classes only make sense if an anonymous class is being created and this is much less common.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java