-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOLR-16427: Evaluate and fix errorprone rules #1037
Conversation
Tests pass with these changes and pass |
solr/core/src/test/org/apache/solr/update/processor/FieldMutatingUpdateProcessorTest.java
Show resolved
Hide resolved
solr/core/src/test/org/apache/solr/update/processor/ParsingFieldUpdateProcessorsTest.java
Show resolved
Hide resolved
I'm hoping to rerun the warnings report from IntelliJ with a before and after this PR, as I suspect these fixes will directly impact those warnings! I love how you are enabling errorprone for these.. I never quite cracked "how to prevent them from coming back" with my work on SOLR-16222. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Enables the following errorprone rules: * `ArrayEquals` * `ArrayHashCode` * `ArrayToString` * `CollectionUndefinedEquality` * `EqualsIncompatibleType` * `FormatString` * `UndefinedEquals` Most of the fixes are straight forward - use `.equals` and `Objects.equals` where appropriate. Used `contentEquals` for char sequences. Make sure to compare `Instant` instead of just `Date`. Ensure proper string format number of arguments. Make sure to use proper Array methods for `hashCode` and `toString`
https://issues.apache.org/jira/browse/SOLR-16427
Enables the following errorprone rules:
ArrayEquals
ArrayHashCode
ArrayToString
CollectionUndefinedEquality
EqualsIncompatibleType
FormatString
UndefinedEquals
Most of the fixes are straight forward - use
.equals
andObjects.equals
where appropriate. UsedcontentEquals
for char sequences. Make sure to compareInstant
instead of justDate
. Ensure proper string format number of arguments. Make sure to use proper Array methods forhashCode
andtoString