final IJavaElement targetElement= fTarget.getJavaElement(); if (targetElement != null && targetElement instanceof IField) { final IVisibilityAdjustment adjustmentForTarget= (IVisibilityAdjustment) adjustor.getAdjustments().get(targetElement); if (adjustmentForTarget != null) adjustor.getAdjustments().remove(targetElement); }
	protected TextChangeManager createChangeManager(final RefactoringStatus status, final IProgressMonitor monitor) throws JavaModelException, CoreException {		Assert.isNotNull(status);		Assert.isNotNull(monitor);		try {			monitor.beginTask("", 7); //$NON-NLS-1$			monitor.setTaskName(RefactoringCoreMessages.MoveInstanceMethodProcessor_creating); 			fSourceRewrite.clearASTAndImportRewrites();			final TextChangeManager manager= new TextChangeManager();			final CompilationUnitRewrite targetRewrite= fMethod.getCompilationUnit().equals(getTargetType().getCompilationUnit()) ? fSourceRewrite : new CompilationUnitRewrite(getTargetType().getCompilationUnit());			final MethodDeclaration declaration= ASTNodeSearchUtil.getMethodDeclarationNode(fMethod, fSourceRewrite.getRoot());			final SearchResultGroup[] references= computeMethodReferences(new SubProgressMonitor(monitor, 1), status);			final Map rewrites= new HashMap(2);			rewrites.put(fSourceRewrite.getCu(), fSourceRewrite);			if (!fSourceRewrite.getCu().equals(targetRewrite.getCu()))				rewrites.put(targetRewrite.getCu(), targetRewrite);			final ASTRewrite sourceRewrite= ASTRewrite.create(fSourceRewrite.getRoot().getAST());			final MemberVisibilityAdjustor adjustor= new MemberVisibilityAdjustor(fTargetType, fMethod);			adjustor.setStatus(status);			adjustor.setGetters(fUseGetters);			adjustor.setSetters(fUseSetters);			adjustor.setVisibilitySeverity(RefactoringStatus.WARNING);			adjustor.setFailureSeverity(RefactoringStatus.WARNING);			adjustor.setRewrites(rewrites);			adjustor.setRewrite(sourceRewrite, fSourceRewrite.getRoot());			adjustor.adjustVisibility(new SubProgressMonitor(monitor, 1));			final IDocument document= new Document(fMethod.getCompilationUnit().getBuffer().getContents());			final boolean target= createMethodCopy(document, declaration, sourceRewrite, rewrites, adjustor.getAdjustments(), status, new SubProgressMonitor(monitor, 1));			createMethodJavadocReferences(rewrites, declaration, references, target, status, new SubProgressMonitor(monitor, 1));			if (!fSourceRewrite.getCu().equals(targetRewrite.getCu()))				createMethodImports(targetRewrite, declaration, new SubProgressMonitor(monitor, 1), status);			boolean removable= false;			if (fInline) {				removable= createMethodDelegator(rewrites, declaration, references, adjustor.getAdjustments(), target, status, new SubProgressMonitor(monitor, 1));				if (fRemove && removable) {					fSourceRewrite.getASTRewrite().remove(declaration, fSourceRewrite.createGroupDescription(RefactoringCoreMessages.MoveInstanceMethodProcessor_remove_original_method)); 					if (!fSourceRewrite.getCu().equals(fTargetType.getCompilationUnit()))						fSourceRewrite.getImportRemover().registerRemovedNode(declaration);				}			}			if (!fRemove || !removable)				createMethodDelegation(declaration, rewrites, adjustor.getAdjustments(), status, new SubProgressMonitor(monitor, 1));			adjustor.rewriteVisibility(new SubProgressMonitor(monitor, 1));			sourceRewrite.rewriteAST(document, fMethod.getJavaProject().getOptions(true));			createMethodSignature(document, declaration, sourceRewrite, rewrites);			ICompilationUnit unit= null;			CompilationUnitRewrite rewrite= null;			for (final Iterator iterator= rewrites.keySet().iterator(); iterator.hasNext();) {				unit= (ICompilationUnit) iterator.next();				rewrite= (CompilationUnitRewrite) rewrites.get(unit);				manager.manage(unit, rewrite.createChange());			}			return manager;		} finally {			monitor.done();		}	}