rewrite.markAsReplaced(decl, SingleVariableDeclaration.MODIFIERS_PROPERTY, new Integer(newModifiers), null);
rewrite.set(decl, SingleVariableDeclaration.MODIFIERS_PROPERTY, new Integer(newModifiers), null);
	public void testSingleVariableDeclaration() throws Exception {		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 foo(int i, final int[] k, int[] x[]) {\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, "foo");		List arguments= methodDecl.parameters();		{ // add modifier, change type, change name, add extra dimension			SingleVariableDeclaration decl= (SingleVariableDeclaration) arguments.get(0);								int newModifiers= Modifier.FINAL;			rewrite.markAsReplaced(decl, SingleVariableDeclaration.MODIFIERS_PROPERTY, new Integer(newModifiers), null);			rewrite.markAsReplaced(decl, SingleVariableDeclaration.EXTRA_DIMENSIONS_PROPERTY, new Integer(1), null);						ArrayType newVarType= ast.newArrayType(ast.newPrimitiveType(PrimitiveType.FLOAT), 2);			rewrite.markAsReplaced(decl.getType(), newVarType);						Name newName= ast.newSimpleName("count");			rewrite.markAsReplaced(decl.getName(), newName);		}		{ // remove modifier, change type			SingleVariableDeclaration decl= (SingleVariableDeclaration) arguments.get(1);									int newModifiers= 0;			rewrite.markAsReplaced(decl, SingleVariableDeclaration.MODIFIERS_PROPERTY, new Integer(newModifiers), null);						Type newVarType= ast.newPrimitiveType(PrimitiveType.FLOAT);			rewrite.markAsReplaced(decl.getType(), newVarType);		}		{ // remove extra dim			SingleVariableDeclaration decl= (SingleVariableDeclaration) arguments.get(2);						rewrite.markAsReplaced(decl, SingleVariableDeclaration.EXTRA_DIMENSIONS_PROPERTY, new Integer(0), null);		}								String preview= evaluateRewrite(cu, rewrite);				buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public class E {\n");		buf.append("    public void foo(final float[][] count[], float k, int[] x) {\n");		buf.append("    }\n");		buf.append("}\n");			assertEqualString(preview, buf.toString());	}	