try {
IDocument document= fProjectionViewer.getDocument();
if (document instanceof ISynchronizable && fAnnotationModel instanceof ISynchronizable) {
ISynchronizable sync= (ISynchronizable) fAnnotationModel;
previousLockObject= sync.getLockObject();
sync.setLockObject(((ISynchronizable) document).getLockObject());
}
removeSummaries(monitor);
if (isCanceled(monitor))
return;
createSummaries(monitor);
} finally {
if (fAnnotationModel instanceof ISynchronizable) {
ISynchronizable sync= (ISynchronizable) fAnnotationModel;
sync.setLockObject(previousLockObject);
}
fAnnotationModel= null;
}
}