type= ASTResolving.getTypeFromTypeBinding(ast, typeBinding); typeName= typeBinding.getName();
typeName= proposal.addImport(typeBinding); type= ASTNodeFactory.newType(ast, typeName);
	public static void addMissingReturnTypeProposals(ICorrectionContext context, List proposals) throws CoreException {		ICompilationUnit cu= context.getCompilationUnit();				CompilationUnit astRoot= context.getASTRoot();		ASTNode selectedNode= context.getCoveringNode();		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());			ASTRewrite rewrite= new ASTRewrite(methodDeclaration);			AST ast= astRoot.getAST();			Type type;			String typeName;			if (typeBinding != null) {				type= ASTResolving.getTypeFromTypeBinding(ast, typeBinding);				typeName= typeBinding.getName();			} else {				type= ast.newPrimitiveType(PrimitiveType.VOID);				typeName= "void"; //$NON-NLS-1$			}				String label= CorrectionMessages.getFormattedString("ReturnTypeSubProcessor.missingreturntype.description", typeName); //$NON-NLS-1$					Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);			ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 2, image);			if (typeBinding != null) {				proposal.addImport(typeBinding);			}			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);			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();				label= CorrectionMessages.getFormattedString("ReturnTypeSubProcessor.wrongconstructorname.description", constructorName); //$NON-NLS-1$						proposals.add(new ReplaceCorrectionProposal(label, cu, nameNode.getStartPosition(), nameNode.getLength(), constructorName, 1));			}					}	}