Revert "Bug 515504 - rebuildIndexshould erase the new index db if it is disabled" This reverts commit fb83e192eb209845dd3c5db3419f68ebf23f2cef.
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java index 44a20be..a175a36 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/indexer/Indexer.java
@@ -1046,24 +1046,18 @@ } public void rebuildIndex(IProgressMonitor monitor) throws CoreException { + if (!JavaIndex.isEnabled()) { + return; + } SubMonitor subMonitor = SubMonitor.convert(monitor, 100); - this.rescanJob.cancel(); - try { - this.rescanJob.join(0, subMonitor.split(1)); - } catch (InterruptedException e) { - // Nothing to do. - } this.nd.acquireWriteLock(subMonitor.split(1)); try { this.nd.clear(subMonitor.split(2)); } finally { this.nd.releaseWriteLock(); } - if (!JavaIndex.isEnabled()) { - return; - } - rescan(subMonitor.split(97)); + rescan(subMonitor.split(98)); } public void requestRebuildIndex() {