Bug 125455 [clean up] Compile error, opening bracket after //NON-NLS
Version: 3.2.0 Build id: I20060125-0800 Take JUnit source and apply all clean ups on it (5.0 level). You get compile errors. Reasons are looking like the following: if (displayString.startsWith("AllTests")) //$NON-NLS-1$ { setIcon(this.fSuiteIcon); } else { setIcon(this.fLeafIcon); } Can't tell why yet. 'Add NON NLS tag' should allways be executed after 'Add block to single statement'. May be a problem with the clean up, may also be a problem with the ast rewrite.
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java
buf.append("    }\n");
		buf.append("    public static int i= 10;\n");
		buf.append("}\n");
		ICompilationUnit cu1= pack1.createCompilationUnit("E1.java", buf.toString(), false, null);
		
		ICleanUp cleanUp= new CodeStyleCleanUp(CodeStyleCleanUp.CHANGE_NON_STATIC_ACCESS_TO_STATIC);
		
		setOptions(cleanUp);
		
		CompilationUnit[] units= compile(new ICompilationUnit[] {cu1});
		assertNumberOfProblems(units[0], 1);
		
		buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("public class E1 {\n");
		buf.append("    public void foo() {\n");
		buf.append("        System.out.println(E1.i);\n");
		buf.append("    }\n");
		buf.append("    public static int i= 10;\n");
		buf.append("}\n");
		String expected1= buf.toString();
		int numberOfFixes= 1;
		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);