if (binding == null && senderBinding.isAnonymous()) { ASTNode anonymDecl= astRoot.findDeclaringNode(senderBinding);
if (binding == null && senderDeclBinding.isAnonymous()) { ASTNode anonymDecl= astRoot.findDeclaringNode(senderDeclBinding);
	private static void addNewFieldProposals(ICompilationUnit cu, CompilationUnit astRoot, ITypeBinding binding, ITypeBinding declaringTypeBinding, SimpleName simpleName, boolean isWriteAccess, Collection proposals) throws JavaModelException {		// new variables		ICompilationUnit targetCU;		ITypeBinding senderBinding;		if (binding != null) {			senderBinding= binding;			targetCU= ASTResolving.findCompilationUnitForBinding(cu, astRoot, binding);		} else { // binding is null for accesses without qualifier			senderBinding= declaringTypeBinding;			targetCU= cu;		}				if (!senderBinding.isFromSource() || targetCU == null || !JavaModelUtil.isEditable(targetCU)) {			return;		}					ITypeBinding outsideAnonymous= null;		if (binding == null && senderBinding.isAnonymous()) {			ASTNode anonymDecl= astRoot.findDeclaringNode(senderBinding);			if (anonymDecl != null) {				ITypeBinding bind= Bindings.getBindingOfParentType(anonymDecl.getParent());				if (!bind.isAnonymous()) {					outsideAnonymous= bind;				}			}		}				String name= simpleName.getIdentifier();		int relevance= StubUtility.hasFieldName(cu.getJavaProject(), name) ? 9 : 6;		String label;		Image image;		if (binding == null) {			label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createfield.description", name); //$NON-NLS-1$			image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PRIVATE);		} else {			label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createfield.other.description", new Object[] { name, binding.getName() } ); //$NON-NLS-1$			image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PUBLIC);		}				proposals.add(new NewVariableCompletionProposal(label, targetCU, NewVariableCompletionProposal.FIELD, simpleName, senderBinding, relevance, image));		// create field in outer class (if inside anonymous)		if (outsideAnonymous != null) {			label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createfield.other.description", new Object[] { name, outsideAnonymous.getName() } ); //$NON-NLS-1$			image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PUBLIC);			proposals.add(new NewVariableCompletionProposal(label, targetCU, NewVariableCompletionProposal.FIELD, simpleName, outsideAnonymous, relevance + 1, image));		}				// create constant				if (!isWriteAccess) {			relevance= StubUtility.hasConstantName(name) ? 9 : 4;			ITypeBinding target= (outsideAnonymous != null) ? outsideAnonymous : senderBinding;			if (binding == null) {				label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createconst.description", name); //$NON-NLS-1$				image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PRIVATE);			} else {				label= CorrectionMessages.getFormattedString("UnresolvedElementsSubProcessor.createconst.other.description", new Object[] { name, binding.getName() } ); //$NON-NLS-1$				image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PUBLIC);			}			proposals.add(new NewVariableCompletionProposal(label, targetCU, NewVariableCompletionProposal.CONST_FIELD, simpleName, target, relevance, image));		}	}