From 744e11cdac32c9c8b9face6e35a877529e2bc202 Mon Sep 17 00:00:00 2001 From: Ed Merks Date: Sun, 15 Dec 2024 13:30:47 +0100 Subject: [PATCH 1/2] Relax dependencies on lucene to include 10.x - Update PrebuiltIndexCompatibility.checkReadable so that it compiles for both 9.x and 10.x and passes the tests in both case. - This prepares for updating the target platform to use lucene 10.x, which requires Java 21. https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/2654 --- ua/org.eclipse.help.base/META-INF/MANIFEST.MF | 6 +++--- .../help/search/PrebuiltIndexCompatibility.java | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ua/org.eclipse.help.base/META-INF/MANIFEST.MF b/ua/org.eclipse.help.base/META-INF/MANIFEST.MF index 5cd5d34c77f..25da284e04a 100644 --- a/ua/org.eclipse.help.base/META-INF/MANIFEST.MF +++ b/ua/org.eclipse.help.base/META-INF/MANIFEST.MF @@ -43,9 +43,9 @@ Require-Bundle: org.eclipse.ant.core;bundle-version="[3.2.200,4.0.0)";resolution org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)", org.eclipse.help;bundle-version="[3.5.0,4.0.0)";visibility:=reexport, org.eclipse.core.net;bundle-version="[1.2.200,2.0.0)", - org.apache.lucene.analysis-common;bundle-version="[9.5.0,10.0.0)", - org.apache.lucene.core;bundle-version="[9.5.0,10.0.0)", - org.apache.lucene.analysis-smartcn;bundle-version="[9.5.0,10.0.0)" + org.apache.lucene.analysis-common;bundle-version="[9.5.0,11.0.0)", + org.apache.lucene.core;bundle-version="[9.5.0,11.0.0)", + org.apache.lucene.analysis-smartcn;bundle-version="[9.5.0,11.0.0)" Import-Package: org.eclipse.equinox.http.jetty;resolution:=optional Bundle-RequiredExecutionEnvironment: JavaSE-17 Bundle-ActivationPolicy: lazy diff --git a/ua/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java b/ua/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java index 32e350c1717..928e5631a17 100644 --- a/ua/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java +++ b/ua/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java @@ -28,6 +28,7 @@ import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexFormatTooOldException; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.TopDocs; @@ -121,10 +122,22 @@ private void checkReadable(String indexPath) throws IOException, IndexSearcher searcher; try (Directory luceneDirectory = new NIOFSDirectory(new File(filePath).toPath())) { try (DirectoryReader luceneDirectoryReader = DirectoryReader.open(luceneDirectory)) { + // This code never reached because the index is not + // readable. searcher = new IndexSearcher(luceneDirectoryReader); TopDocs hits = searcher.search(luceneQuery, 500); - assertTrue(hits.totalHits.value >= 1); + assertTrue(hits.totalHits != null); } + } catch (IndexFormatTooOldException ex) { + // Lucene 10.x throws this more explicit exception whereas 9.x + // throws IllegalArgumentException. + // Note that in + // org.eclipse.help.internal.search.SearchIndex.SearchIndex(File, + // String, AnalyzerDescriptor, TocManager, String) + // it catches all these: + // catch (IndexFormatTooOldException | IndexNotFoundException | + // IllegalArgumentException e) + throw new IllegalArgumentException(ex); } } else { fail("Cannot resolve to file protocol"); From 51740a2c2edcad62d76df0f97e434296555c9a38 Mon Sep 17 00:00:00 2001 From: Eclipse Platform Bot Date: Sun, 15 Dec 2024 12:36:20 +0000 Subject: [PATCH 2/2] Version bump(s) for 4.35 stream --- ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF | 2 +- ua/org.eclipse.ua.tests/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF b/ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF index 956a89dc9d5..b746f850df0 100644 --- a/ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF +++ b/ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: User Assistance Test Bundle-SymbolicName: org.eclipse.ua.tests;singleton:=true -Bundle-Version: 3.6.400.qualifier +Bundle-Version: 3.6.500.qualifier Require-Bundle: org.eclipse.help.ui, org.eclipse.help.webapp, org.eclipse.test.performance, diff --git a/ua/org.eclipse.ua.tests/pom.xml b/ua/org.eclipse.ua.tests/pom.xml index a9e468d9222..180a79b62a7 100644 --- a/ua/org.eclipse.ua.tests/pom.xml +++ b/ua/org.eclipse.ua.tests/pom.xml @@ -19,7 +19,7 @@ org.eclipse.ua org.eclipse.ua.tests - 3.6.400-SNAPSHOT + 3.6.500-SNAPSHOT eclipse-test-plugin