Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2015-02-25 12:24:51 +0000
committerAlexander Kurtakov2015-02-26 15:42:10 +0000
commitdc5c60901bf7086c08f866e85fe4641796ea384b (patch)
tree78b851d11ed10dba5c8d073de47bc6e4be1b7e64 /org.eclipse.ua.tests/help
parenta6190d03254c4ae1df848d21302535d7448ac770 (diff)
downloadeclipse.platform.ua-dc5c60901bf7086c08f866e85fe4641796ea384b.tar.gz
eclipse.platform.ua-dc5c60901bf7086c08f866e85fe4641796ea384b.tar.xz
eclipse.platform.ua-dc5c60901bf7086c08f866e85fe4641796ea384b.zip
Bug 460787 - Do not use deprecated Lucene 3.5 methods/classes
Moves from deprecated methods/classes to newer ones by simply redoing what the deprecated methods were doing in Lucene 3.5 itself using the newer APIs. This is preliminalry work for updating to Lucene 4.x/5.x where these deprecated ones are actually removed. Change-Id: I96937e00a251630a6927130efb88cc1652080cb9 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.ua.tests/help')
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java
index 3f666f27e..640d4c9ad 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 IBM Corporation and others.
+ * Copyright (c) 2011, 2015 IBM Corporation and others.
* 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Alexander Kurtakov - Bug 460787
*******************************************************************************/
package org.eclipse.ua.tests.help.search;
@@ -23,6 +24,7 @@ import junit.framework.TestSuite;
import org.osgi.framework.Bundle;
import org.apache.lucene.index.CorruptIndexException;
+import org.apache.lucene.index.IndexReader;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TopDocs;
@@ -155,7 +157,7 @@ public class PrebuiltIndexCompatibility extends TestCase {
IndexSearcher searcher = null;
try {
luceneDirectory = new NIOFSDirectory(new File(filePath));
- searcher = new IndexSearcher(luceneDirectory, true);
+ searcher = new IndexSearcher(IndexReader.open(luceneDirectory, true));
TopDocs hits = searcher.search(luceneQuery, 500);
assertEquals(hits.totalHits, 1);
} finally {

Back to the top