Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gradle/java/javac.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ allprojects {
"-Xlint:synchronization",
"-Xlint:text-blocks",
"-proc:none", // proc:none was added because of LOG4J2-1925 / JDK-8186647
"-Xlint:removal"
"-Xlint:removal",
"--should-stop=ifError=FLOW" // error-prone 2.41
]

if (propertyOrDefault("javac.failOnWarnings", true).toBoolean()) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ google-cloud-bom = "0.224.0"
google-cloud-core = "2.23.0"
google-cloud-nio = "0.127.3"
google-cloud-storage = "2.27.0"
google-errorprone = "2.31.0"
google-errorprone = "2.41.0"
# @keep for version alignment
google-gson = "2.13.1"
google-guava = "33.1.0-jre"
Expand Down
42 changes: 34 additions & 8 deletions gradle/validation/error-prone.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ allprojects { prj ->
'-Xep:CheckNotNullMultipleTimes:ERROR',
// '-Xep:CheckReturnValue:OFF', // we don't use these annotations
'-Xep:CollectionToArraySafeParameter:ERROR',
// '-Xep:CollectionIncompatibleType:OFF', // todo check if useful or comment why not
// '-Xep:ComparableType:OFF', // SolrTestCaseJ4.Doc and Fld are messy
'-Xep:ComparingThisWithNull:ERROR',
'-Xep:ComparisonOutOfRange:ERROR',
Expand Down Expand Up @@ -126,6 +127,7 @@ allprojects { prj ->
'-Xep:EqualsReference:ERROR',
'-Xep:EqualsWrongThing:ERROR',
// '-Xep:FloggerFormatString:OFF', // we don't use flogger
// '-Xep:FloggerLogString:OFF', // we don't use flogger
// '-Xep:FloggerLogVarargs:OFF', // we don't use flogger
// '-Xep:FloggerSplitLogStatement:OFF', // we don't use flogger
// '-Xep:ForOverride:OFF', // we don't use this annotation
Expand All @@ -144,7 +146,6 @@ allprojects { prj ->
'-Xep:HashtableContains:ERROR',
'-Xep:IdentityBinaryExpression:ERROR',
'-Xep:IdentityHashMapBoxing:ERROR',
// '-Xep:IgnoredPureGetter:OFF', // we don't use these annotations
// '-Xep:Immutable:OFF', // we don't use this annotation
// '-Xep:ImpossibleNullComparison:OFF', // we don't use protobuf
'-Xep:Incomparable:ERROR',
Expand Down Expand Up @@ -182,6 +183,8 @@ allprojects { prj ->
'-Xep:LossyPrimitiveCompare:ERROR',
'-Xep:MathRoundIntLong:ERROR',
// '-Xep:MislabeledAndroidString:OFF', // we don't use android
'-Xep:MisleadingEmptyVarargs:ERROR',
'-Xep:MisleadingEscapedSpace:ERROR',
'-Xep:MisplacedScopeAnnotations:ERROR',
// '-Xep:MissingRuntimeRetention:ERROR', // todo check if useful or comment why not
// '-Xep:MissingSuperCall:OFF', // we don't use this annotation
Expand Down Expand Up @@ -215,7 +218,6 @@ allprojects { prj ->
'-Xep:PreconditionsInvalidPlaceholder:ERROR',
'-Xep:PrivateSecurityContractProtoAccess:ERROR',
'-Xep:ProtoBuilderReturnValueIgnored:ERROR',
'-Xep:ProtoFieldNullComparison:ERROR',
'-Xep:ProtoStringFieldReferenceEquality:ERROR',
'-Xep:ProtoTruthMixedDescriptors:ERROR',
'-Xep:ProtocolBufferOrdinal:ERROR',
Expand All @@ -225,7 +227,7 @@ allprojects { prj ->
// '-Xep:RectIntersectReturnValueIgnored:OFF', // we don't use android
// '-Xep:RedundantSetterCall:ERROR', // todo check if useful or comment why not
// '-Xep:RequiredModifiers:OFF', // we don't use this annotation
// '-Xep:RestrictedApiChecker:OFF', // we don't use this annotation
// '-Xep:RestrictedApi:OFF', // we don't use this annotation
// '-Xep:ReturnValueIgnored:OFF', // todo there are problems that should be fixed
// '-Xep:SelfAssertion:ERROR', // todo check if useful or comment why not
'-Xep:SelfAssignment:ERROR',
Expand All @@ -236,11 +238,13 @@ allprojects { prj ->
'-Xep:SizeGreaterThanOrEqualsZero:ERROR',
'-Xep:StreamToString:ERROR',
'-Xep:StringBuilderInitWithChar:ERROR',
// '-Xep:StringJoin:ERROR', // todo check if useful or comment why not
'-Xep:SubstringOfZero:ERROR',
'-Xep:SuppressWarningsDeprecated:ERROR',
'-Xep:TemporalAccessorGetChronoField:ERROR',
// '-Xep:TestParametersNotInitialized:OFF', // we don't use this annotation
// '-Xep:TheoryButNoTheories:OFF', // we don't use junit theory apis/runner
// '-Xep:ThreadBuilderNameWithPlaceholder:OFF', // todo check if useful or comment why not
// '-Xep:ThrowIfUncheckedKnownChecked:OFF', // we don't use this annotation
'-Xep:ThrowNull:ERROR',
'-Xep:TreeToString:ERROR',
Expand All @@ -261,15 +265,18 @@ allprojects { prj ->
// On by Default : WARNING

// '-Xep:ASTHelpersSuggestions:OFF', // we don't use ASTHelpers
// '-Xep:AddressSelection:OFF', // not relevant for Solr
'-Xep:AlmostJavadoc:WARN',
// '-Xep:AlreadyChecked:OFF', // todo check if useful or comment why not
// '-Xep:AmbiguousMethodReference:OFF', // todo check if useful or comment why not
// '-Xep:AnnotateFormatMethod:OFF', // we don't use this annotation
// '-Xep:ArgumentSelectionDefectChecker:OFF', // todo check if useful or comment why not
'-Xep:ArrayAsKeyOfSetOrMap:WARN',
// '-Xep:ArrayRecordComponent:WARN', // records not widely used in Solr yet
'-Xep:AssertEqualsArgumentOrderChecker:WARN',
'-Xep:AssertThrowsMultipleStatements:WARN',
'-Xep:AssertionFailureIgnored:WARN',
// '-Xep:AssignmentExpression:WARN', todo: Consider this but gives lots of errors
'-Xep:AssistedInjectAndInjectOnSameConstructor:WARN',
'-Xep:AttemptedNegativeZero:WARN',
// '-Xep:AutoValueBoxedValues:WARN', // todo check if useful or comment why not
Expand All @@ -282,6 +289,7 @@ allprojects { prj ->
'-Xep:BareDotMetacharacter:WARN',
'-Xep:BigDecimalEquals:WARN',
'-Xep:BigDecimalLiteralDouble:WARN',
// '-Xep:BooleanLiteral:WARN', // todo: Consider this - true vs Boolean.TRUE
'-Xep:BoxedPrimitiveConstructor:WARN',
// '-Xep:BugPatternNaming:OFF', // we don't use this annotation
'-Xep:ByteBufferBackingArray:WARN',
Expand Down Expand Up @@ -314,9 +322,10 @@ allprojects { prj ->
// '-Xep:DoNotCallSuggester:OFF', // we don't use this annotation
// '-Xep:DoNotClaimAnnotations:OFF', // we don't use this annotation
// '-Xep:DoNotMockAutoValue:OFF', // we don't use autovalue
// '-Xep:DoNotUseRuleChain:OFF', // todo could be fixed but not easy
// '-Xep:DoubleCheckedLocking:OFF', // todo check if useful or comment why not
'-Xep:DuplicateBranches:WARN',
'-Xep:DuplicateDateFormatField:WARN',
// '-Xep:EffectivelyPrivate:WARN', // todo, consider this new rule
'-Xep:EmptyBlockTag:WARN',
// '-Xep:EmptyCatch:OFF', // todo check if useful or comment why not - might be handled by ECJ?
// '-Xep:EmptySetMultibindingContributions:OFF', // we don't use this annotation
Expand All @@ -329,6 +338,7 @@ allprojects { prj ->
'-Xep:ErroneousThreadPoolConstructorChecker:WARN',
'-Xep:EscapedEntity:WARN',
// '-Xep:ExtendingJUnitAssert:OFF', // we inherit from LuceneTestCase which extends Assert
'-Xep:ExtendingJUnitAssert:WARN',
'-Xep:ExtendsObject:WARN',
'-Xep:FallThrough:WARN',
'-Xep:Finalize:WARN', // catches actual finalizers that don't call super
Expand All @@ -337,25 +347,27 @@ allprojects { prj ->
'-Xep:FloatingPointAssertionWithinEpsilon:WARN',
'-Xep:FloatingPointLiteralPrecision:WARN',
// '-Xep:FloggerArgumentToString:OFF', // we don't use flogger
// '-Xep:FloggerPerWithoutRateLimit:OFF', // we don't use flogger
// '-Xep:FloggerStringConcatenation:OFF', // we don't use flogger
// '-Xep:FragmentInjection:OFF', // we don't use android
// '-Xep:FragmentNotInstantiable:OFF', // we don't use android
// '-Xep:FutureReturnValueIgnored:OFF', // todo there are problems that should be fixed
// '-Xep:FutureTransformAsync:OFF', // not relevant for Solr codebase
'-Xep:GetClassOnEnum:WARN',
// '-Xep:GuiceNestedCombine:WARN', // todo check if useful or comment why not
'-Xep:HidingField:WARN',
'-Xep:ICCProfileGetInstance:WARN',
'-Xep:IdentityHashMapUsage:WARN',
// '-Xep:IgnoredPureGetter:OFF', // we don't use these google libraries
// '-Xep:ImmutableAnnotationChecker:OFF', // we don't use this annotation
'-Xep:ImmutableEnumChecker:WARN',
'-Xep:InconsistentCapitalization:WARN',
'-Xep:InconsistentHashCode:WARN',
// '-Xep:IgnoredPureGetter:OFF', // we don't use these google libraries
'-Xep:IncorrectMainMethod:WARN',
'-Xep:IncrementInForLoopAndHeader:WARN',
'-Xep:InheritDoc:WARN',
// '-Xep:InjectOnBugCheckers:OFF', // we don't use this annotation
// '-Xep:InjectInvalidTargetingOnScopingAnnotation:OFF', // we don't use this annotation
// '-Xep:InjectOnBugCheckers:OFF', // we don't use this annotation
'-Xep:InjectOnConstructorOfAbstractClass:WARN',
'-Xep:InjectScopeAnnotationOnInterfaceOrAbstractClass:WARN',
'-Xep:InjectedConstructorAnnotations:WARN',
Expand All @@ -365,11 +377,14 @@ allprojects { prj ->
// '-Xep:InputStreamSlowMultibyteRead:OFF', // todo check if useful or comment why not
'-Xep:InlineTrivialConstant:WARN',
'-Xep:InstanceOfAndCastMatchWrongType:WARN',
'-Xep:IntFloatConversion:WARN',
'-Xep:IntLiteralCast:WARN',
'-Xep:IntLongMath:WARN',
// '-Xep:InvalidBlockTag:OFF', // this is needed for tags like lucene.internal
'-Xep:InvalidInlineTag:WARN',
'-Xep:InvalidLink:WARN',
'-Xep:InvalidParam:WARN',
// '-Xep:InvalidSnippet:WARN', // only affects ErrorProne documentation/tests
'-Xep:InvalidThrows:WARN',
'-Xep:InvalidThrowsLink:WARN',
'-Xep:IterableAndIterator:WARN',
Expand All @@ -396,7 +411,8 @@ allprojects { prj ->
'-Xep:JodaPlusMinusLong:WARN',
'-Xep:JodaTimeConverterManager:WARN',
'-Xep:JodaWithDurationAddedLong:WARN',
// '-Xep:JUnitIncompatibleType:WARN', // todo check if useful or comment why not
'-Xep:JUnit4EmptyMethods:WARN',
// '-Xep:JUnitIncompatibleType:OFF', // todo check if useful or comment why not
// '-Xep:LabelledBreakTarget:OFF', // stylistic
'-Xep:LiteEnumValueOf:WARN',
'-Xep:LiteProtoToString:WARN',
Expand All @@ -416,6 +432,7 @@ allprojects { prj ->
// '-Xep:MissingRefasterAnnotation:OFF', // don't use Refaster
// '-Xep:MissingSummary:OFF', // style preference that we don't want to enforce
// '-Xep:MixedMutabilityReturnType:OFF', // todo check if useful or comment why not
'-Xep:MockIllegalThrows:WARN',
'-Xep:MockNotUsedInProduction:WARN',
// '-Xep:MockitoDoSetup:WARN', // todo check if useful or comment why not
'-Xep:ModifiedButNotUsed:WARN',
Expand Down Expand Up @@ -460,7 +477,7 @@ allprojects { prj ->
'-Xep:Overrides:WARN',
// '-Xep:OverridesGuiceInjectableMethod:OFF', // we don't use guice
'-Xep:ParameterName:WARN',
'-Xep:PatternMatchingInstanceof:WARN',
// '-Xep:PatternMatchingInstanceof:WARN', todo: Disable as it gives tons of warnings. v2.41 may have been stricter on this?
'-Xep:PreconditionsCheckNotNullRepeated:WARN',
'-Xep:PrimitiveAtomicReference:WARN',
'-Xep:ProtectedMembersInFinalClass:WARN',
Expand All @@ -469,14 +486,17 @@ allprojects { prj ->
'-Xep:ProtoTimestampGetSecondsGetNano:WARN',
'-Xep:QualifierOrScopeOnInjectMethod:WARN',
'-Xep:ReachabilityFenceUsage:WARN',
'-Xep:RedundantControlFlow:WARN',
'-Xep:ReferenceEquality:WARN',
'-Xep:RethrowReflectiveOperationExceptionAsLinkageError:WARN',
'-Xep:ReturnAtTheEndOfVoidFunction:WARN',
'-Xep:ReturnFromVoid:WARN',
'-Xep:RobolectricShadowDirectlyOn:WARN',
// '-Xep:RuleNotRun:OFF', // not relevant, we use LuceneTestCase
'-Xep:RxReturnValueIgnored:WARN',
// '-Xep:SameNameButDifferent:OFF', // todo check if useful or comment why not
'-Xep:SelfAlwaysReturnsThis:WARN',
'-Xep:SelfSet:WARN',
// '-Xep:ShortCircuitBoolean:OFF', // todo check if useful or comment why not
// '-Xep:StatementSwitchToExpressionSwitch:WARN', // todo check if useful or comment why not
// '-Xep:StaticAssignmentInConstructor:OFF', // we assign SolrTestCaseJ4.configString in many tests, difficult to untangle
Expand All @@ -487,6 +507,7 @@ allprojects { prj ->
'-Xep:StreamToIterable:WARN',
// '-Xep:StringCaseLocaleUsage:OFF', // we have forbiddenapis for that
'-Xep:StringCharset:WARN',
// '-Xep:StringConcatToTextBlock:OFF', // not widely using text blocks yet
'-Xep:StringFormatWithLiteral:WARN',
// '-Xep:StringSplitter:OFF', // todo check if useful or comment why not - might be able to use forbidden-apis for this?
// '-Xep:SunApi:WARN', // todo check if useful or comment why not
Expand All @@ -499,8 +520,11 @@ allprojects { prj ->
// '-Xep:ThreadLocalUsage:OFF', // todo check if useful or comment why not
// '-Xep:ThreadPriorityCheck:OFF', // todo check if useful or comment why not
'-Xep:ThreeLetterTimeZoneID:WARN',
'-Xep:ThrowIfUncheckedKnownUnchecked:WARN',
'-Xep:TimeInStaticInitializer:WARN',
'-Xep:TimeUnitConversionChecker:WARN',
'-Xep:ToStringReturnsNull:WARN',
// '-Xep:TraditionalSwitchExpression:OFF', // todo check if useful or comment why not
// '-Xep:TruthAssertExpected:OFF', // we don't use truth
// '-Xep:TruthConstantAsserts:OFF', // we don't use truth
// '-Xep:TruthContainsExactlyElementsInUsage:OFF', // we don't use truth
Expand All @@ -517,11 +541,13 @@ allprojects { prj ->
// '-Xep:UnnecessaryAssignment:OFF', // we don't use these annotations
'-Xep:UnnecessaryAsync:WARN',
// '-Xep:UnnecessaryBreakInSwitch:WARN', // todo check if useful or comment why not
// '-Xep:UnnecessaryCopy:OFF', // proto-specific, not widely used
'-Xep:UnnecessaryLambda:WARN',
'-Xep:UnnecessaryLongToIntConversion:WARN',
'-Xep:UnnecessaryMethodInvocationMatcher:WARN',
'-Xep:UnnecessaryMethodReference:WARN',
// '-Xep:UnnecessaryParentheses:OFF', // style preference that we don't want to enforce
// '-Xep:UnnecessaryQualifier:OFF', // annotation-specific, not widely used
'-Xep:UnnecessaryStringBuilder:WARN',
// '-Xep:UnnecessaryTestMethodPrefix:OFF', // style preference that we don't want to enforce
// '-Xep:UnqualifiedYield:OFF', // javac takes care
Expand Down
15 changes: 8 additions & 7 deletions solr/api/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ com.google.auto.service:auto-service-annotations:1.0.1=annotationProcessor,error
com.google.auto.value:auto-value-annotations:1.10.4=annotationProcessor,errorprone,testAnnotationProcessor
com.google.auto:auto-common:1.2.2=annotationProcessor,errorprone,testAnnotationProcessor
com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,errorprone,testAnnotationProcessor
com.google.errorprone:error_prone_annotation:2.31.0=annotationProcessor,errorprone,testAnnotationProcessor
com.google.errorprone:error_prone_annotations:2.31.0=annotationProcessor,errorprone,jarValidation,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
com.google.errorprone:error_prone_check_api:2.31.0=annotationProcessor,errorprone,testAnnotationProcessor
com.google.errorprone:error_prone_core:2.31.0=annotationProcessor,errorprone,testAnnotationProcessor
com.google.errorprone:error_prone_type_annotations:2.31.0=annotationProcessor,errorprone,testAnnotationProcessor
com.google.errorprone:error_prone_annotation:2.41.0=annotationProcessor,errorprone,testAnnotationProcessor
com.google.errorprone:error_prone_annotations:2.41.0=annotationProcessor,errorprone,jarValidation,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
com.google.errorprone:error_prone_check_api:2.41.0=annotationProcessor,errorprone,testAnnotationProcessor
com.google.errorprone:error_prone_core:2.41.0=annotationProcessor,errorprone,testAnnotationProcessor
com.google.googlejavaformat:google-java-format:1.27.0=annotationProcessor,errorprone,testAnnotationProcessor
com.google.guava:failureaccess:1.0.2=annotationProcessor,errorprone,jarValidation,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
com.google.guava:guava:33.1.0-jre=annotationProcessor,errorprone,jarValidation,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
com.google.guava:guava:33.1.0-jre=jarValidation,testCompileClasspath,testRuntimeClasspath
com.google.guava:guava:33.4.0-jre=annotationProcessor,errorprone,testAnnotationProcessor
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,errorprone,jarValidation,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath
com.google.j2objc:j2objc-annotations:3.1=annotationProcessor,errorprone,testAnnotationProcessor,testCompileClasspath
com.google.protobuf:protobuf-java:3.25.8=annotationProcessor,errorprone,testAnnotationProcessor
com.j256.simplemagic:simplemagic:1.17=jarValidation,testRuntimeClasspath
com.jayway.jsonpath:json-path:2.9.0=jarValidation,testRuntimeClasspath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof SolrVersion)) {
if (!(other instanceof SolrVersion solrVersion)) {
return false;
}
return compareTo((SolrVersion) other) == 0;
return compareTo(solrVersion) == 0;
}
}
Loading
Loading