ASTNode placeholder1= rewrite.createCopyPlaceholder(first); ASTNode placeholder2= rewrite.createCopyPlaceholder(second);
ASTNode placeholder1= rewrite.createCopyTarget(first); ASTNode placeholder2= rewrite.createCopyTarget(second);
	public void testMethodParamsRenameReorder() throws Exception {		if (true)			return;		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);		StringBuffer buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public class E {\n");		buf.append("    public void m(boolean y, int a) {\n");		buf.append("        m(y, a);\n");		buf.append("    }\n");		buf.append("}\n");			ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);				CompilationUnit astRoot= createAST(cu);		NewASTRewrite rewrite= new NewASTRewrite(astRoot.getAST());				AST ast= astRoot.getAST();				assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);		TypeDeclaration type= findTypeDeclaration(astRoot, "E");		MethodDeclaration methodDecl= findMethodDeclaration(type, "m");		Block block= methodDecl.getBody();		List statements= block.statements();		assertTrue("Number of statements not 1", statements.size() == 1);		{ 			//params 			List params= methodDecl.parameters();			SingleVariableDeclaration firstParam= (SingleVariableDeclaration) params.get(0);			SingleVariableDeclaration secondParam= (SingleVariableDeclaration) params.get(1);			//args			ExpressionStatement stmt= (ExpressionStatement) statements.get(0);			MethodInvocation invocation= (MethodInvocation) stmt.getExpression();			List arguments= invocation.arguments();			SimpleName first= (SimpleName) arguments.get(0);			SimpleName second= (SimpleName) arguments.get(1);						//rename args			SimpleName newFirstArg= methodDecl.getAST().newSimpleName("yyy");			SimpleName newSecondArg= methodDecl.getAST().newSimpleName("bb");			rewrite.markAsReplaced(first, newFirstArg);			rewrite.markAsReplaced(second, newSecondArg);						//rename params			SimpleName newFirstName= methodDecl.getAST().newSimpleName("yyy");			SimpleName newSecondName= methodDecl.getAST().newSimpleName("bb");			rewrite.markAsReplaced(firstParam.getName(), newFirstName);			rewrite.markAsReplaced(secondParam.getName(), newSecondName);						//reoder params			ASTNode paramplaceholder1= rewrite.createCopyPlaceholder(firstParam);			ASTNode paramplaceholder2= rewrite.createCopyPlaceholder(secondParam);						rewrite.markAsReplaced(firstParam, paramplaceholder2);			rewrite.markAsReplaced(secondParam, paramplaceholder1);						//reorder args			ASTNode placeholder1= rewrite.createCopyPlaceholder(first);			ASTNode placeholder2= rewrite.createCopyPlaceholder(second);						rewrite.markAsReplaced(first, placeholder2);			rewrite.markAsReplaced(second, placeholder1);					}					String preview= evaluateRewrite(cu, rewrite);				buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public class E {\n");		buf.append("    public void m(int bb, boolean yyy) {\n");		buf.append("        m(bb, yyy);\n");		buf.append("    }\n");		buf.append("}\n");				assertEqualString(preview, buf.toString());			}