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
buf.append("    }\n");
		buf.append("}\n");
		String expected2= buf.toString();
		
		buf= new StringBuffer();
		buf.append("package test2;\n");
		buf.append("import test1.E2;\n");
		buf.append("public class E3 extends E2 {\n");
		buf.append("    public static final String s= null; \n");
		buf.append("    public static String bar(String s1, String s2) {\n");
		buf.append("        bar(s2, s1); \n");
		buf.append("        return s1; \n");
		buf.append("    }\n");
		buf.append("}\n");
		String expected3= buf.toString();
		int numberOfFixes= 3;
		int offset= 0;
		String[] previews= new String[numberOfFixes];
		for (int i= offset; i < numberOfFixes; i++) {
			IFix fix= cleanUp.createFix(units[i]);
			assertNotNull("There are problems but no fix", fix);
			TextChange change= fix.createChange();
			assertNotNull("Null change for an existing fix", change);
			previews[i - offset]= change.getPreviewContent(null);
		}
		assertEqualStringsIgnoreOrder(previews, new String[] { expected1, expected2, expected3});	
	}
	public void testUnusedCode01() throws Exception {
		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
		StringBuffer buf= new StringBuffer();