Skip to content

Apache Lucene open-source search software

Upgrade several build dependencies. (#11812)

Dawid Weiss5d121ce44c28
diff --git a/build.gradle b/build.gradle
index fedea545eea..03f4a372ffc 100644
--- a/build.gradle
+++ b/build.gradle
@@ -20,12 +20,12 @@ import java.time.format.DateTimeFormatter
plugins {
id "base"
- id "com.palantir.consistent-versions" version "2.10.0"
- id "org.owasp.dependencycheck" version "5.3.0"
+ id "com.palantir.consistent-versions" version "2.11.0"
+ id "org.owasp.dependencycheck" version "7.2.0"
id 'de.thetaphi.forbiddenapis' version '3.3' apply false
- id "de.undercouch.download" version "4.1.1" apply false
+ id "de.undercouch.download" version "5.2.0" apply false
id "net.ltgt.errorprone" version "2.0.2" apply false
- id 'com.diffplug.spotless' version "6.5.0" apply false
+ id 'com.diffplug.spotless' version "6.5.2" apply false
}
apply from: file('gradle/globals.gradle')
@@ -97,7 +97,7 @@ configurations {
dependencies {
// Use a newer groovy that doesn't have illegal reflective accesses.
- groovy "org.codehaus.groovy:groovy-all:3.0.9"
+ groovy "org.codehaus.groovy:groovy-all:3.0.12"
}
apply from: file('buildSrc/scriptDepVersions.gradle')
diff --git a/buildSrc/scriptDepVersions.gradle b/buildSrc/scriptDepVersions.gradle
index a860e6ca4b2..6f25cdbf4fd 100644
--- a/buildSrc/scriptDepVersions.gradle
+++ b/buildSrc/scriptDepVersions.gradle
@@ -21,12 +21,12 @@
ext {
scriptDepVersions = [
- "apache-rat": "0.13",
+ "apache-rat": "0.14",
"commons-codec": "1.13",
- "ecj": "3.28.0",
+ "ecj": "3.30.0",
"flexmark": "0.61.24",
- "javacc": "7.0.4",
+ "javacc": "7.0.12",
"jflex": "1.8.2",
- "jgit": "5.9.0.202009080501-r",
+ "jgit": "5.13.1.202206130422-r",
]
}
diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradle
index 67c0ea20ca0..97c735c6745 100644
--- a/gradle/validation/error-prone.gradle
+++ b/gradle/validation/error-prone.gradle
@@ -66,6 +66,7 @@ allprojects { prj ->
// test
'-Xep:AlmostJavadoc:OFF',
+ '-Xep:AlreadyChecked:OFF',
'-Xep:AmbiguousMethodReference:OFF',
'-Xep:ArgumentSelectionDefectChecker:OFF',
'-Xep:ArrayAsKeyOfSetOrMap:OFF',
@@ -78,6 +79,7 @@ allprojects { prj ->
'-Xep:BadShiftAmount:OFF',
'-Xep:BoxedPrimitiveConstructor:OFF', // we have forbiddenapis for that
'-Xep:ByteBufferBackingArray:OFF',
+ '-Xep:CanIgnoreReturnValueSuggester:OFF',
'-Xep:CatchAndPrintStackTrace:OFF',
'-Xep:CatchFail:OFF',
'-Xep:CharacterGetNumericValue:OFF',
@@ -88,14 +90,17 @@ allprojects { prj ->
'-Xep:ComplexBooleanConstant:OFF',
'-Xep:DefaultPackage:OFF',
'-Xep:DoNotCallSuggester:OFF',
+ '-Xep:DoNotCall:OFF',
'-Xep:DoubleBraceInitialization:OFF',
'-Xep:DoubleCheckedLocking:OFF',
'-Xep:EmptyCatch:OFF',
+ '-Xep:EmptyTopLevelDeclaration:OFF',
'-Xep:EqualsGetClass:OFF',
'-Xep:EqualsIncompatibleType:OFF',
'-Xep:EqualsUnsafeCast:OFF',
'-Xep:EscapedEntity:OFF',
'-Xep:ExtendingJUnitAssert:OFF',
+ '-Xep:ExtendsObject:OFF',
'-Xep:FallThrough:OFF',
'-Xep:Finally:OFF',
'-Xep:FloatingPointLiteralPrecision:OFF',
@@ -121,6 +126,7 @@ allprojects { prj ->
'-Xep:JdkObsolete:OFF',
'-Xep:LockNotBeforeTry:OFF',
'-Xep:LogicalAssignment:OFF',
+ '-Xep:LongDoubleConversion:OFF',
'-Xep:MathAbsoluteRandom:OFF',
'-Xep:MissingFail:OFF',
'-Xep:MissingOverride:OFF',
@@ -128,22 +134,22 @@ allprojects { prj ->
'-Xep:MisusedDayOfYear:OFF',
'-Xep:MixedMutabilityReturnType:OFF',
'-Xep:ModifiedButNotUsed:OFF',
- '-Xep:MutableConstantField:OFF',
'-Xep:MutablePublicArray:OFF',
'-Xep:NarrowingCompoundAssignment:OFF',
+ '-Xep:NarrowCalculation:OFF',
'-Xep:NonAtomicVolatileUpdate:OFF',
'-Xep:NonCanonicalType:OFF',
'-Xep:ObjectToString:OFF',
'-Xep:ObjectsHashCodePrimitive:OFF',
'-Xep:OperatorPrecedence:OFF',
'-Xep:ProtectedMembersInFinalClass:OFF',
- '-Xep:PublicConstructorForAbstractClass:OFF',
'-Xep:ReferenceEquality:OFF',
'-Xep:ReturnValueIgnored:OFF',
'-Xep:SameNameButDifferent:OFF',
'-Xep:SelfAssignment:OFF',
'-Xep:ShortCircuitBoolean:OFF',
'-Xep:StaticAssignmentInConstructor:OFF',
+ '-Xep:StaticAssignmentOfThrowable:OFF',
'-Xep:StaticGuardedByInstance:OFF',
'-Xep:StreamResourceLeak:OFF',
'-Xep:StringSplitter:OFF',
@@ -157,6 +163,9 @@ allprojects { prj ->
'-Xep:TypeParameterShadowing:OFF',
'-Xep:TypeParameterUnusedInFormals:OFF',
'-Xep:UndefinedEquals:OFF',
+ '-Xep:UnnecessaryLongToIntConversion:OFF',
+ '-Xep:UnusedTypeParameter:OFF',
+ '-Xep:UnicodeInCode:OFF',
'-Xep:UnescapedEntity:OFF',
'-Xep:UnicodeEscape:OFF',
'-Xep:UnnecessaryLambda:OFF',
diff --git a/lucene/core/src/java/org/apache/lucene/document/FieldType.java b/lucene/core/src/java/org/apache/lucene/document/FieldType.java
index e90c22d1c60..29084c99b51 100644
--- a/lucene/core/src/java/org/apache/lucene/document/FieldType.java
+++ b/lucene/core/src/java/org/apache/lucene/document/FieldType.java
@@ -347,10 +347,8 @@ public class FieldType implements IndexableFieldType {
"when dimensionCount is > 0, indexDimensionCount must be > 0; got "
+ indexDimensionCount);
} else if (dimensionNumBytes == 0) {
- if (dimensionCount != 0) {
- throw new IllegalArgumentException(
- "when dimensionNumBytes is 0, dimensionCount must be 0; got " + dimensionCount);
- }
+ throw new IllegalArgumentException(
+ "when dimensionNumBytes is 0, dimensionCount must be 0; got " + dimensionCount);
}
this.dimensionCount = dimensionCount;
diff --git a/lucene/core/src/java/org/apache/lucene/geo/Polygon.java b/lucene/core/src/java/org/apache/lucene/geo/Polygon.java
index 8b45b21f213..2891d6992fa 100644
--- a/lucene/core/src/java/org/apache/lucene/geo/Polygon.java
+++ b/lucene/core/src/java/org/apache/lucene/geo/Polygon.java
@@ -70,9 +70,6 @@ public final class Polygon extends LatLonGeometry {
if (polyLats.length != polyLons.length) {
throw new IllegalArgumentException("polyLats and polyLons must be equal length");
}
- if (polyLats.length != polyLons.length) {
- throw new IllegalArgumentException("polyLats and polyLons must be equal length");
- }
if (polyLats.length < 4) {
throw new IllegalArgumentException("at least 4 polygon points required");
}
diff --git a/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataInput.java b/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataInput.java
index 35a26430f64..99e679d8ec2 100644
--- a/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataInput.java
+++ b/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataInput.java
@@ -86,7 +86,7 @@ public final class ByteBuffersDataInput extends DataInput
public long ramBytesUsed() {
// Return a rough estimation for allocated blocks. Note that we do not make
// any special distinction for what the type of buffer is (direct vs. heap-based).
- return RamUsageEstimator.NUM_BYTES_OBJECT_REF * blocks.length
+ return (long) RamUsageEstimator.NUM_BYTES_OBJECT_REF * blocks.length
+ Arrays.stream(blocks).mapToLong(buf -> buf.capacity()).sum();
}
diff --git a/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataOutput.java b/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataOutput.java
index 5c12536f254..756a531212d 100644
--- a/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataOutput.java
+++ b/lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataOutput.java
@@ -459,7 +459,7 @@ public final class ByteBuffersDataOutput extends DataOutput implements Accountab
// any special distinction for direct memory buffers.
assert ramBytesUsed
== blocks.stream().mapToLong(ByteBuffer::capacity).sum()
- + blocks.size() * RamUsageEstimator.NUM_BYTES_OBJECT_REF;
+ + (long) blocks.size() * RamUsageEstimator.NUM_BYTES_OBJECT_REF;
return ramBytesUsed;
}
diff --git a/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java b/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java
index 8a1127e6c5b..1d363170a94 100644
--- a/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java
+++ b/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java
@@ -199,7 +199,7 @@ public final class RamUsageEstimator {
/** Approximate memory usage that we assign to a LinkedHashMap entry. */
public static final long LINKED_HASHTABLE_RAM_BYTES_PER_ENTRY =
- HASHTABLE_RAM_BYTES_PER_ENTRY + 2 * NUM_BYTES_OBJECT_REF; // previous & next references
+ HASHTABLE_RAM_BYTES_PER_ENTRY + 2L * NUM_BYTES_OBJECT_REF; // previous & next references
/** Aligns an object size to be the next multiple of {@link #NUM_BYTES_OBJECT_ALIGNMENT}. */
public static long alignObjectSize(long size) {
diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java b/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java
index e85fe120b16..268e2ca0a70 100644
--- a/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java
+++ b/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java
@@ -941,7 +941,7 @@ public class Automaton implements Accountable, TransitionAccessor {
+ RamUsageEstimator.NUM_BYTES_OBJECT_HEADER
+ (isAccept.size() / 8)
+ RamUsageEstimator.NUM_BYTES_OBJECT_REF
- + 2 * RamUsageEstimator.NUM_BYTES_OBJECT_REF
+ + 2L * RamUsageEstimator.NUM_BYTES_OBJECT_REF
+ 3 * Integer.BYTES
+ 1;
}
diff --git a/versions.props b/versions.props
index 8ea29242f18..9218ea5fd8a 100644
--- a/versions.props
+++ b/versions.props
@@ -1,7 +1,7 @@
com.carrotsearch.randomizedtesting:*=2.8.1
com.carrotsearch:hppc=0.9.1
com.carrotsearch:procfork=1.0.6
-com.google.errorprone:*=2.10.0
+com.google.errorprone:*=2.15.0
com.ibm.icu:icu4j=70.1
commons-codec:commons-codec=1.13
io.sgr:s2-geometry-library-java=1.0.0