Skip to content

Add equals() and hashCode() methods to topic description classes #480

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

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

Conversation

Eistern
Copy link

@Eistern Eistern commented May 7, 2025

This PR introduces proper equals() and hashCode() implementations to classes used during topic description operations. These implementations follow standard Java equality contract patterns and allow for reliable comparison of description objects.

@Eistern
Copy link
Author

Eistern commented May 7, 2025

Dependent on the #476

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 96 lines in your changes missing coverage. Please review.

Project coverage is 58.27%. Comparing base (54ea1d5) to head (51f5f5e).

Files with missing lines Patch % Lines
...a/tech/ydb/topic/description/TopicDescription.java 0.00% 15 Missing ⚠️
...h/ydb/topic/description/ConsumerPartitionInfo.java 0.00% 12 Missing ⚠️
...ava/tech/ydb/topic/description/PartitionStats.java 0.00% 11 Missing ⚠️
...main/java/tech/ydb/topic/description/Consumer.java 0.00% 10 Missing ⚠️
...java/tech/ydb/topic/description/PartitionInfo.java 0.00% 8 Missing ⚠️
...in/java/tech/ydb/topic/description/TopicStats.java 0.00% 8 Missing ⚠️
...ettings/AutoPartitioningWriteStrategySettings.java 0.00% 6 Missing ⚠️
.../tech/ydb/topic/settings/PartitioningSettings.java 0.00% 6 Missing ⚠️
...ech/ydb/topic/description/ConsumerDescription.java 0.00% 5 Missing ⚠️
...ech/ydb/topic/description/MultipleWindowsStat.java 0.00% 5 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #480      +/-   ##
============================================
- Coverage     58.71%   58.27%   -0.45%     
+ Complexity     2182     2179       -3     
============================================
  Files           323      323              
  Lines         13071    13167      +96     
  Branches       1278     1318      +40     
============================================
- Hits           7675     7673       -2     
- Misses         4774     4871      +97     
- Partials        622      623       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Eistern Eistern force-pushed the feature/equals-hashcode-for-descriptions branch from 6f3d0f5 to 51f5f5e Compare May 13, 2025 05:30
@Eistern Eistern marked this pull request as ready for review May 13, 2025 05:30

@Override
public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every equals implementation must start with

if (this == o) {
  return true;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants