if (fUpdateReferences) result.merge(analyzeCompilationUnits());
result.merge(analyzeCompilationUnits());
	public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException {		try{			RefactoringStatus result= new RefactoringStatus();			pm.beginTask("", 19); //$NON-NLS-1$			// TODO workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=40367			if (!Checks.isAvailable(fMethod)) {				result.addFatalError(RefactoringCoreMessages.getString("RenameMethodProcessor.is_binary"), JavaStatusContext.create(fMethod)); //$NON-NLS-1$				return result;			}			result.merge(Checks.checkIfCuBroken(fMethod));			if (result.hasFatalError())				return result;			pm.setTaskName(RefactoringCoreMessages.getString("RenameMethodRefactoring.taskName.checkingPreconditions")); //$NON-NLS-1$			result.merge(checkNewElementName(getNewElementName()));			pm.worked(1);						boolean mustAnalyzeShadowing;			IMethod[] newNameMethods= searchForDeclarationsOfClashingMethods(new SubProgressMonitor(pm, 2));			if (newNameMethods.length == 0) {				mustAnalyzeShadowing= false;				pm.worked(2);			} else {				IType[] outerTypes= searchForOuterTypesOfReferences(newNameMethods, new SubProgressMonitor(pm, 3));				if (outerTypes.length > 0) {					//There exists a reference to a clashing method, where the reference is in a nested type.					//That nested type could be a type in a ripple method's hierarchy, which could					//cause the reference to bind to the new ripple method instead of to					//its old binding (a method of an enclosing scope).					//-> Getting *more* references than before -> Semantics not preserved.					//Example: RenamePrivateMethodTests#testFail6()					//TODO: could pass declaringTypes to the RippleMethodFinder and check whether					//a hierarchy contains one of outerTypes (or an outer type of an outerType, recursively).					mustAnalyzeShadowing= true;									} else {					boolean hasOldRefsInInnerTypes= true;						//TODO: to implement this optimization:						//- move search for references to before this check.						//- collect references in inner types.						//- for each reference, check for all supertypes and their enclosing types						//(recursively), whether they declare a rippleMethod					if (hasOldRefsInInnerTypes) {						//There exists a reference to a ripple method in a nested type						//of a type in the hierarchy of any ripple method.						//When that reference is renamed, and one of the supertypes of the						//nested type declared a method matching the new name, then						//the renamed reference will bind to the method in its supertype,						//since inherited methods bind stronger than methods from enclosing scopes.						//Getting *less* references than before -> Semantics not preserved.						//Examples: RenamePrivateMethodTests#testFail2(), RenamePrivateMethodTests#testFail5()						mustAnalyzeShadowing= true;					} else {						mustAnalyzeShadowing= false;					}				}			}						initializeMethodsToRename(new SubProgressMonitor(pm, 3));			pm.setTaskName(RefactoringCoreMessages.getString("RenameMethodRefactoring.taskName.searchingForReferences")); //$NON-NLS-1$			fOccurrences= getOccurrences(new SubProgressMonitor(pm, 4), result);				pm.setTaskName(RefactoringCoreMessages.getString("RenameMethodRefactoring.taskName.checkingPreconditions")); //$NON-NLS-1$						if (fUpdateReferences)				result.merge(checkRelatedMethods());			pm.worked(1);						if (fUpdateReferences)				result.merge(analyzeCompilationUnits()); //removes CUs with syntax errors			pm.worked(1);						if (result.hasFatalError())				return result;						fChangeManager= createChangeManager(new SubProgressMonitor(pm, 3), result);			if (fUpdateReferences & mustAnalyzeShadowing)				result.merge(analyzeRenameChanges(new SubProgressMonitor(pm, 1)));			else				pm.worked(1);						ValidateEditChecker checker= (ValidateEditChecker)context.getChecker(ValidateEditChecker.class);			checker.addFiles(getAllFilesToModify());			return result;		} finally{			pm.done();		}		}