diff --git a/build.gradle b/build.gradle index 64460e61b92..79a90cb5038 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ plugins { id "org.owasp.dependencycheck" version "5.3.0" id 'de.thetaphi.forbiddenapis' version '3.2' apply false id "de.undercouch.download" version "4.1.1" apply false - id "net.ltgt.errorprone" version "1.2.1" apply false + id "net.ltgt.errorprone" version "2.0.2" apply false id 'com.diffplug.spotless' version "5.14.3" apply false } diff --git a/gradle/testing/alternative-jdk-support.gradle b/gradle/testing/alternative-jdk-support.gradle index d4ab22a9708..e66258cddd1 100644 --- a/gradle/testing/alternative-jdk-support.gradle +++ b/gradle/testing/alternative-jdk-support.gradle @@ -88,3 +88,5 @@ if (jvmGradle != jvmCurrent) { rootProject.ext.runtimeJavaExecutable = jvmCurrent.javaExecutable rootProject.ext.runtimeJavaHome = jvmCurrent.javaHome rootProject.ext.runtimeJavaVersion = jvmDetector.getMetadata(jvmCurrent.javaHome).languageVersion +rootProject.ext.usesAltJvm = (jvmGradle != jvmCurrent); + diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradle index b09211799dd..205f608771c 100644 --- a/gradle/validation/error-prone.gradle +++ b/gradle/validation/error-prone.gradle @@ -17,12 +17,12 @@ def skipReason -if (rootProject.runtimeJavaVersion > JavaVersion.VERSION_15) { - skipReason = "won't work with JDK ${rootProject.runtimeJavaVersion}" +if (rootProject.usesAltJvm && rootProject.runtimeJavaVersion > JavaVersion.VERSION_15) { + skipReason = "won't work with JDK ${rootProject.runtimeJavaVersion} if used as alternative java toolchain" } if (!Boolean.parseBoolean(propertyOrDefault("tests.nightly", "false"))) { - skipReason = "skipped on non-nightly runs" + skipReason = "skipped on non-nightly runs, pass -Dtests.nightly=true to run" } if (skipReason) { @@ -37,8 +37,10 @@ if (skipReason) { allprojects { prj -> plugins.withType(JavaPlugin) { - // LUCENE-9650: Errorprone on master/gradle does not work with JDK-16+ - // this is a hack to keep the dependency (so that palantir's version check doesn't complain) + // LUCENE-9650: Errorprone on master/gradle does not work with JDK-16+ when running as plugin + // inside a forked Javac process. Javac running inside Gradle works, because we have + // additional module system opens in place. + // This is a hack to keep the dependency (so that palantir's version check doesn't complain) // but don't include the plugin (which fails on JDK16+). if (skipReason) { tasks.withType(JavaCompile) { task -> task.dependsOn ":errorProneSkipped" } @@ -58,123 +60,110 @@ allprojects { prj -> tasks.withType(JavaCompile) { task -> options.errorprone.disableWarningsInGeneratedCode = true options.errorprone.errorproneArgs = [ - // test - '-Xep:ExtendingJUnitAssert:OFF', - '-Xep:UseCorrectAssertInTests:OFF', - '-Xep:DefaultPackage:OFF', - '-Xep:FloatingPointLiteralPrecision:OFF', - '-Xep:CatchFail:OFF', - '-Xep:TryFailThrowable:OFF', - '-Xep:MathAbsoluteRandom:OFF', - '-Xep:AssertionFailureIgnored:OFF', - '-Xep:JUnit4TestNotRun:OFF', - '-Xep:FallThrough:OFF', - '-Xep:CatchAndPrintStackTrace:OFF', - '-Xep:ToStringReturnsNull:OFF', - '-Xep:ArrayAsKeyOfSetOrMap:OFF', - '-Xep:StaticAssignmentInConstructor:OFF', - '-Xep:SelfAssignment:OFF', - '-Xep:InvalidPatternSyntax:OFF', - '-Xep:MissingFail:OFF', - '-Xep:LossyPrimitiveCompare:OFF', - '-Xep:ComparableType:OFF', - '-Xep:InfiniteRecursion:OFF', - '-Xep:MisusedDayOfYear:OFF', - '-Xep:FloatingPointAssertionWithinEpsilon:OFF', + '-Xep:InlineMeSuggester:OFF', // We don't use this annotation - '-Xep:ThrowNull:OFF', - '-Xep:StaticGuardedByInstance:OFF', - '-Xep:ArrayHashCode:OFF', - '-Xep:ArrayEquals:OFF', - '-Xep:IdentityBinaryExpression:OFF', - '-Xep:ComplexBooleanConstant:OFF', - '-Xep:ComplexBooleanConstant:OFF', - '-Xep:StreamResourceLeak:OFF', - '-Xep:UnnecessaryLambda:OFF', - '-Xep:ObjectToString:OFF', - '-Xep:URLEqualsHashCode:OFF', - '-Xep:DoubleBraceInitialization:OFF', - '-Xep:ShortCircuitBoolean:OFF', - '-Xep:InputStreamSlowMultibyteRead:OFF', - '-Xep:NonCanonicalType:OFF', - '-Xep:CollectionIncompatibleType:OFF', - '-Xep:TypeParameterShadowing:OFF', - '-Xep:ThreadJoinLoop:OFF', - '-Xep:MutableConstantField:OFF', - '-Xep:ReturnValueIgnored:OFF', - '-Xep:CollectionIncompatibleType:OFF', - '-Xep:SameNameButDifferent:OFF', - '-Xep:InvalidParam:OFF', - '-Xep:CompareToZero:OFF', - '-Xep:DoubleCheckedLocking:OFF', - '-Xep:BadShiftAmount:OFF', - '-Xep:CollectionUndefinedEquality:OFF', - '-Xep:UnescapedEntity:OFF', - '-Xep:BoxedPrimitiveEquality:OFF', - '-Xep:LogicalAssignment:OFF', - '-Xep:DoubleCheckedLocking:OFF', - '-Xep:AmbiguousMethodReference:OFF', - '-Xep:FormatString:OFF', - '-Xep:InstanceOfAndCastMatchWrongType:OFF', - '-Xep:ModifyCollectionInEnhancedForLoop:OFF', - '-Xep:JavaLangClash:OFF', - '-Xep:TypeParameterUnusedInFormals:OFF', - '-Xep:UnusedNestedClass:OFF', - '-Xep:OverrideThrowableToString:OFF', - '-Xep:FutureReturnValueIgnored:OFF', - '-Xep:BadInstanceof:OFF', - '-Xep:UnusedNestedClass:OFF', - '-Xep:OverrideThrowableToString:OFF', - '-Xep:EqualsIncompatibleType:OFF', - '-Xep:ByteBufferBackingArray:OFF', - '-Xep:ByteBufferBackingArray:OFF', - '-Xep:UnusedMethod:OFF', - '-Xep:ObjectsHashCodePrimitive:OFF', - '-Xep:ObjectsHashCodePrimitive:OFF', - '-Xep:UnnecessaryAnonymousClass:OFF', - '-Xep:BoxedPrimitiveConstructor:OFF', - '-Xep:ArgumentSelectionDefectChecker:OFF', - '-Xep:StringSplitter:OFF', - '-Xep:MixedMutabilityReturnType:OFF', - '-Xep:EqualsUnsafeCast:OFF', - '-Xep:OperatorPrecedence:OFF', - '-Xep:HidingField:OFF', - '-Xep:ThreadPriorityCheck:OFF', - '-Xep:InlineFormatString:OFF', - '-Xep:EqualsUnsafeCast:OFF', - '-Xep:UnsynchronizedOverridesSynchronized:OFF', - '-Xep:OperatorPrecedence:OFF', - '-Xep:ArrayToString:OFF', - '-Xep:ClassCanBeStatic:OFF', - '-Xep:InvalidInlineTag:OFF', - '-Xep:EmptyCatch:OFF', - '-Xep:UnnecessaryParentheses:OFF', + // test '-Xep:AlmostJavadoc:OFF', - '-Xep:Finally:OFF', - '-Xep:ImmutableEnumChecker:OFF', - '-Xep:NonAtomicVolatileUpdate:OFF', - '-Xep:MutablePublicArray:OFF', - '-Xep:LockNotBeforeTry:OFF', - '-Xep:WaitNotInLoop:OFF', - '-Xep:UndefinedEquals:OFF', - '-Xep:JdkObsolete:OFF', - '-Xep:NarrowingCompoundAssignment:OFF', - '-Xep:InconsistentCapitalization:OFF', - '-Xep:IntLongMath:OFF', - '-Xep:SynchronizeOnNonFinalField:OFF', - '-Xep:ThreadLocalUsage:OFF', - '-Xep:ProtectedMembersInFinalClass:OFF', + '-Xep:AmbiguousMethodReference:OFF', + '-Xep:ArgumentSelectionDefectChecker:OFF', + '-Xep:ArrayAsKeyOfSetOrMap:OFF', + '-Xep:ArrayEquals:OFF', + '-Xep:ArrayHashCode:OFF', + '-Xep:ArrayToString:OFF', + '-Xep:AssertionFailureIgnored:OFF', '-Xep:BadImport:OFF', - '-Xep:InconsistentHashCode:OFF', - '-Xep:MissingOverride:OFF', + '-Xep:BadInstanceof:OFF', + '-Xep:BadShiftAmount:OFF', + '-Xep:BoxedPrimitiveConstructor:OFF', // we have forbiddenapis for that + '-Xep:ByteBufferBackingArray:OFF', + '-Xep:CatchAndPrintStackTrace:OFF', + '-Xep:CatchFail:OFF', + '-Xep:CharacterGetNumericValue:OFF', + '-Xep:ClassCanBeStatic:OFF', + '-Xep:CollectionIncompatibleType:OFF', + '-Xep:CollectionUndefinedEquality:OFF', + '-Xep:ComparableType:OFF', + '-Xep:ComplexBooleanConstant:OFF', + '-Xep:DefaultPackage:OFF', + '-Xep:DoNotCallSuggester:OFF', + '-Xep:DoubleBraceInitialization:OFF', + '-Xep:DoubleCheckedLocking:OFF', + '-Xep:EmptyCatch:OFF', '-Xep:EqualsGetClass:OFF', - '-Xep:PublicConstructorForAbstractClass:OFF', + '-Xep:EqualsIncompatibleType:OFF', + '-Xep:EqualsUnsafeCast:OFF', '-Xep:EscapedEntity:OFF', - '-Xep:ModifiedButNotUsed:OFF', - '-Xep:ReferenceEquality:OFF', + '-Xep:ExtendingJUnitAssert:OFF', + '-Xep:FallThrough:OFF', + '-Xep:Finally:OFF', + '-Xep:FloatingPointLiteralPrecision:OFF', + '-Xep:FormatString:OFF', + '-Xep:FutureReturnValueIgnored:OFF', + '-Xep:HidingField:OFF', + '-Xep:IdentityBinaryExpression:OFF', + '-Xep:IdentityHashMapUsage:OFF', + '-Xep:ImmutableEnumChecker:OFF', + '-Xep:InconsistentCapitalization:OFF', + '-Xep:InconsistentHashCode:OFF', + '-Xep:InfiniteRecursion:OFF', + '-Xep:InlineFormatString:OFF', + '-Xep:InputStreamSlowMultibyteRead:OFF', + '-Xep:IntLongMath:OFF', '-Xep:InvalidBlockTag:OFF', + '-Xep:InvalidInlineTag:OFF', + '-Xep:InvalidParam:OFF', + '-Xep:InvalidPatternSyntax:OFF', + '-Xep:JUnit4TestNotRun:OFF', + '-Xep:JavaLangClash:OFF', + '-Xep:JavaUtilDate:OFF', + '-Xep:JdkObsolete:OFF', + '-Xep:LockNotBeforeTry:OFF', + '-Xep:LogicalAssignment:OFF', + '-Xep:MathAbsoluteRandom:OFF', + '-Xep:MissingFail:OFF', + '-Xep:MissingOverride:OFF', '-Xep:MissingSummary:OFF', - '-Xep:UnusedVariable:OFF' + '-Xep:MisusedDayOfYear:OFF', + '-Xep:MixedMutabilityReturnType:OFF', + '-Xep:ModifiedButNotUsed:OFF', + '-Xep:MutableConstantField:OFF', + '-Xep:MutablePublicArray:OFF', + '-Xep:NarrowingCompoundAssignment: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:StaticGuardedByInstance:OFF', + '-Xep:StreamResourceLeak:OFF', + '-Xep:StringSplitter:OFF', + '-Xep:SynchronizeOnNonFinalField:OFF', + '-Xep:ThreadJoinLoop:OFF', + '-Xep:ThreadLocalUsage:OFF', + '-Xep:ThreadPriorityCheck:OFF', + '-Xep:ThrowNull:OFF', + '-Xep:ToStringReturnsNull:OFF', + '-Xep:TryFailThrowable:OFF', + '-Xep:TypeParameterShadowing:OFF', + '-Xep:TypeParameterUnusedInFormals:OFF', + '-Xep:UndefinedEquals:OFF', + '-Xep:UnescapedEntity:OFF', + '-Xep:UnicodeEscape:OFF', + '-Xep:UnnecessaryLambda:OFF', + '-Xep:UnnecessaryParentheses:OFF', + '-Xep:UnsynchronizedOverridesSynchronized:OFF', + '-Xep:UnusedMethod:OFF', + '-Xep:UnusedVariable:OFF', + '-Xep:UseCorrectAssertInTests:OFF', + '-Xep:WaitNotInLoop:OFF', ] } } diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java index cef5b6c6bdb..32889f37333 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java @@ -333,7 +333,7 @@ public class MinHashFilter extends TokenFilter { public boolean add(final E toAdd) { if (capacity <= size()) { final E lastElm = last(); - if (toAdd.compareTo(lastElm) > -1) { + if (toAdd.compareTo(lastElm) >= 0) { return false; } else { pollLast(); diff --git a/lucene/analysis/common/src/tools/java/org/apache/lucene/analysis/standard/GenerateJflexTLDMacros.java b/lucene/analysis/common/src/tools/java/org/apache/lucene/analysis/standard/GenerateJflexTLDMacros.java index 065ebaa403e..24646e31a41 100644 --- a/lucene/analysis/common/src/tools/java/org/apache/lucene/analysis/standard/GenerateJflexTLDMacros.java +++ b/lucene/analysis/common/src/tools/java/org/apache/lucene/analysis/standard/GenerateJflexTLDMacros.java @@ -171,6 +171,8 @@ public class GenerateJflexTLDMacros { * care about TLDs that are prefixes and are exactly one character shorter than another TLD. See * LUCENE-8278 and LUCENE-5391. */ + @SuppressWarnings( + "ModifyCollectionInEnhancedForLoop") // it looks like it works because it is a sorted map! private void partitionTLDprefixesBySuffixLength() { TLDsBySuffixLength.add(new TreeSet<>()); // initialize set for zero-suffix TLDs for (SortedMap.Entry entry : processedTLDsLongestFirst.entrySet()) { diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ContentItemsSource.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ContentItemsSource.java index b77b72d4e05..9dfefaf1f93 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ContentItemsSource.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ContentItemsSource.java @@ -186,7 +186,7 @@ public abstract class ContentItemsSource implements Closeable { sb.append("total bytes of ") .append(itemsName) .append(": ") - .append(Format.format(0, nub, col)) + .append(Format.format(0, (double) nub, col)) .append(newline); lastPrintedNumUniqueBytes = nub; } @@ -200,7 +200,7 @@ public abstract class ContentItemsSource implements Closeable { sb.append("total bytes added for ") .append(itemsName) .append(" since last inputs reset: ") - .append(Format.format(0, getBytesCount(), col)) + .append(Format.format(0, (double) getBytesCount(), col)) .append(newline); } if (print) { diff --git a/lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java b/lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java index f0e9e28a312..260ce2b14b7 100644 --- a/lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java +++ b/lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java @@ -197,10 +197,10 @@ public class FuzzyQuery extends MultiTermQuery { if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; FuzzyQuery other = (FuzzyQuery) obj; - return Objects.equals(maxEdits, other.maxEdits) - && Objects.equals(prefixLength, other.prefixLength) - && Objects.equals(maxExpansions, other.maxExpansions) - && Objects.equals(transpositions, other.transpositions) + return maxEdits == other.maxEdits + && prefixLength == other.prefixLength + && maxExpansions == other.maxExpansions + && transpositions == other.transpositions && Objects.equals(term, other.term); } diff --git a/lucene/core/src/java/org/apache/lucene/util/IOUtils.java b/lucene/core/src/java/org/apache/lucene/util/IOUtils.java index 5acbff1d49a..97d485d9f42 100644 --- a/lucene/core/src/java/org/apache/lucene/util/IOUtils.java +++ b/lucene/core/src/java/org/apache/lucene/util/IOUtils.java @@ -498,6 +498,7 @@ public final class IOUtils { * The first exception thrown by the consumer is re-thrown and subsequent exceptions are * suppressed. */ + @SuppressWarnings("StreamToIterable") public static void applyToAll(Collection collection, IOConsumer consumer) throws IOException { IOUtils.close( diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java b/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java index 648f13322c8..18953ad6b7f 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java @@ -529,7 +529,7 @@ public class TestLRUQueryCache extends LuceneTestCase { final long actualRamBytesUsed = RamUsageTester.ramUsed(queryCache, acc); final long expectedRamBytesUsed = queryCache.ramBytesUsed(); // error < 30% - assertEquals(actualRamBytesUsed, expectedRamBytesUsed, 30 * actualRamBytesUsed / 100); + assertEquals(actualRamBytesUsed, expectedRamBytesUsed, 30.d * actualRamBytesUsed / 100.d); reader.close(); w.close(); diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java b/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java index 03f3770ab35..d377018d489 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Objects; import java.util.Random; import java.util.concurrent.CountDownLatch; import org.apache.lucene.document.Document; @@ -148,7 +149,7 @@ public class TestLiveFieldValues extends LuceneTestCase { if (allIDs.size() > 0) { String randomID = allIDs.get(threadRandom.nextInt(allIDs.size())); Integer expected = values.get(randomID); - if (expected == missing) { + if (Objects.equals(expected, missing)) { expected = null; } assertEquals("id=" + randomID, expected, rt.get(randomID)); diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTermInSetQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestTermInSetQuery.java index 13a3faf31c9..9d54cd9ccd9 100644 --- a/lucene/core/src/test/org/apache/lucene/search/TestTermInSetQuery.java +++ b/lucene/core/src/test/org/apache/lucene/search/TestTermInSetQuery.java @@ -187,7 +187,7 @@ public class TestTermInSetQuery extends LuceneTestCase { final long actualRamBytesUsed = RamUsageTester.ramUsed(query); final long expectedRamBytesUsed = query.ramBytesUsed(); // error margin within 5% - assertEquals(expectedRamBytesUsed, actualRamBytesUsed, actualRamBytesUsed / 20); + assertEquals(expectedRamBytesUsed, actualRamBytesUsed, actualRamBytesUsed / 20.d); } private static class TermsCountingDirectoryReaderWrapper extends FilterDirectoryReader { diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java index 037df625a67..a40e476a3b6 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java @@ -120,7 +120,7 @@ public class TestBooleanSimilarity extends BaseSimilarityTestCase { 100, maxTermFrequency, uniqueTermCount); - assertEquals(sim2.computeNorm(state), sim1.computeNorm(state), 0f); + assertEquals(sim2.computeNorm(state), sim1.computeNorm(state)); } } diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java index 9a7db0f8348..2e41b758c3e 100644 --- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java +++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestClassicSimilarity.java @@ -190,7 +190,7 @@ public class TestClassicSimilarity extends BaseSimilarityTestCase { 100, maxTermFrequency, uniqueTermCount); - assertEquals(sim2.computeNorm(state), sim1.computeNorm(state), 0f); + assertEquals(sim2.computeNorm(state), sim1.computeNorm(state)); } } diff --git a/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java b/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java index b6e131a38d6..31525214dda 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestPriorityQueue.java @@ -26,6 +26,7 @@ import org.apache.lucene.tests.util.TestUtil; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; +@SuppressWarnings("BoxedPrimitiveEquality") public class TestPriorityQueue extends LuceneTestCase { private static class IntegerQueue extends PriorityQueue { diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java index aba4107ebab..093882a3001 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java @@ -1027,7 +1027,7 @@ public class TestAutomaton extends LuceneTestCase { System.out.println(" prefixes=" + prefixes); } - for (int prefix : prefixes) { + for (int prefix : prefixes.stream().mapToInt(Integer::intValue).toArray()) { // prefix is a leading ascii byte; we retain * in a Automaton a2 = new Automaton(); int init = a2.createState(); diff --git a/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java b/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java index eedf07caa46..4cb145b432b 100644 --- a/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java +++ b/lucene/core/src/test/org/apache/lucene/util/automaton/TestRegExp.java @@ -143,7 +143,7 @@ public class TestRegExp extends LuceneTestCase { break; case 6: // replace all chars with . - result.append(replacementPart.replaceAll(".", ".")); + result.append(".".repeat(replacementPart.length())); break; case 7: // OR with uppercase chars eg [aA] (many of these sorts of expression in the wild.. diff --git a/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java index d1902028688..bb857472ab8 100644 --- a/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java +++ b/lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java @@ -703,7 +703,7 @@ public class TestPackedInts extends LuceneTestCase { } // test ramBytesUsed - assertEquals(RamUsageTester.ramUsed(writer), writer.ramBytesUsed(), 8); + assertEquals(RamUsageTester.ramUsed(writer), writer.ramBytesUsed(), 8.d); // test copy PagedGrowableWriter copy = diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestParentChildrenBlockJoinQuery.java b/lucene/join/src/test/org/apache/lucene/search/join/TestParentChildrenBlockJoinQuery.java index fa0c2569d72..10cbe16a100 100644 --- a/lucene/join/src/test/org/apache/lucene/search/join/TestParentChildrenBlockJoinQuery.java +++ b/lucene/join/src/test/org/apache/lucene/search/join/TestParentChildrenBlockJoinQuery.java @@ -93,7 +93,7 @@ public class TestParentChildrenBlockJoinQuery extends LuceneTestCase { if (expectedChildDocs > 0) { for (int i = 0; i < topDocs.scoreDocs.length; i++) { ScoreDoc childScoreDoc = topDocs.scoreDocs[i]; - assertEquals(expectedChildDocs - i, childScoreDoc.score, 0); + assertEquals((float) expectedChildDocs - i, childScoreDoc.score, 0.f); } } } diff --git a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LogsPanelProvider.java b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LogsPanelProvider.java index 4ddd2b2db7d..400524d46cd 100644 --- a/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LogsPanelProvider.java +++ b/lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/LogsPanelProvider.java @@ -102,7 +102,7 @@ public final class LogsPanelProvider { String logContent = clonedCopy.stream() .filter(record -> record.getLevel().intValue() >= level.intValue()) - .map(formatter::apply) + .map(formatter) .collect(Collectors.joining("\n")); logTextArea.setText(logContent); diff --git a/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionRangeQuery.java b/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionRangeQuery.java index 05c9e839c07..2dc65d93af6 100644 --- a/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionRangeQuery.java +++ b/lucene/queries/src/java/org/apache/lucene/queries/function/FunctionRangeQuery.java @@ -116,8 +116,8 @@ public class FunctionRangeQuery extends Query { } private boolean equalsTo(FunctionRangeQuery other) { - return Objects.equals(includeLower, other.includeLower) - && Objects.equals(includeUpper, other.includeUpper) + return includeLower == other.includeLower + && includeUpper == other.includeUpper && Objects.equals(valueSource, other.valueSource) && Objects.equals(lowerVal, other.lowerVal) && Objects.equals(upperVal, other.upperVal); diff --git a/lucene/queries/src/java/org/apache/lucene/queries/intervals/RepeatingIntervalsSource.java b/lucene/queries/src/java/org/apache/lucene/queries/intervals/RepeatingIntervalsSource.java index a174890370a..d16b2e2c90a 100644 --- a/lucene/queries/src/java/org/apache/lucene/queries/intervals/RepeatingIntervalsSource.java +++ b/lucene/queries/src/java/org/apache/lucene/queries/intervals/RepeatingIntervalsSource.java @@ -109,7 +109,7 @@ class RepeatingIntervalsSource extends IntervalsSource { public boolean equals(Object other) { if (other instanceof RepeatingIntervalsSource == false) return false; RepeatingIntervalsSource o = (RepeatingIntervalsSource) other; - return Objects.equals(this.in, o.in) && Objects.equals(this.childCount, o.childCount); + return Objects.equals(this.in, o.in) && this.childCount == o.childCount; } @Override diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/codecs/idversion/TestIDVersionPostingsFormat.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/codecs/idversion/TestIDVersionPostingsFormat.java index 68c76b74684..99483493c18 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/codecs/idversion/TestIDVersionPostingsFormat.java +++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/codecs/idversion/TestIDVersionPostingsFormat.java @@ -23,6 +23,7 @@ import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; @@ -824,7 +825,7 @@ public class TestIDVersionPostingsFormat extends LuceneTestCase { } boolean doIndex; - if (currentVersion == missingValue) { + if (Objects.equals(currentVersion, missingValue)) { if (VERBOSE) { System.out.println( Thread.currentThread().getName() + ": id not in RT cache"); diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/NRTSuggester.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/NRTSuggester.java index f06f5f54859..b25da6d3f74 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/NRTSuggester.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/document/NRTSuggester.java @@ -217,7 +217,7 @@ public final class NRTSuggester implements Accountable { collector.seenSurfaceForms.add(key); } try { - float score = scorer.score(decode(path.output.output1), path.boost); + float score = scorer.score((float) decode(path.output.output1), path.boost); collector.collect(docID, spare.toCharsRef(), path.context, score); return true; } catch (IOException e) { @@ -275,8 +275,8 @@ public final class NRTSuggester implements Accountable { Util.FSTPath> first, Util.FSTPath> second) { int cmp = Float.compare( - scorer.score(decode(second.output.output1), second.boost), - scorer.score(decode(first.output.output1), first.boost)); + scorer.score((float) decode(second.output.output1), second.boost), + scorer.score((float) decode(first.output.output1), first.boost)); return (cmp != 0) ? cmp : first.input.get().compareTo(second.input.get()); } } diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestAnalyzingSuggester.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestAnalyzingSuggester.java index 7435c996407..433fa3717d2 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestAnalyzingSuggester.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestAnalyzingSuggester.java @@ -82,32 +82,32 @@ public class TestAnalyzingSuggester extends LuceneTestCase { suggester.lookup(TestUtil.stringToCharSequence("f", random()), false, 2); assertEquals(1, results.size()); assertEquals("foo", results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); // top N of 1 for 'bar': we return this even though // barbar is higher because exactFirst is enabled: results = suggester.lookup(TestUtil.stringToCharSequence("bar", random()), false, 1); assertEquals(1, results.size()); assertEquals("bar", results.get(0).key.toString()); - assertEquals(10, results.get(0).value, 0.01F); + assertEquals(10, results.get(0).value); // top N Of 2 for 'b' results = suggester.lookup(TestUtil.stringToCharSequence("b", random()), false, 2); assertEquals(2, results.size()); assertEquals("barbar", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); assertEquals("bar", results.get(1).key.toString()); - assertEquals(10, results.get(1).value, 0.01F); + assertEquals(10, results.get(1).value); // top N of 3 for 'ba' results = suggester.lookup(TestUtil.stringToCharSequence("ba", random()), false, 3); assertEquals(3, results.size()); assertEquals("barbar", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); assertEquals("bar", results.get(1).key.toString()); - assertEquals(10, results.get(1).value, 0.01F); + assertEquals(10, results.get(1).value); assertEquals("barbara", results.get(2).key.toString()); - assertEquals(6, results.get(2).value, 0.01F); + assertEquals(6, results.get(2).value); IOUtils.close(analyzer, tempDir); } @@ -132,7 +132,7 @@ public class TestAnalyzingSuggester extends LuceneTestCase { suggester.lookup(TestUtil.stringToCharSequence("f", random()), false, 2); assertEquals(1, results.size()); assertEquals("foo", results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); assertEquals(new BytesRef("hello"), results.get(0).payload); // top N of 1 for 'bar': we return this even though @@ -140,30 +140,30 @@ public class TestAnalyzingSuggester extends LuceneTestCase { results = suggester.lookup(TestUtil.stringToCharSequence("bar", random()), false, 1); assertEquals(1, results.size()); assertEquals("bar", results.get(0).key.toString()); - assertEquals(10, results.get(0).value, 0.01F); + assertEquals(10, results.get(0).value); assertEquals(new BytesRef("goodbye"), results.get(0).payload); // top N Of 2 for 'b' results = suggester.lookup(TestUtil.stringToCharSequence("b", random()), false, 2); assertEquals(2, results.size()); assertEquals("barbar", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); assertEquals(new BytesRef("thank you"), results.get(0).payload); assertEquals("bar", results.get(1).key.toString()); - assertEquals(10, results.get(1).value, 0.01F); + assertEquals(10, results.get(1).value); assertEquals(new BytesRef("goodbye"), results.get(1).payload); // top N of 3 for 'ba' results = suggester.lookup(TestUtil.stringToCharSequence("ba", random()), false, 3); assertEquals(3, results.size()); assertEquals("barbar", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); assertEquals(new BytesRef("thank you"), results.get(0).payload); assertEquals("bar", results.get(1).key.toString()); - assertEquals(10, results.get(1).value, 0.01F); + assertEquals(10, results.get(1).value); assertEquals(new BytesRef("goodbye"), results.get(1).payload); assertEquals("barbara", results.get(2).key.toString()); - assertEquals(6, results.get(2).value, 0.01F); + assertEquals(6, results.get(2).value); assertEquals(new BytesRef("for all the fish"), results.get(2).payload); } IOUtils.close(analyzer, tempDir); @@ -259,26 +259,26 @@ public class TestAnalyzingSuggester extends LuceneTestCase { results = suggester.lookup(TestUtil.stringToCharSequence(input, random()), false, 1); assertEquals(1, results.size()); assertEquals(input, results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); // prefix of input stopping part way through christmas results = suggester.lookup(TestUtil.stringToCharSequence("the ghost of chris", random()), false, 1); assertEquals(1, results.size()); assertEquals(input, results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); // omit the 'the' since it's a stopword, it's suggested anyway results = suggester.lookup(TestUtil.stringToCharSequence("ghost of chris", random()), false, 1); assertEquals(1, results.size()); assertEquals(input, results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); // omit the 'the' and 'of' since they are stopwords, it's suggested anyway results = suggester.lookup(TestUtil.stringToCharSequence("ghost chris", random()), false, 1); assertEquals(1, results.size()); assertEquals(input, results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); // trailing stopword "the" results = @@ -286,7 +286,7 @@ public class TestAnalyzingSuggester extends LuceneTestCase { TestUtil.stringToCharSequence("ghost christmas past the", random()), false, 1); assertEquals(1, results.size()); assertEquals(input, results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); IOUtils.close(standard, tempDir); } @@ -911,7 +911,7 @@ public class TestAnalyzingSuggester extends LuceneTestCase { new Comparator() { @Override public int compare(TermFreq2 left, TermFreq2 right) { - int cmp = Float.compare(right.weight, left.weight); + int cmp = Long.compare(right.weight, left.weight); if (cmp == 0) { return left.analyzedForm.compareTo(right.analyzedForm); } else { @@ -942,7 +942,7 @@ public class TestAnalyzingSuggester extends LuceneTestCase { for (int hit = 0; hit < r.size(); hit++) { // System.out.println(" check hit " + hit); assertEquals(matches.get(hit).surfaceForm.toString(), r.get(hit).key.toString()); - assertEquals(matches.get(hit).weight, r.get(hit).value, 0f); + assertEquals(matches.get(hit).weight, r.get(hit).value); if (doPayloads) { assertEquals(matches.get(hit).payload, r.get(hit).payload); } diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFuzzySuggester.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFuzzySuggester.java index 5dc13ad1a99..606134e287d 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFuzzySuggester.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/analyzing/TestFuzzySuggester.java @@ -84,7 +84,7 @@ public class TestFuzzySuggester extends LuceneTestCase { suggester.lookup(TestUtil.stringToCharSequence(addRandomEdit, random()), false, 2); assertEquals(addRandomEdit, 1, results.size()); assertEquals("foo bar boo far", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); } IOUtils.close(analyzer, tempDir); } @@ -121,7 +121,7 @@ public class TestFuzzySuggester extends LuceneTestCase { suggester.lookup(TestUtil.stringToCharSequence(addRandomEdit, random()), false, 2); assertEquals(addRandomEdit, 1, results.size()); assertEquals("фуу бар буу фар", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); } IOUtils.close(analyzer, tempDir); } @@ -145,62 +145,62 @@ public class TestFuzzySuggester extends LuceneTestCase { suggester.lookup(TestUtil.stringToCharSequence("bariar", random()), false, 2); assertEquals(2, results.size()); assertEquals("barbar", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); results = suggester.lookup(TestUtil.stringToCharSequence("barbr", random()), false, 2); assertEquals(2, results.size()); assertEquals("barbar", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); results = suggester.lookup(TestUtil.stringToCharSequence("barbara", random()), false, 2); assertEquals(2, results.size()); assertEquals("barbara", results.get(0).key.toString()); - assertEquals(6, results.get(0).value, 0.01F); + assertEquals(6, results.get(0).value); results = suggester.lookup(TestUtil.stringToCharSequence("barbar", random()), false, 2); assertEquals(2, results.size()); assertEquals("barbar", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); assertEquals("barbara", results.get(1).key.toString()); - assertEquals(6, results.get(1).value, 0.01F); + assertEquals(6, results.get(1).value); results = suggester.lookup(TestUtil.stringToCharSequence("barbaa", random()), false, 2); assertEquals(2, results.size()); assertEquals("barbar", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); assertEquals("barbara", results.get(1).key.toString()); - assertEquals(6, results.get(1).value, 0.01F); + assertEquals(6, results.get(1).value); // top N of 2, but only foo is available results = suggester.lookup(TestUtil.stringToCharSequence("f", random()), false, 2); assertEquals(1, results.size()); assertEquals("foo", results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); // top N of 1 for 'bar': we return this even though // barbar is higher because exactFirst is enabled: results = suggester.lookup(TestUtil.stringToCharSequence("bar", random()), false, 1); assertEquals(1, results.size()); assertEquals("bar", results.get(0).key.toString()); - assertEquals(10, results.get(0).value, 0.01F); + assertEquals(10, results.get(0).value); // top N Of 2 for 'b' results = suggester.lookup(TestUtil.stringToCharSequence("b", random()), false, 2); assertEquals(2, results.size()); assertEquals("barbar", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); assertEquals("bar", results.get(1).key.toString()); - assertEquals(10, results.get(1).value, 0.01F); + assertEquals(10, results.get(1).value); // top N of 3 for 'ba' results = suggester.lookup(TestUtil.stringToCharSequence("ba", random()), false, 3); assertEquals(3, results.size()); assertEquals("barbar", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); assertEquals("bar", results.get(1).key.toString()); - assertEquals(10, results.get(1).value, 0.01F); + assertEquals(10, results.get(1).value); assertEquals("barbara", results.get(2).key.toString()); - assertEquals(6, results.get(2).value, 0.01F); + assertEquals(6, results.get(2).value); IOUtils.close(analyzer, tempDir); } @@ -236,19 +236,19 @@ public class TestFuzzySuggester extends LuceneTestCase { suggester.lookup(TestUtil.stringToCharSequence("the ghost of chris", random()), false, 1); assertEquals(1, results.size()); assertEquals("the ghost of christmas past", results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); // omit the 'the' since it's a stopword, it's suggested anyway results = suggester.lookup(TestUtil.stringToCharSequence("ghost of chris", random()), false, 1); assertEquals(1, results.size()); assertEquals("the ghost of christmas past", results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); // omit the 'the' and 'of' since they are stopwords, it's suggested anyway results = suggester.lookup(TestUtil.stringToCharSequence("ghost chris", random()), false, 1); assertEquals(1, results.size()); assertEquals("the ghost of christmas past", results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); IOUtils.close(standard, tempDir); } @@ -845,7 +845,7 @@ public class TestFuzzySuggester extends LuceneTestCase { new Comparator() { @Override public int compare(LookupResult left, LookupResult right) { - int cmp = Float.compare(right.value, left.value); + int cmp = Long.compare(right.value, left.value); if (cmp == 0) { return left.compareTo(right); } else { @@ -876,7 +876,7 @@ public class TestFuzzySuggester extends LuceneTestCase { // System.out.println(" check hit " + hit); assertEquals( prefix + " " + topN, matches.get(hit).key.toString(), r.get(hit).key.toString()); - assertEquals(matches.get(hit).value, r.get(hit).value, 0f); + assertEquals(matches.get(hit).value, r.get(hit).value); } } IOUtils.close(a, tempDir); diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestWFSTCompletion.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestWFSTCompletion.java index cb31e2039af..460bef8bafd 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestWFSTCompletion.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/fst/TestWFSTCompletion.java @@ -46,37 +46,37 @@ public class TestWFSTCompletion extends LuceneTestCase { suggester.lookup(TestUtil.stringToCharSequence("f", random), false, 2); assertEquals(1, results.size()); assertEquals("foo", results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); // make sure we don't get a dup exact suggestion: results = suggester.lookup(TestUtil.stringToCharSequence("foo", random), false, 2); assertEquals(1, results.size()); assertEquals("foo", results.get(0).key.toString()); - assertEquals(50, results.get(0).value, 0.01F); + assertEquals(50, results.get(0).value); // top N of 1 for 'bar': we return this even though barbar is higher results = suggester.lookup(TestUtil.stringToCharSequence("bar", random), false, 1); assertEquals(1, results.size()); assertEquals("bar", results.get(0).key.toString()); - assertEquals(10, results.get(0).value, 0.01F); + assertEquals(10, results.get(0).value); // top N Of 2 for 'b' results = suggester.lookup(TestUtil.stringToCharSequence("b", random), false, 2); assertEquals(2, results.size()); assertEquals("barbar", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); assertEquals("bar", results.get(1).key.toString()); - assertEquals(10, results.get(1).value, 0.01F); + assertEquals(10, results.get(1).value); // top N of 3 for 'ba' results = suggester.lookup(TestUtil.stringToCharSequence("ba", random), false, 3); assertEquals(3, results.size()); assertEquals("barbar", results.get(0).key.toString()); - assertEquals(12, results.get(0).value, 0.01F); + assertEquals(12, results.get(0).value); assertEquals("bar", results.get(1).key.toString()); - assertEquals(10, results.get(1).value, 0.01F); + assertEquals(10, results.get(1).value); assertEquals("barbara", results.get(2).key.toString()); - assertEquals(6, results.get(2).value, 0.01F); + assertEquals(6, results.get(2).value); tempDir.close(); } @@ -189,7 +189,7 @@ public class TestWFSTCompletion extends LuceneTestCase { new Comparator() { @Override public int compare(LookupResult left, LookupResult right) { - int cmp = Float.compare(right.value, left.value); + int cmp = Long.compare(right.value, left.value); if (cmp == 0) { return left.compareTo(right); } else { @@ -206,7 +206,7 @@ public class TestWFSTCompletion extends LuceneTestCase { for (int hit = 0; hit < r.size(); hit++) { // System.out.println(" check hit " + hit); assertEquals(matches.get(hit).key.toString(), r.get(hit).key.toString()); - assertEquals(matches.get(hit).value, r.get(hit).value, 0f); + assertEquals(matches.get(hit).value, r.get(hit).value); } } tempDir.close(); diff --git a/versions.props b/versions.props index 995a7dc8ddb..176f122191d 100644 --- a/versions.props +++ b/versions.props @@ -1,6 +1,6 @@ com.carrotsearch.randomizedtesting:*=2.7.6 com.carrotsearch:hppc=0.9.0 -com.google.errorprone:*=2.4.0 +com.google.errorprone:*=2.10.0 com.ibm.icu:icu4j=70.1 commons-codec:commons-codec=1.13 io.sgr:s2-geometry-library-java=1.0.0