rewrite.markAsReplaced(methodDecl, MethodDeclaration.MODIFIERS_PROPERTY, new Integer(newModifiers), null);
rewrite.set(methodDecl, MethodDeclaration.MODIFIERS_PROPERTY, new Integer(newModifiers), null);
	public void testMethodBody() throws Exception {		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);		StringBuffer buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public abstract class E {\n");		buf.append("    public E(int p1, int p2, int p3) {}\n");		buf.append("    public void gee(int p1, int p2, int p3) throws IllegalArgumentException {}\n");		buf.append("    public void hee(int p1, int p2, int p3) throws IllegalArgumentException {}\n");		buf.append("    public void iee(int p1, int p2, int p3) throws IllegalArgumentException, IllegalAccessException {}\n");		buf.append("    public void jee(int p1, int p2, int p3) throws IllegalArgumentException, IllegalAccessException {}\n");		buf.append("    public abstract void kee(int p1, int p2, int p3) throws IllegalArgumentException, IllegalAccessException, SecurityException;\n");		buf.append("    public abstract void lee(int p1, int p2, int p3) throws IllegalArgumentException, IllegalAccessException, SecurityException;\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();		TypeDeclaration type= findTypeDeclaration(astRoot, "E");				{ // replace block			MethodDeclaration methodDecl= findMethodDeclaration(type, "E");						Block body= methodDecl.getBody();			assertTrue("No body: E", body != null);						Block newBlock= ast.newBlock();			rewrite.markAsReplaced(body, newBlock);		}		{ // delete block & set abstract			MethodDeclaration methodDecl= findMethodDeclaration(type, "gee");						// change flags			int newModifiers= Modifier.PUBLIC | Modifier.ABSTRACT;			rewrite.markAsReplaced(methodDecl, MethodDeclaration.MODIFIERS_PROPERTY, new Integer(newModifiers), null);						Block body= methodDecl.getBody();			assertTrue("No body: gee", body != null);			rewrite.markAsRemoved(body);		}		{ // insert block & set to private			MethodDeclaration methodDecl= findMethodDeclaration(type, "kee");						// change flags			int newModifiers= Modifier.PRIVATE;			rewrite.markAsReplaced(methodDecl, MethodDeclaration.MODIFIERS_PROPERTY, new Integer(newModifiers), null);									Block body= methodDecl.getBody();			assertTrue("Has body", body == null);						Block newBlock= ast.newBlock();			rewrite.markAsInsert(methodDecl, MethodDeclaration.BODY_PROPERTY, newBlock, null);		}				String preview= evaluateRewrite(cu, rewrite);				buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public abstract class E {\n");		buf.append("    public E(int p1, int p2, int p3) {\n");		buf.append("    }\n");		buf.append("    public abstract void gee(int p1, int p2, int p3) throws IllegalArgumentException;\n");		buf.append("    public void hee(int p1, int p2, int p3) throws IllegalArgumentException {}\n");		buf.append("    public void iee(int p1, int p2, int p3) throws IllegalArgumentException, IllegalAccessException {}\n");		buf.append("    public void jee(int p1, int p2, int p3) throws IllegalArgumentException, IllegalAccessException {}\n");		buf.append("    private void kee(int p1, int p2, int p3) throws IllegalArgumentException, IllegalAccessException, SecurityException {\n");		buf.append("    }\n");		buf.append("    public abstract void lee(int p1, int p2, int p3) throws IllegalArgumentException, IllegalAccessException, SecurityException;\n");		buf.append("}\n");			assertEqualString(preview, buf.toString());	}