ASTRewrite rewrite= new ASTRewrite(decl);  int newModifiers= decl.getModifiers() & ~Modifier.ABSTRACT; rewrite.markAsReplaced(decl, ASTNodeConstants.MODIFIERS, new Integer(newModifiers), null);  Block body= ast.newBlock(); rewrite.markAsInsert(decl, ASTNodeConstants.BODY, body, null);  Type returnType= decl.getReturnType(); if (!decl.isConstructor()) { Expression expression= ASTNodeFactory.newDefaultExpression(ast, returnType, decl.getExtraDimensions()); if (expression != null) { ReturnStatement returnStatement= ast.newReturnStatement(); returnStatement.setExpression(expression); body.statements().add(returnStatement);
{ ASTRewrite rewrite= new ASTRewrite(decl);  int newModifiers= decl.getModifiers() & ~Modifier.ABSTRACT; rewrite.markAsReplaced(decl, ASTNodeConstants.MODIFIERS, new Integer(newModifiers), null);  Block body= ast.newBlock(); rewrite.markAsInsert(decl, ASTNodeConstants.BODY, body, null);  Type returnType= decl.getReturnType(); if (!decl.isConstructor()) { Expression expression= ASTNodeFactory.newDefaultExpression(ast, returnType, decl.getExtraDimensions()); if (expression != null) { ReturnStatement returnStatement= ast.newReturnStatement(); returnStatement.setExpression(expression); body.statements().add(returnStatement); }
	public static void addMethodRequiresBodyProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {		ICompilationUnit cu= context.getCompilationUnit();		AST ast= context.getASTRoot().getAST();				ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());		if (!(selectedNode instanceof MethodDeclaration)) {			return;		}		MethodDeclaration decl=  (MethodDeclaration) selectedNode;				ASTRewrite rewrite= new ASTRewrite(decl);				int newModifiers= decl.getModifiers() & ~Modifier.ABSTRACT;		rewrite.markAsReplaced(decl, ASTNodeConstants.MODIFIERS, new Integer(newModifiers), null);						Block body= ast.newBlock();		rewrite.markAsInsert(decl, ASTNodeConstants.BODY, body, null);				Type returnType= decl.getReturnType();		if (!decl.isConstructor()) {			Expression expression= ASTNodeFactory.newDefaultExpression(ast, returnType, decl.getExtraDimensions());			if (expression != null) {				ReturnStatement returnStatement= ast.newReturnStatement();				returnStatement.setExpression(expression);				body.statements().add(returnStatement);							}		}		String label= CorrectionMessages.getString("ModifierCorrectionSubProcessor.addmissingbody.description"); //$NON-NLS-1$		Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);		ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 5, image);		proposal.ensureNoModifications();		proposals.add(proposal);	}