Bug 15726 moves field comments from one field to another [quick fix]
20020508 public class A { int field; //field comment A(int fred){ _fred= fred; } } you are offered to create field _fred but then it steals the comment: int field; private int _fred; //field comment
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
		{	
			StringBuffer buf= new StringBuffer();
			buf.append("package test1;\n");
			buf.append("public class C {\n");
			buf.append("    public Object foo() {\n");
			buf.append("        if (this.equals(new Object())) {\n");
			buf.append("            toString();\n");
			buf.append("        }\n");
			buf.append("    }\n");
			buf.append("}\n");	
			ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null);
		
			CompilationUnit astRoot= AST.parseCompilationUnit(cu, false);
			ASTRewrite rewrite= new ASTRewrite(astRoot);
			TypeDeclaration type= findTypeDeclaration(astRoot, "C");
			
			MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");
			Block block= methodDecl.getBody();
			assertTrue("No block" , block != null);	
			
			List statements= block.statements();
			ReturnStatement returnStatement= block.getAST().newReturnStatement();
			returnStatement.setExpression(ASTResolving.getInitExpression(methodDecl.getReturnType()));
			statements.add(returnStatement);
			rewrite.markAsInserted(returnStatement);
			
			ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal("", cu, rewrite, 10, null);
			proposal.getCompilationUnitChange().setSave(true);