Bug 129115 [clean up] Qualify static fields qualifies enum constants
When applying the Cleanup Wizard with the option "Use declaring class as qualifier for static member accesses" and the sub-option "Unqualified accesses" on a class that contains an enum declaration, the produced result contains syntax errors. Try it with a simple test class: public class TestClass { enum MyEnum { STATE_1, STATE_2, STATE_3 }; } After applying the wizard with the mentioned options, the code looks as follows: public class TestClass { enum MyEnum { MyEnum.STATE_1, MyEnum.STATE_2, MyEnum.STATE_3 }; }
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java
StringBuffer buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("import java.io.Serializable;\n");
		buf.append("public class E1 implements Serializable {\n");
		buf.append("\n");
		buf.append("    private Serializable s= new Serializable() {\n");
		buf.append("        \n");
		buf.append("    };\n");
		buf.append("}\n");
		ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
		
		CleanUpRefactoring refactoring= new CleanUpRefactoring();
		refactoring.addCompilationUnit(cu1);
		
		ICleanUp cleanUp1= new PotentialProgrammingProblemsCleanUp(PotentialProgrammingProblemsCleanUp.ADD_CALCULATED_SERIAL_VERSION_ID);
		refactoring.addCleanUp(cleanUp1);
		
		buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("import java.io.Serializable;\n");
		buf.append("public class E1 implements Serializable {\n");
		buf.append("\n");
		buf.append("    " + FIELD_COMMENT + "\n");
		buf.append("    private static final long serialVersionUID = 1L;\n");
		buf.append("    private Serializable s= new Serializable() {\n");
		buf.append("\n");
		buf.append("        " + FIELD_COMMENT + "\n");
		buf.append("        private static final long serialVersionUID = 1L;\n");
		buf.append("        \n");
		buf.append("    };\n");