You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "James Kleeh (Jira)" <ji...@apache.org> on 2021/11/30 16:07:00 UTC

[jira] [Created] (GROOVY-10398) LazyFieldNode never equals itself

James Kleeh created GROOVY-10398:
------------------------------------

             Summary: LazyFieldNode never equals itself
                 Key: GROOVY-10398
                 URL: https://issues.apache.org/jira/browse/GROOVY-10398
             Project: Groovy
          Issue Type: Bug
          Components: ast builder
    Affects Versions: 3.0.9
            Reporter: James Kleeh


Assume you have a LazyFieldNode instance

LazyFieldNode node = ...

List nodes = [node]

`nodes.contains(node)` -> this will return false

 

This is because the `equals` method that `LazyFieldNode` implements compares the object to the delegate instead of itself so a lazy field node can never equal itself



--
This message was sent by Atlassian Jira
(v8.20.1#820001)