eric-milles edited a comment on pull request #1674:
URL: https://github.com/apache/groovy/pull/1674#issuecomment-1013940781


   GROOVY-6151 is a good illustration of user expectations (comments added):
   ```groovy
   class TestError extends HashMap {
       String id
       boolean equals(Object o) {
           if (this.is(o)) return true
           if (getClass() != o.class) return false // "o.class" may not be 
"getClass()" for some types
           if (!super.equals(o)) return false
           TestError testError = (TestError) o
           if (id != testError.id) return false // "id" and "this.id" refer to 
the property; "testError.id" does not refer to "getId()"
           return true
       }
   }
   ```
   
   With this PR, all references to "id" will refer to the declared property and 
not a Map property.  "class" vs "getClass()" and "empty" vs "isEmpty()" remain 
unchanged.


-- 
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]


Reply via email to