awallgren commented on pull request #1260:
URL: https://github.com/apache/groovy/pull/1260#issuecomment-635025088


   > 
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/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, provided no information used in equals comparisons on the 
object is modified. **This integer need not remain consistent from one 
execution of an application to another execution of the same application.**
   > 
   > As the javadoc of `hashCode` shows, "This integer need not remain 
consistent from one execution of an application to another execution of the 
same application."
   
   I believe you are misreading that.  It doesn't need to be consistent between 
invocations of the JVM itself (i.e. between different processes). 
   
   It needs to return the same value as long as no properties referenced in 
equals() changes.
   


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to