Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dk2k
Copy link
Contributor

@dk2k dk2k commented Aug 23, 2024

Array, passed to Objects.hash(), should be wrapped into Arrays.hashCode()

Copy link
Contributor

✅ Gradle check result for 9abc6d8: SUCCESS

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 71.96%. Comparing base (abb1041) to head (9abc6d8).
Report is 7 commits behind head on main.

Files Patch % Lines
...search/action/resync/ResyncReplicationRequest.java 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@dblock
Copy link
Member

dblock commented Aug 23, 2024

How does this change the behavior of this code? Needs a test?

@dblock dblock added backport 2.x Backport to 2.x branch skip-changelog labels Aug 23, 2024
@@ -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));
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants