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

This class overrides "equals()" and should therefore also override "hashCode()". #5886

Open
MinaQin opened this issue May 12, 2022 · 3 comments · May be fixed by #5949
Open

This class overrides "equals()" and should therefore also override "hashCode()". #5886

MinaQin opened this issue May 12, 2022 · 3 comments · May be fixed by #5949

Comments

@MinaQin
Copy link
Contributor

MinaQin commented May 12, 2022

Code Path:server/src/main/java/org/apache/iotdb/db/metadata/mnode/container/MNodeContainers.java
image
According to the Java Language Specification, there is a contract between equals(Object) and hashCode():

If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.

It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results.

However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables.

In order to comply with this contract, those methods should be either both inherited, or both overridden.

@selectbook
Copy link
Contributor

We Open Star

@HTHou HTHou linked a pull request May 18, 2022 that will close this issue
11 tasks
@azhsmesos
Copy link

please assigned it to me

@GuanchuShen
Copy link

[WeOpen Star]I would like to help

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

Successfully merging a pull request may close this issue.

5 participants