Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java')
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java
index 5b7c89d6..6e7b749d 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java
@@ -1,10 +1,10 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -86,12 +86,15 @@ public Index[] getIndexes(IProgressMonitor progressMonitor) {
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);
- 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
+ Index index = indexManager.getIndex(indexLocation);
+ if (index == null) {
+ // only need containerPath if the index must be built
+ IPath containerPath = (IPath) indexManager.indexLocations.keyForValue(indexLocation);
+ if (containerPath != null) // sanity check
+ 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;

Back to the top