-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Array, passed to Objects.hash(), should be wrapped into Arrays.hashCode() #15383
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Dmitry Kryukov <dk2k@ya.ru>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15383 +/- ##
============================================
+ Coverage 71.93% 71.96% +0.03%
- Complexity 63223 63226 +3
============================================
Files 5214 5214
Lines 295938 295938
Branches 42754 42754
============================================
+ Hits 212876 212968 +92
+ Misses 65601 65480 -121
- Partials 17461 17490 +29 ☔ View full report in Codecov by Sentry. |
How does this change the behavior of this code? Needs a test? |
@@ -103,7 +103,7 @@ public boolean equals(final Object o) { | |||
|
|||
@Override | |||
public int hashCode() { | |||
return Objects.hash(trimAboveSeqNo, maxSeenAutoIdTimestampOnPrimary, operations); | |||
return Objects.hash(trimAboveSeqNo, maxSeenAutoIdTimestampOnPrimary, Arrays.hashCode(operations)); |
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.
We are increasing time complexity by doing this change for sure. Is there a specific reason for doing this?
Array, passed to Objects.hash(), should be wrapped into Arrays.hashCode()