Search in sources :

Example 1 with IJob

use of org.eclipse.jdt.internal.core.search.processing.IJob in project che by eclipse.

the class IndexManager method saveIndex.

public void saveIndex(Index index) throws IOException {
    // must have permission to write from the write monitor
    if (index.hasChanged()) {
        if (JobManager.VERBOSE)
            //$NON-NLS-1$
            Util.verbose("-> saving index " + index.getIndexLocation());
        index.save();
    }
    synchronized (this) {
        IPath containerPath = new Path(index.containerPath);
        if (this.jobEnd > this.jobStart) {
            for (int i = this.jobEnd; i > this.jobStart; i--) {
                // skip the current job
                IJob job = this.awaitingJobs[i];
                if (job instanceof IndexRequest)
                    if (((IndexRequest) job).containerPath.equals(containerPath))
                        return;
            }
        }
        IndexLocation indexLocation = computeIndexLocation(containerPath);
        updateIndexState(indexLocation, SAVED_STATE);
    }
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IPath(org.eclipse.core.runtime.IPath) IJob(org.eclipse.jdt.internal.core.search.processing.IJob) FileIndexLocation(org.eclipse.jdt.internal.core.index.FileIndexLocation) IndexLocation(org.eclipse.jdt.internal.core.index.IndexLocation)

Aggregations

IPath (org.eclipse.core.runtime.IPath)1 Path (org.eclipse.core.runtime.Path)1 FileIndexLocation (org.eclipse.jdt.internal.core.index.FileIndexLocation)1 IndexLocation (org.eclipse.jdt.internal.core.index.IndexLocation)1 IJob (org.eclipse.jdt.internal.core.search.processing.IJob)1