}
} else { Block block= methodDecl.getBody(); if (block == null) { return; } AST ast= methodDecl.getAST(); ASTRewrite rewrite= new ASTRewrite(methodDecl);  List statements= block.statements(); ReturnStatement returnStatement= ast.newReturnStatement(); returnStatement.setExpression(ASTResolving.getInitExpression(methodDecl.getReturnType())); statements.add(returnStatement); rewrite.markAsInserted(returnStatement);  Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE); String label= CorrectionMessages.getString("ReturnTypeSubProcessor.addreturnstatement.description"); ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 10, image); proposals.add(proposal); }
	public static void addMissingReturnStatementProposals(ProblemPosition problemPos, ArrayList proposals) throws CoreException {		ICompilationUnit cu= problemPos.getCompilationUnit();				CompilationUnit astRoot= AST.parseCompilationUnit(cu, true);		ASTNode selectedNode= ASTResolving.findSelectedNode(astRoot, problemPos.getOffset(), problemPos.getLength());		if (selectedNode == null) {			return;		}		BodyDeclaration decl= ASTResolving.findParentBodyDeclaration(selectedNode);		if (decl instanceof MethodDeclaration) {			MethodDeclaration methodDecl= (MethodDeclaration) decl;			if (methodDecl.getName().equals(selectedNode)) {				Block block= methodDecl.getBody();				if (block == null) {					return;				}								ASTRewrite rewrite= new ASTRewrite(astRoot);								List statements= block.statements();				ReturnStatement returnStatement= block.getAST().newReturnStatement();				returnStatement.setExpression(ASTResolving.getInitExpression(methodDecl.getReturnType()));				statements.add(returnStatement);				rewrite.markAsInserted(returnStatement);								Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);				ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal("Add return statement", cu, rewrite, 10, image);				proposals.add(proposal);			} else if (selectedNode instanceof ReturnStatement) {				ReturnStatement returnStatement= (ReturnStatement) selectedNode;				if (returnStatement.getExpression() == null) {					ASTRewrite rewrite= new ASTRewrite(astRoot);										Expression expression= ASTResolving.getInitExpression(methodDecl.getReturnType());					returnStatement.setExpression(expression);					if (expression != null) {						rewrite.markAsInserted(expression);					}										Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);					ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal("Change return statement", cu, rewrite, 10, image);					proposals.add(proposal);				}			}		}		}