[
https://issues.apache.org/jira/browse/GROOVY-11814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King resolved GROOVY-11814.
--------------------------------
Fix Version/s: 5.0.4
Assignee: Paul King
Resolution: Fixed
> ToString transform should be enum aware
> ---------------------------------------
>
> Key: GROOVY-11814
> URL: https://issues.apache.org/jira/browse/GROOVY-11814
> Project: Groovy
> Issue Type: Bug
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
> Fix For: 5.0.4
>
>
> Although it may not be common to use @ToString for an enum, it is supported:
> {code:groovy}
> @ToString(includeNames = true)
> enum Foo {
> Bar(prop: 'val1'), Baz(prop: 'val2')
> final String prop
> }
> {code}
> The current behavior has the classname hard-coded and produces:
> {code:groovy}
> println Foo.Bar // Foo(prop:val1)
> println Foo.Baz // Foo(prop:val2)
> {code}
> The suggested behavior is:
> {code:groovy}
> println Foo.Bar // Bar(prop:val1)
> println Foo.Baz // Baz(prop:val2)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)