}
} while (true);
}
IHashFunction hash= new DJBHashFunction();
DocumentEquivalenceClass leftEquivalent= new DocumentEquivalenceClass(reference, hash);
fLeftEquivalent= leftEquivalent;
IRangeComparator ref= new DocEquivalenceComparator(leftEquivalent, null);
DocumentEquivalenceClass rightEquivalent= new DocumentEquivalenceClass(actual, hash);
fRightEquivalent= rightEquivalent;
IRangeComparator act= new DocEquivalenceComparator(rightEquivalent, null);
List diffs= new ArrayList(Arrays.asList(RangeDifferencer.findRanges(fRangeDiffFactory, monitor, ref, act)));
// 7: Reset the model to the just gotten differences
// re-inject stored events to get up to date.
synchronized (DocumentLineDiffer.this) {
if (isCanceled(monitor))
return Status.CANCEL_STATUS;
// set the new differences so we can operate on them
fDifferences= diffs;
}
// re-inject events accumulated in the meantime.
try {
do {
DocumentEvent event;
synchronized (DocumentLineDiffer.this) {
if (isCanceled(monitor))
return Status.CANCEL_STATUS;
if (fStoredEvents.isEmpty()) {
// we are back in sync with the life documents
fInitializationJob= null;
fState= SYNCHRONIZED;
fLastDifference= null;
// replace the private documents with the actual
leftEquivalent.setDocument(left);
rightEquivalent.setDocument(right);
break;
}
event= (DocumentEvent) fStoredEvents.remove(0);