public static void getVariableProposals(IAssistContext context, IProblemLocation problem, Collection proposals) throws CoreException {
public static void getVariableProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
	public static void getVariableProposals(IAssistContext context, IProblemLocation problem, Collection proposals) throws CoreException {				ICompilationUnit cu= context.getCompilationUnit();				CompilationUnit astRoot= context.getASTRoot();		ASTNode selectedNode= problem.getCoveredNode(context);		if (selectedNode == null) {			return;		}				// type that defines the variable		ITypeBinding binding= null;		ITypeBinding declaringTypeBinding= Bindings.getBindingOfParentType(selectedNode);		if (declaringTypeBinding == null) {			return;		}				// possible type kind of the node		boolean suggestVariablePropasals= true;		int typeKind= 0;				Name node= null;		switch (selectedNode.getNodeType()) {			case ASTNode.SIMPLE_NAME:				node= (SimpleName) selectedNode;				ASTNode parent= node.getParent();				if (parent instanceof MethodInvocation && node.equals(((MethodInvocation)parent).getExpression())) {					typeKind= SimilarElementsRequestor.CLASSES;				} else if (parent instanceof SimpleType) {					suggestVariablePropasals= false;					typeKind= SimilarElementsRequestor.REF_TYPES;				}				break;					case ASTNode.QUALIFIED_NAME:				QualifiedName qualifierName= (QualifiedName) selectedNode;				ITypeBinding qualifierBinding= qualifierName.getQualifier().resolveTypeBinding();				if (qualifierBinding != null) {					node= qualifierName.getName();					binding= qualifierBinding;				} else {					node= qualifierName.getQualifier();					typeKind= SimilarElementsRequestor.REF_TYPES;					suggestVariablePropasals= node.isSimpleName();				}				if (selectedNode.getParent() instanceof SimpleType) {					typeKind= SimilarElementsRequestor.REF_TYPES;					suggestVariablePropasals= false;				}				break;					case ASTNode.FIELD_ACCESS:				FieldAccess access= (FieldAccess) selectedNode;				Expression expression= access.getExpression();				if (expression != null) {					binding= expression.resolveTypeBinding();					if (binding != null) {						node= access.getName();					}				}				break;			case ASTNode.SUPER_FIELD_ACCESS:				binding= declaringTypeBinding.getSuperclass();				node= ((SuperFieldAccess) selectedNode).getName();				break;			default:			}				if (node == null) {			return;		}				// add type proposals		if (typeKind != 0) {			int relevance= Character.isUpperCase(ASTResolving.getSimpleName(node).charAt(0)) ? 3 : 0;			addSimilarTypeProposals(typeKind, cu, node, relevance + 1, proposals);			addNewTypeProposals(cu, node, SimilarElementsRequestor.REF_TYPES, relevance, proposals);		}				if (!suggestVariablePropasals) {			return;		}				SimpleName simpleName= node.isSimpleName() ? (SimpleName) node : ((QualifiedName) node).getName();		addSimilarVariableProposals(cu, astRoot, simpleName, proposals);		// new variables		ICompilationUnit targetCU= ASTResolving.findCompilationUnitForBinding(cu, astRoot, binding);		ITypeBinding senderBinding= binding != null ? binding : declaringTypeBinding;		if (senderBinding.isFromSource() && targetCU != null && JavaModelUtil.isEditable(targetCU)) {			String label;			Image image;			if (binding == null) {				label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createfield.description", simpleName.getIdentifier()); //$NON-NLS-1$				image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PRIVATE);			} else {				label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createfield.other.description", new Object[] { simpleName.getIdentifier(), binding.getName() } ); //$NON-NLS-1$				image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PUBLIC);			}			proposals.add(new NewVariableCompletionProposal(label, targetCU, NewVariableCompletionProposal.FIELD, simpleName, senderBinding, 6, image));			if (binding == null && senderBinding.isAnonymous()) {				ASTNode anonymDecl= astRoot.findDeclaringNode(senderBinding);				if (anonymDecl != null) {					senderBinding= Bindings.getBindingOfParentType(anonymDecl.getParent());					if (!senderBinding.isAnonymous()) {						label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createfield.other.description", new Object[] { simpleName.getIdentifier(), senderBinding.getName() } ); //$NON-NLS-1$						image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PUBLIC);						proposals.add(new NewVariableCompletionProposal(label, targetCU, NewVariableCompletionProposal.FIELD, simpleName, senderBinding, 6, image));					}				}			}		}		if (binding == null) {			BodyDeclaration bodyDeclaration= ASTResolving.findParentBodyDeclaration(node);			int type= bodyDeclaration.getNodeType();			if (type == ASTNode.METHOD_DECLARATION) {				String label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createparameter.description", simpleName.getIdentifier()); //$NON-NLS-1$				Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_LOCAL);				proposals.add(new NewVariableCompletionProposal(label, cu, NewVariableCompletionProposal.PARAM, simpleName, null, 5, image));			}			if (type == ASTNode.METHOD_DECLARATION || type == ASTNode.INITIALIZER) {				String label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createlocal.description", simpleName.getIdentifier()); //$NON-NLS-1$				Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_LOCAL);				proposals.add(new NewVariableCompletionProposal(label, cu, NewVariableCompletionProposal.LOCAL, simpleName, null, 7, image));			}						if (node.getParent().getNodeType() == ASTNode.ASSIGNMENT) {				Assignment assignment= (Assignment) node.getParent();				if (assignment.getLeftHandSide() == node && assignment.getParent().getNodeType() == ASTNode.EXPRESSION_STATEMENT) {					ASTNode statement= assignment.getParent();					ASTRewrite rewrite= new ASTRewrite(statement.getParent());					rewrite.markAsRemoved(statement);								String label= CorrectionMessages.getString("UnresolvedElementsSubProcessor.removestatement.description"); //$NON-NLS-1$					Image image= JavaPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);					ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 4, image);					proposal.ensureNoModifications();					proposals.add(proposal);				}			}					}	}