diff options
author | Sopot Cela | 2017-02-21 14:56:25 +0000 |
---|---|---|
committer | Sopot Cela | 2017-02-21 14:56:25 +0000 |
commit | 96c4b1f19fc1726876cd6bf6cf840f2f7ddd6af2 (patch) | |
tree | 5c7b962589d9c6495bd9527b21212a94991bd852 | |
parent | 95eff73c60193d29b321886b46e941d4180389b2 (diff) | |
download | eclipse.platform.ua-96c4b1f19fc1726876cd6bf6cf840f2f7ddd6af2.tar.gz eclipse.platform.ua-96c4b1f19fc1726876cd6bf6cf840f2f7ddd6af2.tar.xz eclipse.platform.ua-96c4b1f19fc1726876cd6bf6cf840f2f7ddd6af2.zip |
Bug 509819 - NPE in SearchIndex.removeDocumentY20170223-1000I20170226-2000I20170225-2000I20170224-2000I20170223-2000I20170222-2000I20170221-2000
Change-Id: I183b9197ee32c093deb7400aac640ccb2ac59ae3
Signed-off-by: Sopot Cela <scela@redhat.com>
-rw-r--r-- | org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java index 3ab7e7a60..339d2f1f4 100644 --- a/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java +++ b/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java @@ -329,13 +329,13 @@ public class SearchIndex implements IHelpSearchIndex { */ public synchronized boolean beginDeleteBatch() { try { - if (ir != null) { - ir.close(); + if (iw != null) { + iw.close(); } indexedDocs = new HelpProperties(INDEXED_DOCS_FILE, indexDir); indexedDocs.restore(); setInconsistent(true); - ir = DirectoryReader.open(luceneDirectory); + iw = new IndexWriter(luceneDirectory, new IndexWriterConfig(analyzerDescriptor.getAnalyzer())); return true; } catch (IOException e) { HelpBasePlugin.logError("Exception occurred in search indexing at beginDeleteBatch.", e); //$NON-NLS-1$ @@ -422,10 +422,10 @@ public class SearchIndex implements IHelpSearchIndex { */ public synchronized boolean endDeleteBatch() { try { - if (ir == null) + if (iw == null) return false; - ir.close(); - ir = null; + iw.close(); + iw = null; // save the update info: // - all the docs // - plugins (and their version) that were indexed |