liyafan82 commented on issue #1839: [CALCITE-3836] The hash codes of RelNodes are unreliable URL: https://github.com/apache/calcite/pull/1839#issuecomment-595131405 > > liyafan82: So the hash code of an object may change > > Vladimir: This is false > > liyafan82: Would you please give some docs/link/code proving this? > > @liyafan82 , would you please provide docs/link/code instead? > > Here's the javadoc for [Object#hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) > > > Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method **_must consistently return the same integer_** > > > liyafan82: So the hash code of an object may change > > Can you please provide a justification or a reproducible case instead? > > > liyafan82: Sorry. I do not understand why it violates the contract. Would you please elaborate more on this? > > Please check the javadoc for `Object#hashCode` and `#equals`. Please study https://jqno.nl/equalsverifier/ as well. @vlsi Thanks a lot for your feedback. I am aware of the JavaDocs. I am just a little concerned about the implementation details. According to the discussio in the JIRA, I think I am convinced that the hashCode should not change. The tool you recommended is cool. Thank you.
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
