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 2017/02/01 23:19:07 UTC
[jira] [Closed] (GROOVY-6245) @EqualsAndHashCode assumes get style
getters for boolean properties
[ https://issues.apache.org/jira/browse/GROOVY-6245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-6245.
-----------------------------
> @EqualsAndHashCode assumes get style getters for boolean properties
> -------------------------------------------------------------------
>
> Key: GROOVY-6245
> URL: https://issues.apache.org/jira/browse/GROOVY-6245
> Project: Groovy
> Issue Type: Bug
> Components: xforms
> Affects Versions: 2.1.6, 2.2.0-beta-1, 2.4.5
> Reporter: Marcin Erdmann
> Assignee: Paul King
> Fix For: 2.4.8
>
>
> It basically means that equals() and hashCode() generated using @EqualsAsHashCode will throw MissingMethodException if you define only is style getters for a glass. I expected the following to pass but it doesn't:
> {code}
> import groovy.transform.EqualsAndHashCode
> @EqualsAndHashCode
> class A {
> boolean a
>
> boolean isA() { a }
> }
>
> def a1 = new A(a: true)
> def a2 = new A(a: true)
> assert a1.a
> assert a1.hashCode()
> assert a1 == a2
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)