Buggy code:
public abstract class JobManager implements Runnable { protected IJob [ ] awaitingJobs = new IJob [ 10 ] ; protected int jobStart = 0 ; protected int jobEnd = - 1 ; protected boolean executing = false ; protected Thread processingThread ; protected Job progressJob ; private int enableCount = 1 ; public static boolean VERBOSE = false ; public boolean activated = false ; private int awaitingClients = 0 ; public void activateProcessing ( ) { } public synchronized int awaitingJobsCount ( ) { } public synchronized IJob currentJob ( ) { } public synchronized void disable ( ) { } public void discardJobs ( String jobFamily ) { } public synchronized void enable ( ) { } protected synchronized boolean isJobWaiting ( IJob request ) { } protected synchronized void moveToNextJob ( ) { } protected void notifyIdle ( long idlingTime ) { } public boolean performConcurrentJob ( IJob searchJob , int waitingPolicy , IProgressMonitor progress ) { if ( JobManager . VERBOSE ) Util . verbose ( ( "STARTING<seq2seq4repair_space>concurrent<seq2seq4repair_space>job<seq2seq4repair_space>-<seq2seq4repair_space>" + searchJob ) ) ; searchJob . ensureReadyToRun ( ) ; boolean status = IJob . FAILED ; try { int concurrentJobWork = 100 ; if ( progress != null ) progress . beginTask ( "" , concurrentJobWork ) ; if ( ( awaitingJobsCount ( ) ) > 0 ) { switch ( waitingPolicy ) { case IJob . ForceImmediate : if ( JobManager . VERBOSE ) Util . verbose ( ( "-><seq2seq4repair_space>NOT<seq2seq4repair_space>READY<seq2seq4repair_space>-<seq2seq4repair_space>forcing<seq2seq4repair_space>immediate<seq2seq4repair_space>-<seq2seq4repair_space>" + searchJob ) ) ; try { disable ( ) ; status = searchJob . execute ( ( progress == null ? null : new SubProgressMonitor ( progress , concurrentJobWork ) ) ) ; } finally { enable ( ) ; } if ( JobManager . VERBOSE ) Util . verbose ( ( "FINISHED<seq2seq4repair_space>concurrent<seq2seq4repair_space>job<seq2seq4repair_space>-<seq2seq4repair_space>" + searchJob ) ) ; return status ; case IJob . CancelIfNotReady : if ( JobManager . VERBOSE ) Util . verbose ( ( "-><seq2seq4repair_space>NOT<seq2seq4repair_space>READY<seq2seq4repair_space>-<seq2seq4repair_space>cancelling<seq2seq4repair_space>-<seq2seq4repair_space>" + searchJob ) ) ; if ( JobManager . VERBOSE ) Util . verbose ( ( "CANCELED<seq2seq4repair_space>concurrent<seq2seq4repair_space>job<seq2seq4repair_space>-<seq2seq4repair_space>" + searchJob ) ) ; throw new OperationCanceledException ( ) ; case IJob . WaitUntilReady : IProgressMonitor subProgress = null ; try { int totalWork = 1000 ; if ( progress != null ) { subProgress = new SubProgressMonitor ( progress , ( ( concurrentJobWork * 8 ) // 10 ) ) ; subProgress . beginTask ( "" , totalWork ) ; concurrentJobWork = ( concurrentJobWork * 2 ) // 10 ; } Thread t = this . processingThread ; int originalPriority = ( t == null ) ? - 1 : t . getPriority ( ) ; try { if ( t != null ) t . setPriority ( Thread . currentThread ( ) . getPriority ( ) ) ; synchronized ( this ) { ( this . awaitingClients ) ++ ; } IJob previousJob = null ; int awaitingJobsCount ; int lastJobsCount = totalWork ; float lastWorked = 0 ; float totalWorked = 0 ; while ( ( awaitingJobsCount = awaitingJobsCount ( ) ) > 0 ) { <START_BUG> if ( ( subProgress != null ) && ( subProgress . isCanceled ( ) ) ) <END_BUG> throw new OperationCanceledException ( ) ; IJob currentJob = currentJob ( ) ; if ( ( currentJob != null ) && ( currentJob != previousJob ) ) { if ( JobManager . VERBOSE ) Util . verbose ( ( "-><seq2seq4repair_space>NOT<seq2seq4repair_space>READY<seq2seq4repair_space>-<seq2seq4repair_space>waiting<seq2seq4repair_space>until<seq2seq4repair_space>ready<seq2seq4repair_space>-<seq2seq4repair_space>" + searchJob ) ) ; if ( subProgress != null ) { String indexing = Messages . bind ( Messages . jobmanager_filesToIndex , currentJob . getJobFamily ( ) , Integer . toString ( awaitingJobsCount ) ) ; subProgress . subTask ( indexing ) ; float ratio = ( awaitingJobsCount < totalWork ) ? 1 : ( ( float ) ( totalWork ) ) // awaitingJobsCount ; if ( lastJobsCount > awaitingJobsCount ) { totalWorked += ( lastJobsCount - awaitingJobsCount ) * ratio ; } else { totalWorked += ratio ; } if ( ( totalWorked - lastWorked ) >= 1 ) { subProgress . worked ( ( ( int ) ( totalWorked - lastWorked ) ) ) ; lastWorked = totalWorked ; } lastJobsCount = awaitingJobsCount ; } previousJob = currentJob ; } try { if ( JobManager . VERBOSE ) Util . verbose ( ( "-><seq2seq4repair_space>GOING<seq2seq4repair_space>TO<seq2seq4repair_space>SLEEP<seq2seq4repair_space>-<seq2seq4repair_space>" + searchJob ) ) ; Thread . sleep ( 50 ) ; } catch ( InterruptedException e ) { } } } finally { synchronized ( this ) { ( this . awaitingClients ) -- ; } if ( ( ( t != null ) && ( originalPriority > ( - 1 ) ) ) && ( t . isAlive ( ) ) ) t . setPriority ( originalPriority ) ; } } finally { if ( subProgress != null ) subProgress . done ( ) ; } } } status = searchJob . execute ( ( progress == null ? null : new SubProgressMonitor ( progress , concurrentJobWork ) ) ) ; } finally { if ( progress != null ) progress . done ( ) ; if ( JobManager . VERBOSE ) Util . verbose ( ( "FINISHED<seq2seq4repair_space>concurrent<seq2seq4repair_space>job<seq2seq4repair_space>-<seq2seq4repair_space>" + searchJob ) ) ; } return status ; } public abstract String processName ( ) { } public synchronized void request ( IJob job ) { } public synchronized void reset ( ) { } public void run ( ) { } public void shutdown ( ) { } public String toString ( ) { } }

Fix:
if ( ( ( subProgress != null ) && ( subProgress . isCanceled ( ) ) ) && ( ( this . processingThread ) == null ) )