final boolean isSubUnit= rewrite.getCu().equals(unit.getPrimary()); if (isSubUnit) currentRewrite= rewrite;
final CompilationUnitRewrite existingRewrite= (CompilationUnitRewrite) fCompilationUnitRewrites.get(unit.getPrimary()); final boolean isTouched= existingRewrite != null; if (isTouched) currentRewrite= existingRewrite;
	protected void rewriteTypeOccurrences(final TextChangeManager manager, final ASTRequestor requestor, final CompilationUnitRewrite rewrite, final ICompilationUnit unit, final CompilationUnit node, final Set replacements) throws CoreException {		CompilationUnitRewrite currentRewrite= null;		// TODO: Is this check valid?		final boolean isSubUnit= rewrite.getCu().equals(unit.getPrimary());		if (isSubUnit)			currentRewrite= rewrite;		else			currentRewrite= new CompilationUnitRewrite(fOwner, unit, node);		final Collection collection= (Collection) fTypeOccurrences.get(unit);		if (collection != null && !collection.isEmpty()) {			TType estimate= null;			ISourceConstraintVariable variable= null;			ITypeConstraintVariable constraint= null;			for (final Iterator iterator= collection.iterator(); iterator.hasNext();) {				variable= (ISourceConstraintVariable) iterator.next();				if (variable instanceof ITypeConstraintVariable) {					constraint= (ITypeConstraintVariable) variable;					estimate= (TType) constraint.getData(SuperTypeConstraintsSolver.DATA_TYPE_ESTIMATE);					if (estimate != null) {						final CompilationUnitRange range= constraint.getRange();						if (isSubUnit)							rewriteTypeOccurrence(range, estimate, requestor, currentRewrite, node, replacements, currentRewrite.createCategorizedGroupDescription(RefactoringCoreMessages.SuperTypeRefactoringProcessor_update_type_occurrence, SET_SUPER_TYPE));						else {							final ASTNode result= NodeFinder.perform(node, range.getSourceRange());							if (result != null)								rewriteTypeOccurrence(estimate, currentRewrite, result, currentRewrite.createCategorizedGroupDescription(RefactoringCoreMessages.SuperTypeRefactoringProcessor_update_type_occurrence, SET_SUPER_TYPE));						}					}				}			}		}		if (!isSubUnit) {			final TextChange change= currentRewrite.createChange();			if (change != null)				manager.manage(unit, change);		}	}