ASTNode selectedNode= problem.getCoveringNode(context);
ASTNode selectedNode= problem.getCoveringNode(astRoot);
	public static void addMissingReturnTypeProposals(IAssistContext context, IProblemLocation problem, Collection proposals) throws CoreException {		ICompilationUnit cu= context.getCompilationUnit();				CompilationUnit astRoot= context.getASTRoot();		ASTNode selectedNode= problem.getCoveringNode(context);		if (selectedNode == null) {			return;		}		BodyDeclaration decl= ASTResolving.findParentBodyDeclaration(selectedNode);		if (decl instanceof MethodDeclaration) {			MethodDeclaration methodDeclaration= (MethodDeclaration) decl;						ReturnStatementCollector eval= new ReturnStatementCollector();			decl.accept(eval);			ITypeBinding typeBinding= eval.getTypeBinding(decl.getAST());			typeBinding= Bindings.normalizeTypeBinding(typeBinding);			ASTRewrite rewrite= new ASTRewrite(methodDeclaration);			AST ast= astRoot.getAST();			Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);			LinkedCorrectionProposal proposal= new LinkedCorrectionProposal("", cu, rewrite, 6, image); //$NON-NLS-1$			Type type;			String typeName;			if (typeBinding != null) {				typeName= proposal.addImport(typeBinding);				type= ASTNodeFactory.newType(ast, typeName);			} else {				typeName= "void"; //$NON-NLS-1$						type= ast.newPrimitiveType(PrimitiveType.VOID);				}			proposal.setDisplayName(CorrectionMessages.getFormattedString("ReturnTypeSubProcessor.missingreturntype.description", typeName)); //$NON-NLS-1$					rewrite.markAsInserted(type);			methodDeclaration.setReturnType(type);						MethodDeclaration modifiedNode= ast.newMethodDeclaration();			modifiedNode.setModifiers(methodDeclaration.getModifiers()); // no changes			modifiedNode.setExtraDimensions(methodDeclaration.getExtraDimensions()); // no changes			modifiedNode.setConstructor(false);			rewrite.markAsModified(methodDeclaration, modifiedNode);						String key= "return_type"; //$NON-NLS-1$			proposal.markAsLinked(rewrite, type, true, key);			if (typeBinding != null) {				ITypeBinding[] bindings= ASTResolving.getRelaxingTypes(astRoot.getAST(), typeBinding);				for (int i= 0; i < bindings.length; i++) {					proposal.addLinkedModeProposal(key, bindings[i]);				}			}						proposal.ensureNoModifications();			proposals.add(proposal);						// change to constructor			ASTNode parentType= ASTResolving.findParentType(decl);			if (parentType instanceof TypeDeclaration) {				String constructorName= ((TypeDeclaration) parentType).getName().getIdentifier();				ASTNode nameNode= methodDeclaration.getName();				String label= CorrectionMessages.getFormattedString("ReturnTypeSubProcessor.wrongconstructorname.description", constructorName); //$NON-NLS-1$						proposals.add(new ReplaceCorrectionProposal(label, cu, nameNode.getStartPosition(), nameNode.getLength(), constructorName, 5));			}					}	}