if(fetchLogEntriesJob == null) { fetchLogEntriesJob = new FetchLogEntriesJob(); }
IPreferenceStore store = SVNUIPlugin.getPlugin().getPreferenceStore(); int entriesToFetch = store.getInt(ISVNUIConstants.PREF_LOG_ENTRIES_TO_FETCH); if (entriesToFetch > 0) fetchLogEntriesJob = new FetchLogEntriesJob(); else fetchLogEntriesJob = new FetchAllLogEntriesJob();
      public Object[] getElements(Object inputElement) {        // Short-circuit to optimize        if(entries != null)          return entries;        if( !(inputElement instanceof ISVNRemoteResource))          return null;        final ISVNRemoteResource remoteResource = (ISVNRemoteResource) inputElement;        if(fetchLogEntriesJob == null) {          fetchLogEntriesJob = new FetchLogEntriesJob();        }        if(fetchLogEntriesJob.getState() != Job.NONE) {          fetchLogEntriesJob.cancel();          try {            fetchLogEntriesJob.join();          } catch(InterruptedException e) {            SVNUIPlugin.log(new SVNException(                Policy.bind("HistoryView.errorFetchingEntries", remoteResource.getName()), e)); //$NON-NLS-1$          }        }        fetchLogEntriesJob.setRemoteFile(remoteResource);        Utils.schedule(fetchLogEntriesJob, SVNUIPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow()            .getActivePage().getActivePart().getSite());        return new Object[ 0];      }