Project: JDT
Bug 230067 [organize imports] Organize imports adds useless and invalid static imports
Reported: 2008-05-03 05:40:18 | Status: verified fixed

Sample, class: ---- package sample; class Test<T> { private static String TEST = "constant"; static class Inner extends Test<String> { public void test() { TEST.concat("access"); } } } ---- Organize imports adds: import static sample.Test.TEST; The import is unnecessary and invalid (compile error because the constant is private).

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/ScopeAnalyzer.java