public JrtIndexer(File jrt, SearchParticipant participant, Index index, IPath container, IndexManager indexManager) { this.jrt = jrt; this.participant = (participant != null) ? participant : SearchEngine.getDefaultSearchParticipant(); this.index = index; IndexLocation indexLocation = index.getIndexLocation(); this.indexPath = indexLocation != null ? new Path(indexLocation.getCanonicalFilePath()) : null; this.container = container; this.indexManager = indexManager; }
public JrtIndexer(File jrt, SearchParticipant participant, Index index, IPath container, IndexManager indexManager) { this.jrt = jrt; this.participant = (participant != null) ? participant : SearchEngine.getDefaultSearchParticipant(); this.index = index; IndexLocation indexLocation = index.getIndexLocation(); this.indexPath = indexLocation != null ? new Path(indexLocation.getCanonicalFilePath()) : null; this.container = container; this.indexManager = indexManager; }
/** * {@link #saveIndex(Index)} will only update the state if there are no other jobs running against the same * underlying resource for this index. Pre-built indexes must be in a {@link #REUSE_STATE} state even if * there is another job to run against it as the subsequent job will find the index and not save it in the * right state. * Refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=405932 */ public void savePreBuiltIndex(Index index) throws IOException { if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving pre-build index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { updateIndexState(index.getIndexLocation(), REUSE_STATE); } } public void saveIndex(Index index) throws IOException {
/** * {@link #saveIndex(Index)} will only update the state if there are no other jobs running against the same * underlying resource for this index. Pre-built indexes must be in a {@link #REUSE_STATE} state even if * there is another job to run against it as the subsequent job will find the index and not save it in the * right state. * Refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=405932 */ public void savePreBuiltIndex(Index index) throws IOException { if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving pre-build index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { updateIndexState(index.getIndexLocation(), REUSE_STATE); } } public void saveIndex(Index index) throws IOException {
/** * {@link #saveIndex(Index)} will only update the state if there are no other jobs running against the same * underlying resource for this index. Pre-built indexes must be in a {@link #REUSE_STATE} state even if * there is another job to run against it as the subsequent job will find the index and not save it in the * right state. * Refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=405932 */ public void savePreBuiltIndex(Index index) throws IOException { if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving pre-build index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { updateIndexState(index.getIndexLocation(), REUSE_STATE); } } public void saveIndex(Index index) throws IOException {
/** * {@link #saveIndex(Index)} will only update the state if there are no other jobs running against the same * underlying resource for this index. Pre-built indexes must be in a {@link #REUSE_STATE} state even if * there is another job to run against it as the subsequent job will find the index and not save it in the * right state. * Refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=405932 */ public void savePreBuiltIndex(Index index) throws IOException { if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving pre-build index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { updateIndexState(index.getIndexLocation(), REUSE_STATE); } } public void saveIndex(Index index) throws IOException {
/** * {@link #saveIndex(Index)} will only update the state if there are no other jobs running against the same * underlying resource for this index. Pre-built indexes must be in a {@link #REUSE_STATE} state even if * there is another job to run against it as the subsequent job will find the index and not save it in the * right state. * Refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=405932 */ public void savePreBuiltIndex(Index index) throws IOException { if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving pre-build index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { updateIndexState(index.getIndexLocation(), REUSE_STATE); } } public void saveIndex(Index index) throws IOException {
public void saveIndex(Index index) throws IOException { // must have permission to write from the write monitor if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving index " + index.getIndexLocation()); //$NON-NLS-1$ 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); } } /**
public void saveIndex(Index index) throws IOException { // must have permission to write from the write monitor if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving index " + index.getIndexLocation()); //$NON-NLS-1$ 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); } } /**
public void saveIndex(Index index) throws IOException { // must have permission to write from the write monitor if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving index " + index.getIndexLocation()); //$NON-NLS-1$ 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); } } /**
public void saveIndex(Index index) throws IOException { // must have permission to write from the write monitor if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving index " + index.getIndexLocation()); //$NON-NLS-1$ 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); } } /**
public void saveIndex(Index index) throws IOException { // must have permission to write from the write monitor if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving index " + index.getIndexLocation()); //$NON-NLS-1$ 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); } } /**
IPath indexPath = null; IndexLocation indexLocation; if ((indexLocation = index.getIndexLocation()) != null) { indexPath = new Path(indexLocation.getCanonicalFilePath());
IPath indexPath = null; IndexLocation indexLocation; if ((indexLocation = index.getIndexLocation()) != null) { indexPath = new Path(indexLocation.getCanonicalFilePath());
IPath indexPath = null; IndexLocation indexLocation; if ((indexLocation = index.getIndexLocation()) != null) { indexPath = new Path(indexLocation.getCanonicalFilePath());
public void cleanUpIndexes() { SimpleSet knownPaths = new SimpleSet(); IJavaSearchScope scope = BasicSearchEngine.createWorkspaceScope(); PatternSearchJob job = new PatternSearchJob(null, SearchEngine.getDefaultSearchParticipant(), scope, null); Index[] selectedIndexes = job.getIndexes(null); for (int i = 0, l = selectedIndexes.length; i < l; i++) { IndexLocation IndexLocation = selectedIndexes[i].getIndexLocation(); knownPaths.add(IndexLocation); } if (this.indexStates != null) { Object[] keys = this.indexStates.keyTable; IndexLocation[] locations = new IndexLocation[this.indexStates.elementSize]; int count = 0; for (int i = 0, l = keys.length; i < l; i++) { IndexLocation key = (IndexLocation) keys[i]; if (key != null && !knownPaths.includes(key)) locations[count++] = key; } if (count > 0) removeIndexesState(locations); } deleteIndexFiles(knownPaths, null); } /**
public void cleanUpIndexes() { SimpleSet knownPaths = new SimpleSet(); IJavaSearchScope scope = BasicSearchEngine.createWorkspaceScope(); PatternSearchJob job = new PatternSearchJob(null, SearchEngine.getDefaultSearchParticipant(), scope, null); Index[] selectedIndexes = job.getIndexes(null); for (int i = 0, l = selectedIndexes.length; i < l; i++) { IndexLocation IndexLocation = selectedIndexes[i].getIndexLocation(); knownPaths.add(IndexLocation); } if (this.indexStates != null) { Object[] keys = this.indexStates.keyTable; IndexLocation[] locations = new IndexLocation[this.indexStates.elementSize]; int count = 0; for (int i = 0, l = keys.length; i < l; i++) { IndexLocation key = (IndexLocation) keys[i]; if (key != null && !knownPaths.includes(key)) locations[count++] = key; } if (count > 0) removeIndexesState(locations); } deleteIndexFiles(knownPaths, null); } /**
public void cleanUpIndexes() { SimpleSet knownPaths = new SimpleSet(); IJavaSearchScope scope = BasicSearchEngine.createWorkspaceScope(); PatternSearchJob job = new PatternSearchJob(null, SearchEngine.getDefaultSearchParticipant(), scope, null); Index[] selectedIndexes = job.getIndexes(null); for (int i = 0, l = selectedIndexes.length; i < l; i++) { IndexLocation IndexLocation = selectedIndexes[i].getIndexLocation(); knownPaths.add(IndexLocation); } if (this.indexStates != null) { Object[] keys = this.indexStates.keyTable; IndexLocation[] locations = new IndexLocation[this.indexStates.elementSize]; int count = 0; for (int i = 0, l = keys.length; i < l; i++) { IndexLocation key = (IndexLocation) keys[i]; if (key != null && !knownPaths.includes(key)) locations[count++] = key; } if (count > 0) removeIndexesState(locations); } deleteIndexFiles(knownPaths); } /**
public void cleanUpIndexes() { SimpleSet knownPaths = new SimpleSet(); IJavaSearchScope scope = BasicSearchEngine.createWorkspaceScope(); PatternSearchJob job = new PatternSearchJob(null, SearchEngine.getDefaultSearchParticipant(), scope, null); Index[] selectedIndexes = job.getIndexes(null); for (int i = 0, l = selectedIndexes.length; i < l; i++) { IndexLocation IndexLocation = selectedIndexes[i].getIndexLocation(); knownPaths.add(IndexLocation); } if (this.indexStates != null) { Object[] keys = this.indexStates.keyTable; IndexLocation[] locations = new IndexLocation[this.indexStates.elementSize]; int count = 0; for (int i = 0, l = keys.length; i < l; i++) { IndexLocation key = (IndexLocation) keys[i]; if (key != null && !knownPaths.includes(key)) locations[count++] = key; } if (count > 0) removeIndexesState(locations); } deleteIndexFiles(knownPaths); } /**
public void cleanUpIndexes() { SimpleSet knownPaths = new SimpleSet(); IJavaSearchScope scope = BasicSearchEngine.createWorkspaceScope(); PatternSearchJob job = new PatternSearchJob(null, SearchEngine.getDefaultSearchParticipant(), scope, null); Index[] selectedIndexes = job.getIndexes(null); for (int i = 0, l = selectedIndexes.length; i < l; i++) { IndexLocation IndexLocation = selectedIndexes[i].getIndexLocation(); knownPaths.add(IndexLocation); } if (this.indexStates != null) { Object[] keys = this.indexStates.keyTable; IndexLocation[] locations = new IndexLocation[this.indexStates.elementSize]; int count = 0; for (int i = 0, l = keys.length; i < l; i++) { IndexLocation key = (IndexLocation) keys[i]; if (key != null && !knownPaths.includes(key)) locations[count++] = key; } if (count > 0) removeIndexesState(locations); } deleteIndexFiles(knownPaths); } /**