From 47dca3655d8d8228703066e63ee7e8c25b731a9a Mon Sep 17 00:00:00 2001 From: Sopot Cela Date: Mon, 21 Nov 2016 16:22:52 +0100 Subject: Bug 507597 - Incompatible index should not be reported as error Change-Id: I7a4c2d888052ab080ca8101da0ec678d379fded5 Signed-off-by: Sopot Cela --- .../src/org/eclipse/help/internal/search/PluginIndex.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/PluginIndex.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/PluginIndex.java index ddacba5a7..9e9134c96 100644 --- a/org.eclipse.help.base/src/org/eclipse/help/internal/search/PluginIndex.java +++ b/org.eclipse.help.base/src/org/eclipse/help/internal/search/PluginIndex.java @@ -21,8 +21,10 @@ import java.util.Properties; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; import org.eclipse.help.internal.base.HelpBasePlugin; import org.eclipse.help.internal.base.util.ProxyUtil; import org.eclipse.help.internal.util.ResourceLocator; @@ -148,10 +150,11 @@ public class PluginIndex { .getProperty(SearchIndex.DEPENDENCIES_KEY_LUCENE); String analyzer = prop .getProperty(SearchIndex.DEPENDENCIES_KEY_ANALYZER); - if (!targetIndex.isLuceneCompatible(lucene) - || !targetIndex.isAnalyzerCompatible(analyzer)) { - HelpBasePlugin.logError("Error trying to consume Lucene index from bundle " + bundle.toString() //$NON-NLS-1$ - + ". Please use an index built with Lucene 6.1 or higher.", null); //$NON-NLS-1$ + if (!targetIndex.isLuceneCompatible(lucene) || !targetIndex.isAnalyzerCompatible(analyzer)) { + String message = "Unable to consume Lucene index from bundle '" + bundle.toString() //$NON-NLS-1$ + + "'. The index should be rebuilt with Lucene 6.1."; //$NON-NLS-1$ + Status warningStatus = new Status(IStatus.WARNING, HelpBasePlugin.PLUGIN_ID, IStatus.OK, message, null); + HelpBasePlugin.logStatus(warningStatus); return false; } } catch (MalformedURLException mue) { -- cgit v1.2.1