} else if (selectedNode instanceof SimpleType) { similarNodeKind= SimilarElementsRequestor.REF_TYPES; node= ((SimpleType) selectedNode).getName();
	public static void getVariableProposals(ICorrectionContext context, List proposals) throws CoreException {				ICompilationUnit cu= context.getCompilationUnit();				CompilationUnit astRoot= context.getASTRoot();		ASTNode selectedNode= context.getCoveredNode();		if (selectedNode == null) {			return;		}				// type that defines the variable, null if local		ITypeBinding binding= null;		ITypeBinding declaringTypeBinding= ASTResolving.getBindingOfParentType(selectedNode);		if (declaringTypeBinding == null) {			return;		}				// possible kind of the node		int similarNodeKind= SimilarElementsRequestor.VARIABLES;				Name node= null;		if (selectedNode instanceof SimpleName) {			node= (SimpleName) selectedNode;			ASTNode parent= node.getParent();			if (parent instanceof MethodInvocation && node.equals(((MethodInvocation)parent).getExpression())) {				similarNodeKind |= SimilarElementsRequestor.CLASSES;			}		} else if (selectedNode instanceof QualifiedName) {			QualifiedName qualifierName= (QualifiedName) selectedNode;			ITypeBinding qualifierBinding= qualifierName.getQualifier().resolveTypeBinding();			if (qualifierBinding != null) {				node= qualifierName.getName();				binding= qualifierBinding;			} else {				node= qualifierName.getQualifier();				if (node.isSimpleName()) {					similarNodeKind |= SimilarElementsRequestor.REF_TYPES;				} else {					similarNodeKind= SimilarElementsRequestor.REF_TYPES;				}			}		} else if (selectedNode instanceof FieldAccess) {			FieldAccess access= (FieldAccess) selectedNode;			Expression expression= access.getExpression();			if (expression != null) {				binding= expression.resolveTypeBinding();				if (binding != null) {					node= access.getName();				}			}		} else if (selectedNode instanceof SuperFieldAccess) {			binding= declaringTypeBinding.getSuperclass();			} else if (selectedNode instanceof SimpleType) {			similarNodeKind= SimilarElementsRequestor.REF_TYPES;			node= ((SimpleType) selectedNode).getName();		}		if (node == null) {			return;		}				// avoid corrections like int i= i;		String assignedName= null;		ASTNode parent= node.getParent();		if (parent.getNodeType() == ASTNode.VARIABLE_DECLARATION_FRAGMENT) {			assignedName= ((VariableDeclarationFragment) parent).getName().getIdentifier();		}		// corrections		SimilarElement[] elements= SimilarElementsRequestor.findSimilarElement(cu, node, similarNodeKind);		for (int i= 0; i < elements.length; i++) {			SimilarElement curr= elements[i];			if ((curr.getKind() & SimilarElementsRequestor.VARIABLES) != 0 && !curr.getName().equals(assignedName)) {				String label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.changevariable.description", curr.getName()); //$NON-NLS-1$				proposals.add(new ReplaceCorrectionProposal(label, cu, node.getStartPosition(), node.getLength(), curr.getName(), 3));			}		}		// add type proposals		if ((similarNodeKind & SimilarElementsRequestor.ALL_TYPES) != 0) {			int relevance= Character.isUpperCase(ASTResolving.getSimpleName(node).charAt(0)) ? 3 : 0;			addSimilarTypeProposals(elements, cu, node, relevance + 1, proposals);			addNewTypeProposals(cu, node, SimilarElementsRequestor.REF_TYPES, relevance, proposals);		}				if ((similarNodeKind & SimilarElementsRequestor.VARIABLES) == 0) {			return;		}				SimpleName simpleName= node.isSimpleName() ? (SimpleName) node : ((QualifiedName) node).getName();		// 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, 2, image));			if (binding == null && senderBinding.isAnonymous()) {				ASTNode anonymDecl= astRoot.findDeclaringNode(senderBinding);				if (anonymDecl != null) {					senderBinding= ASTResolving.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, 2, 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, 1, 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, 3, image));			}		}			}