[
https://issues.apache.org/jira/browse/GROOVY-8014?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King resolved GROOVY-8014.
-------------------------------
Resolution: Fixed
Fix Version/s: 2.5.0-beta-1
> @ToString could output properties in a predefined order when 'includes' is
> used
> -------------------------------------------------------------------------------
>
> Key: GROOVY-8014
> URL: https://issues.apache.org/jira/browse/GROOVY-8014
> Project: Groovy
> Issue Type: Improvement
> Components: xforms
> Reporter: Paul King
> Assignee: Paul King
> Fix For: 2.5.0-beta-1
>
>
> Given a class:
> {code}
> class Foo {
> String a, b
> private String c, d
> }
> {code}
> Adding a toString annotation, e.g. {{@ToString(includeFields=true)}} will
> output the properties/fields in an unspecified order - basically the order
> the properties are returned followed by the order that the fields are
> returned. This can be different for different Java versions.
> The proposal is that if {{includes='a,c,b,d'}} is added, then the
> fields/properties will be output in that order. This could be considered a
> breaking change for anyone using 'includes' and relying on the current
> ordering but as mentioned earlier, this is currently different for different
> Java versions and possibly different on different JVMs (e.g. Azul, IBM,
> Oracle, OpenJDK or possibly on different platforms). The proposal will at
> least give a mechanism to have a defined order.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)