You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/07/26 14:18:00 UTC

[jira] [Commented] (GROOVY-10705) ToString order bug for super properties

    [ https://issues.apache.org/jira/browse/GROOVY-10705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17571455#comment-17571455 ] 

ASF GitHub Bot commented on GROOVY-10705:
-----------------------------------------

paulk-asert merged PR #1754:
URL: https://github.com/apache/groovy/pull/1754




> ToString order bug for super properties
> ---------------------------------------
>
>                 Key: GROOVY-10705
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10705
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>
> In the doco for @ToString, we indicate that properties from a child come before properties from super classes. This is true but properties that also happen to be present in super classes don't keep their respective order with other properties, e.g.:
> {code:java}
> class Base {
>     String a = 'base a'
>     String c = 'base c'
> }
> @groovy.transform.ToString(includeSuperProperties=true)
> class Child extends Base {
>     String a = 'child a'
>     String b = 'child b'
> }
> println new Child() // => Child(child b, child a, base c)
> {code}
> However, the expected order is for properties within the child class to follow declaration order.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)