You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2021/12/03 20:35:00 UTC
[jira] [Resolved] (GROOVY-10398) LazyFieldNode never equals itself
[ https://issues.apache.org/jira/browse/GROOVY-10398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King resolved GROOVY-10398.
--------------------------------
Fix Version/s: 3.0.10
4.0.0-rc-2
Assignee: Paul King
Resolution: Fixed
Proposed PR merged.
> 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
> Assignee: Paul King
> Priority: Major
> Fix For: 3.0.10, 4.0.0-rc-2
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> 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)