Community
Participate
Working Groups
A problem I've run into, I think I'm forced to use internal API in order to get our JSP index entries in the IndexManager.indexLocations table. - Java index entries are automatically added to this table when you "computeIndexLocation", - but since we have to compute our own index locations, our locations don't get added to this table. I think being in this table is required because PatternSearchJob uses it to know which indexes to search (it does a check what the parent container path is for the index, which will be null if not in indexLocations table): public Index[] getIndexes(IProgressMonitor progressMonitor) { // acquire the in-memory indexes on the fly IPath[] indexLocations = this.participant.selectIndexes(this.pattern, this.scope); int length = indexLocations.length; Index[] indexes = new Index[length]; int count = 0; IndexManager indexManager = JavaModelManager.getJavaModelManager().getIndexManager(); for (int i = 0; i < length; i++) { if (progressMonitor != null && progressMonitor.isCanceled()) throw new OperationCanceledException(); // may trigger some index recreation work String indexLocation = indexLocations[i].toOSString(); IPath containerPath = (IPath) indexManager.indexLocations.keyForValue(indexLocation); // will be null here because not in indexLocations table of IndexManager if (containerPath != null) { // sanity check Index index = indexManager.getIndex(containerPath, indexLocation, true /*reuse index file*/, false /*do not create if none*/); if (index != null) indexes[count++] = index; // only consider indexes which are ready } } if (count == length) this.areIndexesReady = true; else System.arraycopy(indexes, 0, indexes=new Index[count], 0, count); return indexes; } I can get around this problem by adding to indexLocations in the IndexManager when we compute our own index location, but I'm not sure if there are any bad side effects of this.
Is this still an issue ?
Please reopen if this is still an issue