Project: JDT
Bug 159638 [organize imports] Organize Imports alternates including annotation defined on parent
Reported: 2006-10-03 15:58:47 | Status: resolved fixed

When you have a class which extends another class and includes an annotation defined inside that parent class. Organize Imports alternates including that import. // File 1 package first; import java.lang.annotation.*; public abstract class Parent { @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface Tag{ String value(); } } // File 2 package other; import first.Parent; import first.Parent.Tag; @Tag("foo") public class Child extends Parent { } When you type Ctrl-Shift-O the second import in file 2 (first.Parent.Tag) disappears. When you click it again it appears. This alternating behavior is quite annoying.

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ScopeAnalyzer.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java