From 95e3803773a76ec51ed2372a93ec7ab1c52ed1fe Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Wed, 30 Apr 2025 23:58:45 +0200 Subject: [PATCH 1/4] Initial update to google's 'official' version. Removed annotation processor configuration from versions.lock - it does not seem to be relevant to us. --- gradle/libs.versions.toml | 4 +- gradle/validation/dependencies.gradle | 1 - .../spatial-extras/src/java/module-info.java | 2 +- .../spatial/prefix/tree/S2PrefixTree.java | 9 +- .../spatial/prefix/tree/TestS2PrefixTree.java | 2 +- versions.lock | 228 +++--------------- 6 files changed, 38 insertions(+), 208 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5047f70b353b..904655377fe7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -55,7 +55,7 @@ randomizedtesting = "2.8.3" # license checks rat = "0.14" # spatial-extras/ support -s2-geometry = "1.0.0" +s2-geometry = "2.0.0" # spatial-extras/ support spatial4j = "0.8" # benchmark/ XML parsing @@ -94,7 +94,7 @@ opennlp-tools = { module = "org.apache.opennlp:opennlp-tools", version.ref = "op procfork = { module = "com.carrotsearch:procfork", version.ref = "procfork" } randomizedtesting-runner = { module = "com.carrotsearch.randomizedtesting:randomizedtesting-runner", version.ref = "randomizedtesting" } rat = { module = "org.apache.rat:apache-rat", version.ref = "rat" } -s2-geometry = { module = "io.sgr:s2-geometry-library-java", version.ref = "s2-geometry" } +s2-geometry = { module = "com.google.geometry:s2-geometry", version.ref = "s2-geometry" } spatial4j = { module = "org.locationtech.spatial4j:spatial4j", version.ref = "spatial4j" } xerces = { module = "xerces:xercesImpl", version.ref = "xerces" } zstd = { module = "com.github.luben:zstd-jni", version.ref = "zstd" } diff --git a/gradle/validation/dependencies.gradle b/gradle/validation/dependencies.gradle index aca1808ee74a..2abf5d465883 100644 --- a/gradle/validation/dependencies.gradle +++ b/gradle/validation/dependencies.gradle @@ -28,7 +28,6 @@ allprojects { def testConfigurations = project.configurations.matching { it.name in [ - "annotationProcessor", "testCompileClasspath", "testRuntimeClasspath" ] diff --git a/lucene/spatial-extras/src/java/module-info.java b/lucene/spatial-extras/src/java/module-info.java index 30fb97668efa..5b5ed62e011e 100644 --- a/lucene/spatial-extras/src/java/module-info.java +++ b/lucene/spatial-extras/src/java/module-info.java @@ -19,7 +19,7 @@ @SuppressWarnings({"requires-automatic"}) module org.apache.lucene.spatial_extras { requires spatial4j; - requires s2.geometry.library.java; + requires s2.geometry; requires org.apache.lucene.core; requires org.apache.lucene.spatial3d; diff --git a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/S2PrefixTree.java b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/S2PrefixTree.java index 4fc1ceaa3549..9260214e1a86 100644 --- a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/S2PrefixTree.java +++ b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/S2PrefixTree.java @@ -103,12 +103,17 @@ public static int getMaxLevels(int arity) { return S2CellId.MAX_LEVEL / arity + 1; } + /** + * The default projection. + */ + final static S2Projections PROJECTION = S2Projections.S2_QUADRATIC_PROJECTION; + @Override public int getLevelForDistance(double dist) { if (dist == 0) { return maxLevels; } - int level = S2Projections.MAX_WIDTH.getMinLevel(dist * DistanceUtils.DEGREES_TO_RADIANS); + int level = PROJECTION.maxWidth.getMinLevel(dist * DistanceUtils.DEGREES_TO_RADIANS); int roundLevel = level % arity != 0 ? 1 : 0; level = level / arity + roundLevel; return Math.min(maxLevels, level + 1); @@ -119,7 +124,7 @@ public double getDistanceForLevel(int level) { if (level == 0) { return 180; } - return S2Projections.MAX_WIDTH.getValue(arity * (level - 1)) * DistanceUtils.RADIANS_TO_DEGREES; + return PROJECTION.maxWidth.getValue(arity * (level - 1)) * DistanceUtils.RADIANS_TO_DEGREES; } @Override diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestS2PrefixTree.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestS2PrefixTree.java index 97d50884e331..06330e13059a 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestS2PrefixTree.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestS2PrefixTree.java @@ -113,7 +113,7 @@ public void testPrecision() { cell = (S2PrefixTreeCell) iterator.next(); } assertTrue(cell.getLevel() == level); - double precisionCell = S2Projections.MAX_WIDTH.getValue(cell.cellId.level()); + double precisionCell = S2PrefixTree.PROJECTION.maxWidth.getValue(cell.cellId.level()); assertTrue(precision > precisionCell); } } diff --git a/versions.lock b/versions.lock index 3483064f0cdf..aa1279ca26e7 100644 --- a/versions.lock +++ b/versions.lock @@ -3,10 +3,14 @@ "configurationGroups" : { "main_dependencies" : { "com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.3" : "fa9ef26b,refs=4", + "com.google.code.findbugs:jsr305:3.0.2" : "cbc357ab,refs=4", + "com.google.errorprone:error_prone_annotations:2.1.3" : "cbc357ab,refs=4", + "com.google.geometry:s2-geometry:2.0.0" : "cbc357ab,refs=4", + "com.google.guava:guava:25.1-jre" : "cbc357ab,refs=4", + "com.google.j2objc:j2objc-annotations:1.1" : "cbc357ab,refs=4", "com.ibm.icu:icu4j:77.1" : "47ea4550,refs=6", "commons-codec:commons-codec:1.18.0" : "e6288df0,refs=6", "commons-io:commons-io:2.16.1" : "5ce8cdc6,refs=2", - "io.sgr:s2-geometry-library-java:1.0.0" : "cbc357ab,refs=4", "junit:junit:4.13.2" : "fa9ef26b,refs=4", "net.sf.jopt-simple:jopt-simple:5.0.4" : "85a1e4c6,refs=2", "net.sourceforge.nekohtml:nekohtml:1.9.22" : "5ce8cdc6,refs=2", @@ -18,6 +22,8 @@ "org.carrot2:morfologik-fsa:2.1.9" : "79af844b,refs=4", "org.carrot2:morfologik-polish:2.1.9" : "fe494320,refs=3", "org.carrot2:morfologik-stemming:2.1.9" : "79af844b,refs=4", + "org.checkerframework:checker-qual:2.0.0" : "cbc357ab,refs=4", + "org.codehaus.mojo:animal-sniffer-annotations:1.14" : "cbc357ab,refs=4", "org.hamcrest:hamcrest:3.0" : "fa9ef26b,refs=4", "org.locationtech.spatial4j:spatial4j:0.8" : "cbc357ab,refs=4", "org.openjdk.jmh:jmh-core:1.37" : "85a1e4c6,refs=2", @@ -28,69 +34,39 @@ "test_dependencies" : { "com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.3" : "b35e5d7a,refs=74", "com.carrotsearch:procfork:1.0.6" : "b7ba1646,refs=2", - "com.github.ben-manes.caffeine:caffeine:3.0.5" : "6897bc09,refs=38", - "com.github.kevinstern:software-and-algorithms:1.0" : "6897bc09,refs=38", - "com.google.auto.service:auto-service-annotations:1.0.1" : "6897bc09,refs=38", - "com.google.auto.value:auto-value-annotations:1.9" : "6897bc09,refs=38", - "com.google.auto:auto-common:1.2.2" : "6897bc09,refs=38", - "com.google.errorprone:error_prone_annotation:2.38.0" : "6897bc09,refs=38", - "com.google.errorprone:error_prone_annotations:2.38.0" : "6897bc09,refs=38", - "com.google.errorprone:error_prone_check_api:2.38.0" : "6897bc09,refs=38", - "com.google.errorprone:error_prone_core:2.38.0" : "6897bc09,refs=38", - "com.google.googlejavaformat:google-java-format:1.24.0" : "6897bc09,refs=38", - "com.google.guava:failureaccess:1.0.3" : "6897bc09,refs=38", - "com.google.guava:guava:33.4.6-jre" : "6897bc09,refs=38", - "com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" : "6897bc09,refs=38", - "com.google.j2objc:j2objc-annotations:3.0.0" : "6897bc09,refs=38", - "com.google.protobuf:protobuf-java:3.25.5" : "6897bc09,refs=38", + "com.google.code.findbugs:jsr305:3.0.2" : "1d5a4b2b,refs=4", + "com.google.errorprone:error_prone_annotations:2.1.3" : "1d5a4b2b,refs=4", + "com.google.geometry:s2-geometry:2.0.0" : "1d5a4b2b,refs=4", + "com.google.guava:guava:25.1-jre" : "1d5a4b2b,refs=4", + "com.google.j2objc:j2objc-annotations:1.1" : "1d5a4b2b,refs=4", "com.ibm.icu:icu4j:77.1" : "ffa00415,refs=8", "commons-codec:commons-codec:1.18.0" : "9dde4cb5,refs=8", "commons-io:commons-io:2.16.1" : "6f16ff86,refs=2", - "io.github.eisop:dataflow-errorprone:3.41.0-eisop1" : "6897bc09,refs=38", - "io.github.java-diff-utils:java-diff-utils:4.12" : "6897bc09,refs=38", - "io.sgr:s2-geometry-library-java:1.0.0" : "1d5a4b2b,refs=4", - "javax.inject:javax.inject:1" : "6897bc09,refs=38", "junit:junit:4.13.2" : "b35e5d7a,refs=74", "net.bytebuddy:byte-buddy:1.15.11" : "b7ba1646,refs=2", - "net.sf.jopt-simple:jopt-simple:5.0.4" : "152d9f78,refs=3", + "net.sf.jopt-simple:jopt-simple:5.0.4" : "97d01686,refs=2", "net.sourceforge.nekohtml:nekohtml:1.9.22" : "6f16ff86,refs=2", "org.antlr:antlr4-runtime:4.13.2" : "6fbc4021,refs=5", "org.apache.commons:commons-compress:1.27.1" : "6f16ff86,refs=2", "org.apache.commons:commons-lang3:3.16.0" : "6f16ff86,refs=2", - "org.apache.commons:commons-math3:3.6.1" : "152d9f78,refs=3", + "org.apache.commons:commons-math3:3.6.1" : "97d01686,refs=2", "org.apache.opennlp:opennlp-tools:2.5.4" : "b91715f0,refs=6", "org.assertj:assertj-core:3.27.3" : "b7ba1646,refs=2", "org.carrot2:morfologik-fsa:2.1.9" : "e077a675,refs=8", "org.carrot2:morfologik-polish:2.1.9" : "cb00cecf,refs=5", "org.carrot2:morfologik-stemming:2.1.9" : "e077a675,refs=8", - "org.checkerframework:checker-qual:3.19.0" : "6897bc09,refs=38", + "org.checkerframework:checker-qual:2.0.0" : "1d5a4b2b,refs=4", + "org.codehaus.mojo:animal-sniffer-annotations:1.14" : "1d5a4b2b,refs=4", "org.hamcrest:hamcrest:3.0" : "b35e5d7a,refs=74", - "org.jspecify:jspecify:1.0.0" : "6897bc09,refs=38", "org.locationtech.jts:jts-core:1.20.0" : "180518e6,refs=2", "org.locationtech.spatial4j:spatial4j:0.8" : "1d5a4b2b,refs=4", - "org.openjdk.jmh:jmh-core:1.37" : "152d9f78,refs=3", - "org.openjdk.jmh:jmh-generator-annprocess:1.37" : "ecaf1d73,refs=1", - "org.pcollections:pcollections:4.0.1" : "6897bc09,refs=38", + "org.openjdk.jmh:jmh-core:1.37" : "97d01686,refs=2", "org.slf4j:slf4j-api:2.0.17" : "b91715f0,refs=6", "ua.net.nlp:morfologik-ukrainian-search:4.9.1" : "cb00cecf,refs=5", "xerces:xercesImpl:2.12.2" : "6f16ff86,refs=2" } }, "because" : { - "152d9f78" : [ - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:benchmark-jmh" - }, - { - "configuration" : "testCompileClasspath", - "projectPath" : ":lucene:benchmark-jmh" - }, - { - "configuration" : "testRuntimeClasspath", - "projectPath" : ":lucene:benchmark-jmh" - } - ], "180518e6" : [ { "configuration" : "testCompileClasspath", @@ -173,160 +149,6 @@ "projectPath" : ":lucene:benchmark" } ], - "6897bc09" : [ - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:analysis.tests" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:backward-codecs" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:benchmark" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:benchmark-jmh" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:classification" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:codecs" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:core" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:core.tests" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:demo" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:distribution.tests" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:expressions" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:facet" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:grouping" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:highlighter" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:join" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:luke" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:memory" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:misc" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:monitor" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:queries" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:queryparser" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:replicator" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:sandbox" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:spatial-extras" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:spatial-test-fixtures" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:spatial3d" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:suggest" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:test-framework" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:analysis:common" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:analysis:icu" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:analysis:kuromoji" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:analysis:morfologik" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:analysis:morfologik.tests" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:analysis:nori" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:analysis:opennlp" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:analysis:phonetic" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:analysis:smartcn" - }, - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:analysis:stempel" - } - ], "6f16ff86" : [ { "configuration" : "testCompileClasspath", @@ -387,6 +209,16 @@ "projectPath" : ":lucene:benchmark-jmh" } ], + "97d01686" : [ + { + "configuration" : "testCompileClasspath", + "projectPath" : ":lucene:benchmark-jmh" + }, + { + "configuration" : "testRuntimeClasspath", + "projectPath" : ":lucene:benchmark-jmh" + } + ], "9dde4cb5" : [ { "configuration" : "testCompileClasspath", @@ -873,12 +705,6 @@ "projectPath" : ":lucene:analysis:phonetic" } ], - "ecaf1d73" : [ - { - "configuration" : "annotationProcessor", - "projectPath" : ":lucene:benchmark-jmh" - } - ], "fa9ef26b" : [ { "configuration" : "compileClasspath", From 1533972f689908f0095f7cf1e4fcab98b55df528 Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Thu, 1 May 2025 09:43:03 +0200 Subject: [PATCH 2/4] Add the required dependencies, licenses and exclude ecj linter. --- lucene/licenses/failureaccess-1.0.3.jar.sha1 | 1 + lucene/licenses/failureaccess-LICENSE-ASL.txt | 202 ++++++++++++++++++ lucene/licenses/failureaccess-NOTICE.txt | 0 lucene/licenses/guava-33.4.8-jre.jar.sha1 | 1 + lucene/licenses/guava-LICENSE-ASL.txt | 202 ++++++++++++++++++ lucene/licenses/guava-NOTICE.txt | 0 lucene/licenses/s2-geometry-2.0.0.jar.sha1 | 1 + lucene/licenses/s2-geometry-LICENSE-ASL.txt | 202 ++++++++++++++++++ lucene/licenses/s2-geometry-NOTICE.txt | 0 .../s2-geometry-library-java-1.0.0.jar.sha1 | 1 - lucene/spatial-extras/build.gradle | 23 +- .../spatial-extras/src/java/module-info.java | 1 + .../spatial/prefix/tree/S2PrefixTree.java | 6 +- .../spatial/prefix/tree/TestS2PrefixTree.java | 1 - 14 files changed, 633 insertions(+), 8 deletions(-) create mode 100644 lucene/licenses/failureaccess-1.0.3.jar.sha1 create mode 100644 lucene/licenses/failureaccess-LICENSE-ASL.txt create mode 100644 lucene/licenses/failureaccess-NOTICE.txt create mode 100644 lucene/licenses/guava-33.4.8-jre.jar.sha1 create mode 100644 lucene/licenses/guava-LICENSE-ASL.txt create mode 100644 lucene/licenses/guava-NOTICE.txt create mode 100644 lucene/licenses/s2-geometry-2.0.0.jar.sha1 create mode 100644 lucene/licenses/s2-geometry-LICENSE-ASL.txt create mode 100644 lucene/licenses/s2-geometry-NOTICE.txt delete mode 100644 lucene/licenses/s2-geometry-library-java-1.0.0.jar.sha1 diff --git a/lucene/licenses/failureaccess-1.0.3.jar.sha1 b/lucene/licenses/failureaccess-1.0.3.jar.sha1 new file mode 100644 index 000000000000..4a3cd02659b6 --- /dev/null +++ b/lucene/licenses/failureaccess-1.0.3.jar.sha1 @@ -0,0 +1 @@ +aeaffd00d57023a2c947393ed251f0354f0985fc diff --git a/lucene/licenses/failureaccess-LICENSE-ASL.txt b/lucene/licenses/failureaccess-LICENSE-ASL.txt new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/lucene/licenses/failureaccess-LICENSE-ASL.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lucene/licenses/failureaccess-NOTICE.txt b/lucene/licenses/failureaccess-NOTICE.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/lucene/licenses/guava-33.4.8-jre.jar.sha1 b/lucene/licenses/guava-33.4.8-jre.jar.sha1 new file mode 100644 index 000000000000..db051a4dd0b1 --- /dev/null +++ b/lucene/licenses/guava-33.4.8-jre.jar.sha1 @@ -0,0 +1 @@ +e70a3268e6cd3e7d458aa15787ce6811c34e96ae diff --git a/lucene/licenses/guava-LICENSE-ASL.txt b/lucene/licenses/guava-LICENSE-ASL.txt new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/lucene/licenses/guava-LICENSE-ASL.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lucene/licenses/guava-NOTICE.txt b/lucene/licenses/guava-NOTICE.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/lucene/licenses/s2-geometry-2.0.0.jar.sha1 b/lucene/licenses/s2-geometry-2.0.0.jar.sha1 new file mode 100644 index 000000000000..f6ec0672ab8f --- /dev/null +++ b/lucene/licenses/s2-geometry-2.0.0.jar.sha1 @@ -0,0 +1 @@ +96385cfc9ee5269b1e20438c3ef9cc0809ab77cb diff --git a/lucene/licenses/s2-geometry-LICENSE-ASL.txt b/lucene/licenses/s2-geometry-LICENSE-ASL.txt new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/lucene/licenses/s2-geometry-LICENSE-ASL.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lucene/licenses/s2-geometry-NOTICE.txt b/lucene/licenses/s2-geometry-NOTICE.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/lucene/licenses/s2-geometry-library-java-1.0.0.jar.sha1 b/lucene/licenses/s2-geometry-library-java-1.0.0.jar.sha1 deleted file mode 100644 index ef4e3eebb783..000000000000 --- a/lucene/licenses/s2-geometry-library-java-1.0.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f95b25589b40b5b0965deb592445073ff3efa299 diff --git a/lucene/spatial-extras/build.gradle b/lucene/spatial-extras/build.gradle index c2ab9e631cba..a43f5150cd65 100644 --- a/lucene/spatial-extras/build.gradle +++ b/lucene/spatial-extras/build.gradle @@ -28,7 +28,20 @@ dependencies { moduleApi project(':lucene:spatial3d') moduleApi deps.spatial4j - moduleApi deps.s2.geometry + + moduleApi(deps.s2.geometry, { + exclude group: "com.google.guava" + }) + moduleApi("com.google.guava:guava:33.4.8-jre", { + exclude group: "com.google.code.findbugs", module: "jsr305" + exclude group: "com.google.errorprone", module: "error_prone_annotations" + exclude group: "com.google.j2objc", module: "j2objc-annotations" + exclude group: "org.checkerframework", module: "checker-qual" + exclude group: "org.codehaus.mojo", module: "animal-sniffer-annotations" + exclude group: "com.google.guava", module: "listenablefuture" + exclude group: "org.jspecify", module: "jspecify" + + }) moduleTestImplementation project(':lucene:test-framework') moduleTestImplementation project(':lucene:spatial-test-fixtures') @@ -43,4 +56,10 @@ dependencies { sourceSets.test.extensions.configure("modularPaths", { it.patchModule("spatial4j", project.providers.provider({ configurations.spatial4jTestPatch.singleFile })) -}) \ No newline at end of file +}) + +// disable ecj linting because of this bug: +// eclipse-jdt/eclipse.jdt.core#2778 (guava's module info cannot be found). +tasks.matching { it.name == "ecjLintMain" }.configureEach { + enabled = false +} \ No newline at end of file diff --git a/lucene/spatial-extras/src/java/module-info.java b/lucene/spatial-extras/src/java/module-info.java index 5b5ed62e011e..fd26499168cf 100644 --- a/lucene/spatial-extras/src/java/module-info.java +++ b/lucene/spatial-extras/src/java/module-info.java @@ -22,6 +22,7 @@ requires s2.geometry; requires org.apache.lucene.core; requires org.apache.lucene.spatial3d; + requires com.google.common; exports org.apache.lucene.spatial; exports org.apache.lucene.spatial.bbox; diff --git a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/S2PrefixTree.java b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/S2PrefixTree.java index 9260214e1a86..e83ab3c95c38 100644 --- a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/S2PrefixTree.java +++ b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/S2PrefixTree.java @@ -103,10 +103,8 @@ public static int getMaxLevels(int arity) { return S2CellId.MAX_LEVEL / arity + 1; } - /** - * The default projection. - */ - final static S2Projections PROJECTION = S2Projections.S2_QUADRATIC_PROJECTION; + /** The default projection. */ + static final S2Projections PROJECTION = S2Projections.S2_QUADRATIC_PROJECTION; @Override public int getLevelForDistance(double dist) { diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestS2PrefixTree.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestS2PrefixTree.java index 06330e13059a..c18f62da584a 100644 --- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestS2PrefixTree.java +++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/prefix/tree/TestS2PrefixTree.java @@ -19,7 +19,6 @@ import com.carrotsearch.randomizedtesting.annotations.Repeat; import com.google.common.geometry.S2CellId; -import com.google.common.geometry.S2Projections; import org.apache.lucene.spatial.spatial4j.Geo3dSpatialContextFactory; import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.util.BytesRef; From 5a04c6318bd33cc5501a01c3ec6ae3db24259e5c Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Thu, 1 May 2025 10:10:08 +0200 Subject: [PATCH 3/4] Move guava to libs.versions.toml. --- gradle/libs.versions.toml | 3 +++ lucene/spatial-extras/build.gradle | 2 +- versions.lock | 16 ++++------------ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 904655377fe7..0d34b66bbd7e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,6 +20,8 @@ flexmark = "0.64.8" googleJavaFormat = "1.23.0" # gradle build support groovy = "4.0.26" +# up-to-date version for a transitive dependency in spatial-extras (s2-geometry) +guava = "33.4.8-jre" # test assertions hamcrest = "3.0" # analysis/icu/, gradle regeneration unicode support @@ -77,6 +79,7 @@ flexmark-ext-attributes = { module = "com.vladsch.flexmark:flexmark-ext-attribut flexmark-ext-autolink = { module = "com.vladsch.flexmark:flexmark-ext-autolink", version.ref = "flexmark" } flexmark-ext-tables = { module = "com.vladsch.flexmark:flexmark-ext-tables", version.ref = "flexmark" } groovy = { module = "org.apache.groovy:groovy-all", version.ref = "groovy" } +guava = { module = "com.google.guava:guava", version.ref = "guava" } hamcrest = { module = "org.hamcrest:hamcrest", version.ref = "hamcrest" } icu4j = { module = "com.ibm.icu:icu4j", version.ref = "icu4j" } javacc = { module = "net.java.dev.javacc:javacc", version.ref = "javacc" } diff --git a/lucene/spatial-extras/build.gradle b/lucene/spatial-extras/build.gradle index a43f5150cd65..b8d92c7a2789 100644 --- a/lucene/spatial-extras/build.gradle +++ b/lucene/spatial-extras/build.gradle @@ -32,7 +32,7 @@ dependencies { moduleApi(deps.s2.geometry, { exclude group: "com.google.guava" }) - moduleApi("com.google.guava:guava:33.4.8-jre", { + moduleApi(deps.guava, { exclude group: "com.google.code.findbugs", module: "jsr305" exclude group: "com.google.errorprone", module: "error_prone_annotations" exclude group: "com.google.j2objc", module: "j2objc-annotations" diff --git a/versions.lock b/versions.lock index aa1279ca26e7..3979fbb8c0ce 100644 --- a/versions.lock +++ b/versions.lock @@ -3,11 +3,9 @@ "configurationGroups" : { "main_dependencies" : { "com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.3" : "fa9ef26b,refs=4", - "com.google.code.findbugs:jsr305:3.0.2" : "cbc357ab,refs=4", - "com.google.errorprone:error_prone_annotations:2.1.3" : "cbc357ab,refs=4", "com.google.geometry:s2-geometry:2.0.0" : "cbc357ab,refs=4", - "com.google.guava:guava:25.1-jre" : "cbc357ab,refs=4", - "com.google.j2objc:j2objc-annotations:1.1" : "cbc357ab,refs=4", + "com.google.guava:failureaccess:1.0.3" : "cbc357ab,refs=4", + "com.google.guava:guava:33.4.8-jre" : "cbc357ab,refs=4", "com.ibm.icu:icu4j:77.1" : "47ea4550,refs=6", "commons-codec:commons-codec:1.18.0" : "e6288df0,refs=6", "commons-io:commons-io:2.16.1" : "5ce8cdc6,refs=2", @@ -22,8 +20,6 @@ "org.carrot2:morfologik-fsa:2.1.9" : "79af844b,refs=4", "org.carrot2:morfologik-polish:2.1.9" : "fe494320,refs=3", "org.carrot2:morfologik-stemming:2.1.9" : "79af844b,refs=4", - "org.checkerframework:checker-qual:2.0.0" : "cbc357ab,refs=4", - "org.codehaus.mojo:animal-sniffer-annotations:1.14" : "cbc357ab,refs=4", "org.hamcrest:hamcrest:3.0" : "fa9ef26b,refs=4", "org.locationtech.spatial4j:spatial4j:0.8" : "cbc357ab,refs=4", "org.openjdk.jmh:jmh-core:1.37" : "85a1e4c6,refs=2", @@ -34,11 +30,9 @@ "test_dependencies" : { "com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.3" : "b35e5d7a,refs=74", "com.carrotsearch:procfork:1.0.6" : "b7ba1646,refs=2", - "com.google.code.findbugs:jsr305:3.0.2" : "1d5a4b2b,refs=4", - "com.google.errorprone:error_prone_annotations:2.1.3" : "1d5a4b2b,refs=4", "com.google.geometry:s2-geometry:2.0.0" : "1d5a4b2b,refs=4", - "com.google.guava:guava:25.1-jre" : "1d5a4b2b,refs=4", - "com.google.j2objc:j2objc-annotations:1.1" : "1d5a4b2b,refs=4", + "com.google.guava:failureaccess:1.0.3" : "1d5a4b2b,refs=4", + "com.google.guava:guava:33.4.8-jre" : "1d5a4b2b,refs=4", "com.ibm.icu:icu4j:77.1" : "ffa00415,refs=8", "commons-codec:commons-codec:1.18.0" : "9dde4cb5,refs=8", "commons-io:commons-io:2.16.1" : "6f16ff86,refs=2", @@ -55,8 +49,6 @@ "org.carrot2:morfologik-fsa:2.1.9" : "e077a675,refs=8", "org.carrot2:morfologik-polish:2.1.9" : "cb00cecf,refs=5", "org.carrot2:morfologik-stemming:2.1.9" : "e077a675,refs=8", - "org.checkerframework:checker-qual:2.0.0" : "1d5a4b2b,refs=4", - "org.codehaus.mojo:animal-sniffer-annotations:1.14" : "1d5a4b2b,refs=4", "org.hamcrest:hamcrest:3.0" : "b35e5d7a,refs=74", "org.locationtech.jts:jts-core:1.20.0" : "180518e6,refs=2", "org.locationtech.spatial4j:spatial4j:0.8" : "1d5a4b2b,refs=4", From fb5805fab0b57cc2d1425d737398c7946b896309 Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Thu, 1 May 2025 12:33:36 +0200 Subject: [PATCH 4/4] error_prone_annotations needs to be added as a dependency because guava is on module path and error prone (annotation processor) uses it. If it's excluded from module classpath, it cannot be found and fails the build. --- gradle/validation/jar-checks.gradle | 2 +- .../error_prone_annotations-2.36.0.jar.sha1 | 1 + .../error_prone_annotations-LICENSE-ASL.txt | 202 ++++++++++++++++++ .../error_prone_annotations-NOTICE.txt | 0 lucene/spatial-extras/build.gradle | 2 - versions.lock | 2 + 6 files changed, 206 insertions(+), 3 deletions(-) create mode 100644 lucene/licenses/error_prone_annotations-2.36.0.jar.sha1 create mode 100644 lucene/licenses/error_prone_annotations-LICENSE-ASL.txt create mode 100644 lucene/licenses/error_prone_annotations-NOTICE.txt diff --git a/gradle/validation/jar-checks.gradle b/gradle/validation/jar-checks.gradle index aacb18c3eff4..128fab00d50d 100644 --- a/gradle/validation/jar-checks.gradle +++ b/gradle/validation/jar-checks.gradle @@ -178,7 +178,7 @@ subprojects { } if (errors) { - def msg = "Dependency checksum validation failed:\n - " + errors.join("\n - ") + def msg = "Dependency checksum validation failed (run './gradlew updateLicenses' to update):\n - " + errors.join("\n - ") if (failOnError) { throw new GradleException(msg) } else { diff --git a/lucene/licenses/error_prone_annotations-2.36.0.jar.sha1 b/lucene/licenses/error_prone_annotations-2.36.0.jar.sha1 new file mode 100644 index 000000000000..57538779bcbc --- /dev/null +++ b/lucene/licenses/error_prone_annotations-2.36.0.jar.sha1 @@ -0,0 +1 @@ +227d4d4957ccc3dc5761bd897e3a0ee587e750a7 diff --git a/lucene/licenses/error_prone_annotations-LICENSE-ASL.txt b/lucene/licenses/error_prone_annotations-LICENSE-ASL.txt new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/lucene/licenses/error_prone_annotations-LICENSE-ASL.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lucene/licenses/error_prone_annotations-NOTICE.txt b/lucene/licenses/error_prone_annotations-NOTICE.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/lucene/spatial-extras/build.gradle b/lucene/spatial-extras/build.gradle index b8d92c7a2789..329c4d5a1b5f 100644 --- a/lucene/spatial-extras/build.gradle +++ b/lucene/spatial-extras/build.gradle @@ -34,13 +34,11 @@ dependencies { }) moduleApi(deps.guava, { exclude group: "com.google.code.findbugs", module: "jsr305" - exclude group: "com.google.errorprone", module: "error_prone_annotations" exclude group: "com.google.j2objc", module: "j2objc-annotations" exclude group: "org.checkerframework", module: "checker-qual" exclude group: "org.codehaus.mojo", module: "animal-sniffer-annotations" exclude group: "com.google.guava", module: "listenablefuture" exclude group: "org.jspecify", module: "jspecify" - }) moduleTestImplementation project(':lucene:test-framework') diff --git a/versions.lock b/versions.lock index 3979fbb8c0ce..9c95efdc6f82 100644 --- a/versions.lock +++ b/versions.lock @@ -3,6 +3,7 @@ "configurationGroups" : { "main_dependencies" : { "com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.3" : "fa9ef26b,refs=4", + "com.google.errorprone:error_prone_annotations:2.36.0" : "cbc357ab,refs=4", "com.google.geometry:s2-geometry:2.0.0" : "cbc357ab,refs=4", "com.google.guava:failureaccess:1.0.3" : "cbc357ab,refs=4", "com.google.guava:guava:33.4.8-jre" : "cbc357ab,refs=4", @@ -30,6 +31,7 @@ "test_dependencies" : { "com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.3" : "b35e5d7a,refs=74", "com.carrotsearch:procfork:1.0.6" : "b7ba1646,refs=2", + "com.google.errorprone:error_prone_annotations:2.36.0" : "1d5a4b2b,refs=4", "com.google.geometry:s2-geometry:2.0.0" : "1d5a4b2b,refs=4", "com.google.guava:failureaccess:1.0.3" : "1d5a4b2b,refs=4", "com.google.guava:guava:33.4.8-jre" : "1d5a4b2b,refs=4",