harshpanchal04 opened a new pull request, #4368:
URL: https://github.com/apache/gravitino/pull/4368
<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
Examples:
- "[#123] feat(operator): support xxx"
- "[#233] fix: check null before access result in xxx"
- "[MINOR] refactor: fix typo in variable name"
- "[MINOR] docs: fix typo in README"
- "[#255] test: fix flaky test NameOfTheTest"
Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. If the PR is unfinished, please mark this PR as draft.
-->
### What changes were proposed in this pull request?
This PR adds equals and hashCode methods to the GravitinoVersion class.
These changes ensure that GravitinoVersion objects are compared consistently
across different contexts, aligning with the natural ordering provided by the
compareTo method.
### Why are the changes needed?
Without the equals method, comparing GravitinoVersion instances can lead to
inconsistent behavior depending on whether compareTo or equals is used. This
inconsistency can cause issues in collections that rely on equals and hashCode,
such as HashMap and HashSet. Adding these methods ensures that GravitinoVersion
instances are compared correctly and consistently, regardless of the method
used.
Fix: #3079
### Does this PR introduce _any_ user-facing change?
No, this PR does not introduce any user-facing changes.
### How was this patch tested?
(Please test your changes, and provide instructions on how to test it:
1. If you add a feature or fix a bug, add a test to cover your changes.
2. If you fix a flaky test, repeat it for many times to prove it works.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]