Bug 117477 [clean up] add 'remove this qualifier' clean up
There is 'add this qualifier' clean up, but there are no 'remove this qualifier'. But what if I have CU with such code style and don't like it? About this code: private int i; void foo(int i) {this.i= i;} May be just check that there are no SingleVariableDeclaration with same identifier in parent method(s)? Plus such code is also possible: public class Test { private int field; private class Inner { private int field; public void foo(int i) { Test.this.field = i; } } } So, probably we should also check that there are no field hiding in parent classes.
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java
ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
		
		CleanUpRefactoring refactoring= new CleanUpRefactoring();
		refactoring.addCompilationUnit(cu1);
		ICleanUp cleanUp1= new ControlStatementsCleanUp(ControlStatementsCleanUp.REMOVE_UNNECESSARY_BLOCKS);
		ICleanUp cleanUp2= new ExpressionsCleanUp(ExpressionsCleanUp.REMOVE_UNNECESSARY_PARENTHESIS);
		refactoring.addCleanUp(cleanUp1);
		refactoring.addCleanUp(cleanUp2);
		
		buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("public class E {\n");
		buf.append("    void foo(int i) {\n");
		buf.append("        if (i == 0 || i == 1)\n");
		buf.append("            System.out.println(i);\n");
		buf.append("        \n");
		buf.append("        while (i > 0 && i < 10)\n");
		buf.append("            System.out.println(1);\n");
		buf.append("        \n");
		buf.append("        boolean b= i != -1 && i > 10 && i < 100 || i > 20;\n");
		buf.append("        \n");
		buf.append("        do; while (i > 5 && b || i < 100 && i > 90);\n");
		buf.append("    }\n");
		buf.append("}\n");
		String expected1= buf.toString();
		
		assertRefactoringResultAsExpected(refactoring, new String[] {expected1});
	}
}