Bug 113770 [organize import] generates syntactically incorrect static import
In very few cases, "organize import" generates an invalid static import. Note that the following compiable example must be placed in *two* separate files. When organizing imports for the first file, it generates the invalid import "import static EclipseBugOrganizeStaticImport.logger;". ----------------------------------------------- public class EclipseBugOrganizeStaticImport { private static String logger; public void startGenerator() { new MyRunnableImpl() { @Override public void run() { try { // } catch (Exception e) { logger.toString(); } } }; } } ---------------------------------------------- package de.ingo_homann.test; public class MyRunnableImpl implements Runnable { private static String logger; public void run() { // } }
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java
buf.append("package test2;\n");
		buf.append("import test2.A.A1;\n");		
		buf.append("import test2.A.A1.A2;\n");
		buf.append("import test2.A.A1.A2.A3;\n");
		buf.append("import test2.A.B1;\n");
		buf.append("import test2.A.B1.B2;\n");
		buf.append("import test1.C;\n");
		buf.append("import test1.C.C1.C2;\n");
		
		buf.append("public class A {\n");
		buf.append("    public static class A1 {\n");
		buf.append("        public static class A2 {\n");
		buf.append("            public static class A3 {\n");
		buf.append("            }\n");
		buf.append("        }\n");
		buf.append("    }\n");
		
		buf.append("    public static class B1 {\n");
		buf.append("        public static class B2 {\n");
		buf.append("        }\n");
		
		buf.append("        public static class B3 {\n");
		buf.append("            public static class B4 extends C {\n");
		buf.append("                B4 b4;\n");
		buf.append("                B3 b3;\n");
		buf.append("                B2 b2;\n");
		buf.append("                B1 b1;\n");
		buf.append("                A1 a1;\n");
		buf.append("                A2 a2;\n");
		buf.append("                A3 a3;\n");