From dc5c60901bf7086c08f866e85fe4641796ea384b Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Wed, 25 Feb 2015 14:24:51 +0200 Subject: 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 --- .../eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'org.eclipse.ua.tests/help') 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 { -- cgit v1.2.3