CompilationUnit astRoot= AST.parseCompilationUnit(cu, false);
CompilationUnit astRoot= AST.parseCompilationUnit(cu, false, null, null);
	public void testMethodDeclarationExtraDimensions() 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 Object foo1() { return null; }\n");		buf.append("    public Object foo2() throws IllegalArgumentException { return null; }\n");		buf.append("    public Object foo3()[][] { return null; }\n");		buf.append("    public Object foo4()[][] throws IllegalArgumentException { return null; }\n");		buf.append("    public Object foo5()[][] { return null; }\n");		buf.append("    public Object foo6(int i)[][] throws IllegalArgumentException { return null; }\n");		buf.append("    public Object foo7(int i)[][] { return null; }\n");		buf.append("}\n");			ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);					CompilationUnit astRoot= AST.parseCompilationUnit(cu, false);		NewASTRewrite rewrite= new NewASTRewrite(astRoot.getAST());		AST ast= astRoot.getAST();		TypeDeclaration type= findTypeDeclaration(astRoot, "E");				{ // add extra dim, add throws			MethodDeclaration methodDecl= findMethodDeclaration(type, "foo1");						rewrite.markAsReplaced(methodDecl, ASTNodeConstants.EXTRA_DIMENSIONS, new Integer(1), null);						Name newThrownException2= ast.newSimpleName("ArrayStoreException");			rewrite.getListRewrite(methodDecl, ASTNodeConstants.THROWN_EXCEPTIONS).insertLast(newThrownException2, null);		}		{ // add extra dim, remove throws			MethodDeclaration methodDecl= findMethodDeclaration(type, "foo2");						rewrite.markAsReplaced(methodDecl, ASTNodeConstants.EXTRA_DIMENSIONS, new Integer(1), null);						rewrite.markAsRemoved((ASTNode) methodDecl.thrownExceptions().get(0));					}				{ // remove extra dim, add throws			MethodDeclaration methodDecl= findMethodDeclaration(type, "foo3");			rewrite.markAsReplaced(methodDecl, ASTNodeConstants.EXTRA_DIMENSIONS, new Integer(1), null);						Name newThrownException2= ast.newSimpleName("ArrayStoreException");			rewrite.getListRewrite(methodDecl, ASTNodeConstants.THROWN_EXCEPTIONS).insertLast(newThrownException2, null);		}		{ // add extra dim, remove throws			MethodDeclaration methodDecl= findMethodDeclaration(type, "foo4");						rewrite.markAsReplaced(methodDecl, ASTNodeConstants.EXTRA_DIMENSIONS, new Integer(1), null);						rewrite.markAsRemoved((ASTNode) methodDecl.thrownExceptions().get(0));					}		{ // add params, add extra dim, add throws			MethodDeclaration methodDecl= findMethodDeclaration(type, "foo5");						SingleVariableDeclaration newParam1= createNewParam(ast, "m1");			rewrite.getListRewrite(methodDecl, ASTNodeConstants.PARAMETERS).insertLast(newParam1, null);						rewrite.markAsReplaced(methodDecl, ASTNodeConstants.EXTRA_DIMENSIONS, new Integer(4), null);						Name newThrownException2= ast.newSimpleName("ArrayStoreException");			rewrite.getListRewrite(methodDecl, ASTNodeConstants.THROWN_EXCEPTIONS).insertLast(newThrownException2, null);			}		{ // remove params, add extra dim, remove throws			MethodDeclaration methodDecl= findMethodDeclaration(type, "foo6");						rewrite.markAsRemoved((ASTNode) methodDecl.parameters().get(0));								rewrite.markAsReplaced(methodDecl, ASTNodeConstants.EXTRA_DIMENSIONS, new Integer(4), null);						rewrite.markAsRemoved((ASTNode) methodDecl.thrownExceptions().get(0));					}		{ // remove block			MethodDeclaration methodDecl= findMethodDeclaration(type, "foo7");			rewrite.markAsRemoved(methodDecl.getBody());					}									String preview= evaluateRewrite(cu, rewrite);				buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public abstract class E {\n");		buf.append("    public Object foo1()[] throws ArrayStoreException { return null; }\n");		buf.append("    public Object foo2()[] { return null; }\n");		buf.append("    public Object foo3()[] throws ArrayStoreException { return null; }\n");		buf.append("    public Object foo4()[] { return null; }\n");		buf.append("    public Object foo5(float m1)[][][][] throws ArrayStoreException { return null; }\n");		buf.append("    public Object foo6()[][][][] { return null; }\n");		buf.append("    public Object foo7(int i)[][];\n");				buf.append("}\n");			assertEqualString(preview, buf.toString());	}