-
Notifications
You must be signed in to change notification settings - Fork 61
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
Remove hashCode calls on arrays #128
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
timtebeek
reviewed
Jun 22, 2023
src/main/java/org/openrewrite/staticanalysis/RemoveHashCodeCallsFromArrayInstances.java
Outdated
Show resolved
Hide resolved
timtebeek
reviewed
Jun 22, 2023
src/main/java/org/openrewrite/staticanalysis/RemoveHashCodeCallsFromArrayInstances.java
Outdated
Show resolved
Hide resolved
timtebeek
reviewed
Jun 22, 2023
src/main/java/org/openrewrite/staticanalysis/RemoveHashCodeCallsFromArrayInstances.java
Outdated
Show resolved
Hide resolved
timtebeek
changed the title
Alek/remove hash code calls from array instances
Remove hashCode calls on arrays
Jun 26, 2023
- Remove `Preconditions.or` for single element - Collapse `if` statements for select type check - Inline `builder_string`, as variable name does not conform to Java standards & limited use & scope allows for inlining - Remove unnecessary elements from test cases to prevent confusion - Remove public visibility from test class
timtebeek
approved these changes
Jun 26, 2023
Merged after some small clean ups in 1d9871f ; thanks again! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's changed?
This is related to my other PR. @timtebeek suggested to me that I split the recipe because the
toString()
part required more checks sincetoString()
is such a widely used method. This recipe basically does the same thing but on a smaller scale forhashCode()
calls on array instances.What's your motivation?
#44
Anything in particular you'd like reviewers to focus on?
I think this recipe should be finished but maybe there are other edge case methods that implicitly call
hashCode()
I'm forgetting.Anyone you would like to review specifically?
@timtebeek
Any additional context
RSPEC-2116
Checklist
./gradlew licenseFormat