rewrite.markAsReplaced(initializer, Initializer.MODIFIERS_PROPERTY, new Integer(newModifiers), null);
rewrite.set(initializer, Initializer.MODIFIERS_PROPERTY, new Integer(newModifiers), null);
	public void testInitializer() throws Exception {		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);		StringBuffer buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public class A {\n");		buf.append("    {\n");		buf.append("        foo();\n");		buf.append("    }\n");		buf.append("    static {\n");		buf.append("    }\n");		buf.append("}\n");			ICompilationUnit cu= pack1.createCompilationUnit("A.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, "A");				List declarations= type.bodyDeclarations();		assertTrue("Number of fieldDeclarations not 2", declarations.size() == 2);		{	// change modifier, replace body			Initializer initializer= (Initializer) declarations.get(0);						// add modifier			int newModifiers= Modifier.STATIC;			rewrite.markAsReplaced(initializer, Initializer.MODIFIERS_PROPERTY, new Integer(newModifiers), null);									Block block= ast.newBlock();			block.statements().add(ast.newReturnStatement());						rewrite.markAsReplaced(initializer.getBody(), block);		}		{	// change modifier			Initializer initializer= (Initializer) declarations.get(1);						int newModifiers= 0;			rewrite.markAsReplaced(initializer, Initializer.MODIFIERS_PROPERTY, new Integer(newModifiers), null);					}						String preview= evaluateRewrite(cu, rewrite);				buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public class A {\n");		buf.append("    static {\n");		buf.append("        return;\n");		buf.append("    }\n");		buf.append("    {\n");		buf.append("    }\n");		buf.append("}\n");					assertEqualString(preview, buf.toString());	}