Project: JDT
Bug 178484 [organize imports] Static method in enum declaration results in spurious import declarations
Reported: 2007-03-21 00:39:57 | Status: resolved fixed

Build ID: I20070222-0951 Steps To Reproduce: 1. Create a class containing the following code package test; public enum TestEnum { SPECIFIC(1), DEFAULT(getDefaultValue()); TestEnum(int value) {} private static int getDefaultValue() { return -1; } } 2. Run organize-imports 3. Eclipse will create a spurious import for test.TestEnum.getDefaultValue(), which is unneeded, and in turn causes an error ("The import test.TestEnum.getDefaultValue cannot be resolved"). More information: This only happens if the enum is in a package. If it's in the default package, organize imports has no effect.

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ScopeAnalyzerTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java