Source:
private void scheduleReloadJob(final String trigger) { if (reloadJob != null) { if (reloadJobIsInitializing) return; reloadJob.cancel(); } for (Job updateJob : updateJobs.toArray(new Job[updateJobs.size()])) updateJob.cancel(); if (!checkRepository()) return; reloadJob = new Job(getReloadJobName()) { @Override protected IStatus run(IProgressMonitor monitor) { try { reloadJobIsInitializing = true; waitForWorkspaceLock(monitor); } finally { reloadJobIsInitializing = false; } lock.lock(); try { if (monitor.isCanceled()) return Status.CANCEL_STATUS; parallelism.acquire(); long startTime = System.currentTimeMillis(); IndexDiffData result = calcIndexDiffDataFull(monitor, getName()); if (monitor.isCanceled() || (result == null)) return Status.CANCEL_STATUS; indexDiffData = result; if (GitTraceLocation.INDEXDIFFCACHE.isActive()) { long time = System.currentTimeMillis() - startTime; StringBuilder message = new StringBuilder( getTraceMessage(time)); GitTraceLocation.getTrace().trace( GitTraceLocation.INDEXDIFFCACHE.getLocation(), message.append(indexDiffData.toString()) .toString()); } notifyListeners(); return Status.OK_STATUS; } catch (IOException e) { if (GitTraceLocation.INDEXDIFFCACHE.isActive()) GitTraceLocation.getTrace().trace( GitTraceLocation.INDEXDIFFCACHE.getLocation(), "Calculating IndexDiff failed", e); return Status.OK_STATUS; } catch (InterruptedException e) { return Status.CANCEL_STATUS; } finally { lock.unlock(); parallelism.release(); } } private String getTraceMessage(long time) { return NLS .bind("\nUpdated IndexDiffData in {0} ms\nReason: {1}\nRepository: {2}\n", new Object[] { Long.valueOf(time), trigger, repository.getWorkTree().getName() }); } @Override public boolean belongsTo(Object family) { if (family.equals(JobFamilies.INDEX_DIFF_CACHE_UPDATE)) return true; return super.belongsTo(family); } }; reloadJob.schedule(); }

Target:
private void scheduleReloadJob(final String trigger) { if (reloadJob != null) { if (reloadJobIsInitializing) return; reloadJob.cancel(); } if (updateJob != null) updateJob.cancel(); if (!checkRepository()) return; reloadJob = new Job(getReloadJobName()) { @Override protected IStatus run(IProgressMonitor monitor) { try { reloadJobIsInitializing = true; waitForWorkspaceLock(monitor); } finally { reloadJobIsInitializing = false; } lock.lock(); try { if (monitor.isCanceled()) return Status.CANCEL_STATUS; parallelism.acquire(); long startTime = System.currentTimeMillis(); IndexDiffData result = calcIndexDiffDataFull(monitor, getName()); if (monitor.isCanceled() || (result == null)) return Status.CANCEL_STATUS; indexDiffData = result; if (GitTraceLocation.INDEXDIFFCACHE.isActive()) { long time = System.currentTimeMillis() - startTime; StringBuilder message = new StringBuilder( getTraceMessage(time)); GitTraceLocation.getTrace().trace( GitTraceLocation.INDEXDIFFCACHE.getLocation(), message.append(indexDiffData.toString()) .toString()); } notifyListeners(); return Status.OK_STATUS; } catch (IOException e) { if (GitTraceLocation.INDEXDIFFCACHE.isActive()) GitTraceLocation.getTrace().trace( GitTraceLocation.INDEXDIFFCACHE.getLocation(), "Calculating IndexDiff failed", e); return Status.OK_STATUS; } catch (InterruptedException e) { return Status.CANCEL_STATUS; } finally { lock.unlock(); parallelism.release(); } } private String getTraceMessage(long time) { return NLS .bind("\nUpdated IndexDiffData in {0} ms\nReason: {1}\nRepository: {2}\n", new Object[] { Long.valueOf(time), trigger, repository.getWorkTree().getName() }); } @Override public boolean belongsTo(Object family) { if (JobFamilies.INDEX_DIFF_CACHE_UPDATE.equals(family)) return true; return super.belongsTo(family); } }; reloadJob.schedule(); }