/** * Creates a new reconciler. * * @param editor the editor * @param strategy the reconcile strategy * @param isIncremental <code>true</code> if this is an incremental reconciler */ public JavaReconciler(ITextEditor editor, JavaCompositeReconcilingStrategy strategy, boolean isIncremental) { super(strategy, isIncremental); fTextEditor= editor; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=63898 // when re-using editors, a new reconciler is set up by the source viewer // and the old one uninstalled. However, the old reconciler may still be // running. // To avoid having to reconcilers calling CompilationUnitEditor.reconciled, // we synchronized on a lock object provided by the editor. // The critical section is really the entire run() method of the reconciler // thread, but synchronizing process() only will keep JavaReconcilingStrategy // from running concurrently on the same editor. // TODO remove once we have ensured that there is only one reconciler per editor. if (editor instanceof CompilationUnitEditor) fMutex= ((CompilationUnitEditor) editor).getReconcilerLock(); else fMutex= new Object(); // Null Object }
/** * Creates a new reconciler. * * @param editor the editor * @param strategy the reconcile strategy * @param isIncremental <code>true</code> if this is an incremental reconciler */ public JavaReconciler(ITextEditor editor, JavaCompositeReconcilingStrategy strategy, boolean isIncremental) { super(strategy, isIncremental); fTextEditor= editor; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=63898 // when re-using editors, a new reconciler is set up by the source viewer // and the old one uninstalled. However, the old reconciler may still be // running. // To avoid having to reconcilers calling CompilationUnitEditor.reconciled, // we synchronized on a lock object provided by the editor. // The critical section is really the entire run() method of the reconciler // thread, but synchronizing process() only will keep JavaReconcilingStrategy // from running concurrently on the same editor. // TODO remove once we have ensured that there is only one reconciler per editor. if (editor instanceof CompilationUnitEditor) fMutex= ((CompilationUnitEditor) editor).getReconcilerLock(); else fMutex= new Object(); // Null Object }
/** * Creates a new reconciler. * * @param editor the editor * @param strategy the reconcile strategy * @param isIncremental <code>true</code> if this is an incremental reconciler */ public JavaReconciler(ITextEditor editor, JavaCompositeReconcilingStrategy strategy, boolean isIncremental) { super(strategy, isIncremental); fTextEditor= editor; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=63898 // when re-using editors, a new reconciler is set up by the source viewer // and the old one uninstalled. However, the old reconciler may still be // running. // To avoid having to reconcilers calling CompilationUnitEditor.reconciled, // we synchronized on a lock object provided by the editor. // The critical section is really the entire run() method of the reconciler // thread, but synchronizing process() only will keep JavaReconcilingStrategy // from running concurrently on the same editor. // TODO remove once we have ensured that there is only one reconciler per editor. if (editor instanceof CompilationUnitEditor) fMutex= ((CompilationUnitEditor) editor).getReconcilerLock(); else fMutex= new Object(); // Null Object }