proposal.addImport(instanceTypeBinding);
String typeName= proposal.addImport(instanceTypeBinding); rewrite.markAsReplaced(qualifier, ASTNodeFactory.newName(astRoot.getAST(), typeName));
	public static void addInstanceAccessToStaticProposals(ICorrectionContext context, List proposals) throws CoreException {		ICompilationUnit cu= context.getCompilationUnit();		CompilationUnit astRoot= context.getASTRoot();		ASTNode selectedNode= context.getCoveredNode();		if (selectedNode == null) {			return;		}		Expression qualifier= null;		IBinding accessBinding= null;		        if (selectedNode instanceof QualifiedName) {        	QualifiedName name= (QualifiedName) selectedNode;             qualifier= name.getQualifier();        	accessBinding= name.resolveBinding();        } else if (selectedNode instanceof SimpleName) {        	ASTNode parent= selectedNode.getParent();        	if (parent instanceof FieldAccess) {        		FieldAccess fieldAccess= (FieldAccess) parent;        		qualifier= fieldAccess.getExpression();        		accessBinding= fieldAccess.getName().resolveBinding();        	}        } else if (selectedNode instanceof MethodInvocation) {        	MethodInvocation methodInvocation= (MethodInvocation) selectedNode;        	qualifier= methodInvocation.getExpression();        	accessBinding= methodInvocation.getName().resolveBinding();        } else if (selectedNode instanceof FieldAccess) {			FieldAccess fieldAccess= (FieldAccess) selectedNode;			qualifier= fieldAccess.getExpression();			accessBinding= fieldAccess.getName().resolveBinding();		}		ITypeBinding declaringTypeBinding= null;		if (accessBinding != null) {			if (accessBinding instanceof IMethodBinding) {				declaringTypeBinding= ((IMethodBinding) accessBinding).getDeclaringClass();			} else if (accessBinding instanceof IVariableBinding) {				declaringTypeBinding= ((IVariableBinding) accessBinding).getDeclaringClass();			}			if (declaringTypeBinding != null) {				ASTRewrite rewrite= new ASTRewrite(selectedNode.getParent());				rewrite.markAsReplaced(qualifier, astRoot.getAST().newSimpleName(declaringTypeBinding.getName()));				String label= CorrectionMessages.getFormattedString("LocalCorrectionsSubProcessor.changeaccesstostaticdefining.description", declaringTypeBinding.getName()); //$NON-NLS-1$				Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);				ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 2, image);				proposal.addImport(declaringTypeBinding);				proposal.ensureNoModifications();				proposals.add(proposal);			}		}        		if (qualifier != null) {			ITypeBinding instanceTypeBinding= ASTResolving.normalizeTypeBinding(qualifier.resolveTypeBinding());			if (instanceTypeBinding != null && instanceTypeBinding != declaringTypeBinding) {				ASTRewrite rewrite= new ASTRewrite(selectedNode.getParent());				rewrite.markAsReplaced(qualifier, astRoot.getAST().newSimpleName(instanceTypeBinding.getName()));								String label= CorrectionMessages.getFormattedString("LocalCorrectionsSubProcessor.changeaccesstostatic.description", instanceTypeBinding.getName()); //$NON-NLS-1$				Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);				ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 1, image);				proposal.addImport(instanceTypeBinding);				proposal.ensureNoModifications();				proposals.add(proposal);			}		}		ModifierCorrectionSubProcessor.addNonAccessibleMemberProposal(context, proposals, ModifierCorrectionSubProcessor.TO_NON_STATIC);	}