Expression modified= ASTResolving.getInitExpression(methodDecl.getReturnType());
Expression modified= ASTResolving.getInitExpression(methodDecl.getReturnType(), methodDecl.getExtraDimensions());
	public void testReplace() throws Exception {		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);				{	/* foo(): if.. -> return; */			StringBuffer buf= new StringBuffer();			buf.append("package test1;\n");			buf.append("public class C {\n");			buf.append("    public Object foo() {\n");			buf.append("        if (this.equals(new Object())) {\n");			buf.append("            toString();\n");			buf.append("        }\n");			buf.append("    }\n");			buf.append("}\n");				ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null);						CompilationUnit astRoot= AST.parseCompilationUnit(cu, false);			ASTRewrite rewrite= new ASTRewrite(astRoot);			TypeDeclaration type= findTypeDeclaration(astRoot, "C");						MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");			Block block= methodDecl.getBody();			assertTrue("No block" , block != null);							List statements= block.statements();			assertTrue("No statements in block", !statements.isEmpty());						ReturnStatement returnStatement= block.getAST().newReturnStatement();			rewrite.markAsReplaced((ASTNode) statements.get(0), returnStatement);								ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal("", cu, rewrite, 10, null);			proposal.getCompilationUnitChange().setSave(true);						proposal.apply(null);						buf= new StringBuffer();			buf.append("package test1;\n");			buf.append("public class C {\n");			buf.append("    public Object foo() {\n");			buf.append("        return;\n");						buf.append("    }\n");			buf.append("}\n");							assertEqualString(cu.getSource(), buf.toString());			clearRewrite(rewrite);		}				{	/* goo(): new Integer(3) -> 'null' */			StringBuffer buf= new StringBuffer();			buf.append("package test1;\n");			buf.append("public class D {\n");			buf.append("    public Object goo() {\n");			buf.append("        return new Integer(3);\n");			buf.append("    }\n");			buf.append("    public void hoo(int p1, Object p2) {\n");			buf.append("        return;\n");			buf.append("    }\n");					buf.append("}\n");				ICompilationUnit cu= pack1.createCompilationUnit("D.java", buf.toString(), false, null);						CompilationUnit astRoot= AST.parseCompilationUnit(cu, false);			ASTRewrite rewrite= new ASTRewrite(astRoot);			TypeDeclaration type= findTypeDeclaration(astRoot, "D");					MethodDeclaration methodDecl= findMethodDeclaration(type, "goo");			Block block= methodDecl.getBody();			assertTrue("No block" , block != null);						List statements= block.statements();			assertTrue("No statements in block", !statements.isEmpty());			assertTrue("No ReturnStatement", statements.get(0) instanceof ReturnStatement);						ReturnStatement returnStatement= (ReturnStatement) statements.get(0);			Expression expr= returnStatement.getExpression();			Expression modified= ASTResolving.getInitExpression(methodDecl.getReturnType());				rewrite.markAsReplaced(expr, modified);						ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal("", cu, rewrite, 10, null);			proposal.getCompilationUnitChange().setSave(true);						proposal.apply(null);						buf= new StringBuffer();			buf.append("package test1;\n");			buf.append("public class D {\n");			buf.append("    public Object goo() {\n");			buf.append("        return null;\n");			buf.append("    }\n");			buf.append("    public void hoo(int p1, Object p2) {\n");			buf.append("        return;\n");			buf.append("    }\n");					buf.append("}\n");							assertEqualString(cu.getSource(), buf.toString());			clearRewrite(rewrite);		}	}