ASTRewriteCorrectionProposal castProposal= getCastProposal(context, castType, nodeToCast);
ASTRewriteCorrectionProposal castProposal= getCastProposal(context, castType, nodeToCast, 5);
	public static void addCastProposals(IAssistContext context, IProblemLocation problem, Collection proposals) throws CoreException {		String[] args= problem.getProblemArguments();		if (args.length != 2) {			return;		}					ICompilationUnit cu= context.getCompilationUnit();		String castType= args[1];		CompilationUnit astRoot= context.getASTRoot();		ASTNode selectedNode= problem.getCoveredNode(context);		if (!(selectedNode instanceof Expression)) {			return;		}		Expression nodeToCast= (Expression) selectedNode;				int parentNodeType= selectedNode.getParent().getNodeType();		if (parentNodeType == ASTNode.ASSIGNMENT) {			Assignment assign= (Assignment) selectedNode.getParent();			if (selectedNode.equals(assign.getLeftHandSide())) {				nodeToCast= assign.getRightHandSide();			}		} else if (parentNodeType == ASTNode.VARIABLE_DECLARATION_FRAGMENT) {			VariableDeclarationFragment frag= (VariableDeclarationFragment) selectedNode.getParent();			if (selectedNode.equals(frag.getName())) {				nodeToCast= frag.getInitializer();			}		}		ASTRewriteCorrectionProposal castProposal= getCastProposal(context, castType, nodeToCast);		if (castProposal != null) {			proposals.add(castProposal);		}				if ("void".equals(args[1])) { //$NON-NLS-1$			return;		}				// change method return statement to actual type		if (parentNodeType == ASTNode.RETURN_STATEMENT) {			ITypeBinding binding= nodeToCast.resolveTypeBinding();									BodyDeclaration decl= ASTResolving.findParentBodyDeclaration(selectedNode);			if (binding != null && decl instanceof MethodDeclaration) {				MethodDeclaration methodDeclaration= (MethodDeclaration) decl;					binding= Bindings.normalizeTypeBinding(binding);				if (binding == null) {					binding= astRoot.getAST().resolveWellKnownType("java.lang.Object"); //$NON-NLS-1$				}					ASTRewrite rewrite= new ASTRewrite(methodDeclaration);					String label= CorrectionMessages.getFormattedString("LocalCorrectionsSubProcessor.changereturntype.description", binding.getName()); //$NON-NLS-1$				Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);				ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 2, image);				String returnTypeName= proposal.addImport(binding);								Type newReturnType= ASTNodeFactory.newType(astRoot.getAST(), returnTypeName);				rewrite.markAsReplaced(methodDeclaration.getReturnType(), newReturnType);								proposal.ensureNoModifications();				proposals.add(proposal);			}		}		if (parentNodeType == ASTNode.VARIABLE_DECLARATION_FRAGMENT) {			VariableDeclarationFragment fragment= (VariableDeclarationFragment) selectedNode.getParent();			ASTNode parent= fragment.getParent();			Type typeNode= null;						if (parent instanceof VariableDeclarationStatement) {				VariableDeclarationStatement stmt= (VariableDeclarationStatement) parent;				if (stmt.fragments().size() == 1) {					typeNode= stmt.getType();				}			} else if (parent instanceof FieldDeclaration) {				FieldDeclaration decl= (FieldDeclaration) parent;				if (decl.fragments().size() == 1) {					typeNode= decl.getType();				}			}			if (typeNode != null) {				ImportEdit edit= new ImportEdit(cu, JavaPreferencesSettings.getCodeGenerationSettings());				String typeName= edit.addImport(args[0]);				String label= CorrectionMessages.getFormattedString("LocalCorrectionsSubProcessor.addcast_var.description", typeName); //$NON-NLS-1$				ReplaceCorrectionProposal varProposal= new ReplaceCorrectionProposal(label, cu, typeNode.getStartPosition(), typeNode.getLength(), typeName, 1);				varProposal.getRootTextEdit().add(edit);					proposals.add(varProposal);			}		}				}