Project: JDT
Bug 157069 [content assist] Imports computer introduces wrong import ==> compile error
Reported: 2006-09-12 13:06:12 | Status: resolved fixed

package a; public class A { protected class Sub {} protected void doSomething(Sub sub){} } ---------- package b; public class B extends A { doSome<<CARET>> } ---------- The code above describes the scenario. When you invoke content assist in class B (where the caret is) to override the doSomething() method, an invalid import statement for a.A.Sub is added to class B. That import statement is not necessary.

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeCompletionTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddCustomConstructorOperation.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddUnimplementedMethodsOperation.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/ContextSensitiveImportRewriteContext.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility2.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnimplementedMethodsCompletionProposal.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/OverrideCompletionProposal.java