groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GROOVY-9028) @EqualsAndHashCode can't recognize final field
Date Fri, 08 Mar 2019 02:46:00 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-9028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Paul King resolved GROOVY-9028.
-------------------------------
       Resolution: Fixed
         Assignee: Paul King
    Fix Version/s: 2.5.7
                   3.0.0-alpha-5

I reworded the javadoc for @EqualsAndHashCode to hopefully make it clearer what it does.

> @EqualsAndHashCode can't recognize final field
> ----------------------------------------------
>
>                 Key: GROOVY-9028
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9028
>             Project: Groovy
>          Issue Type: Bug
>          Components: ast builder
>    Affects Versions: 2.5.3
>         Environment: Groovy Version: 2.5.3 JVM: 11.0.2 Vendor: Oracle Corporation OS:
Mac OS X
>            Reporter: zhb
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 3.0.0-alpha-5, 2.5.7
>
>
> {code:java}
> import groovy.transform.EqualsAndHashCode
> @EqualsAndHashCode(includes = ["name"])
> class Test {
>     private final String name
>     Test(String name) {
>         this.name = name
>     }
>     String getName() {
>         return name
>     }
> }
> {code}
> Groovy 2.5.3 complains: 
> {noformat}
> /Users/zhb/Projects/tmp/Main.groovy: 3: Error during @EqualsAndHashCode processing: 'includes'
property 'name' does not exist.
> @ line 3, column 1.
> @EqualsAndHashCode(includes = ["name"])
> ^
> 1 error
> {noformat}
> But Groovy 2.4.16 works fine.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message