this.revision2 = revision2;
this.showLastDifference = showLastDifference;
}
public void run() {
final Diff diff = Diff.getDefault();
final DiffStreamSource s1 = new DiffStreamSource(header.getFile(), revision1, revision1);
final DiffStreamSource s2 = new DiffStreamSource(header.getFile(), revision2, revision2);
// it's enqueued at ClientRuntime queue and does not return until previous request handled
s1.getMIMEType(); // triggers s1.init()
if (cancelled) {
return;
}
s2.getMIMEType(); // triggers s2.init()
if (cancelled) {
return;
}
if (currentTask != this) {
return;
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
if (cancelled) {
return;
}
final DiffView view = diff.createDiff(s1, s2);
if (currentTask == ShowDiffTask.this) {
currentDiff = view;
setBottomComponent(currentDiff.getComponent());
if (currentDiff.getDifferenceCount() > 0) {
currentDifferenceIndex = showLastDifference ? currentDiff.getDifferenceCount() - 1 : 0;