You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/07/05 16:37:00 UTC

[jira] [Resolved] (GROOVY-9980) AnnotationConstantExpression#visit visits its members values first before visiting itself

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

Eric Milles resolved GROOVY-9980.
---------------------------------
    Fix Version/s: 5.0.0-alpha-1
       Resolution: Fixed

https://github.com/apache/groovy/commit/219d2914cc6891abf25e15ec09d7a9c7230b30ad

> AnnotationConstantExpression#visit visits its members values first before visiting itself
> -----------------------------------------------------------------------------------------
>
>                 Key: GROOVY-9980
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9980
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.5.12, 3.0.6
>            Reporter: Björn Kautler
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 5.0.0-alpha-1
>
>
> {{org.codehaus.groovy.ast.expr.AnnotationConstantExpression#visit}} first visits the values of its members before it visits itself.
> I'm not sure why this should be a good idea.
> If you for example have some AST to source visitor similar to the one in the Groovy Console and this annotation constant expression as value for an annotation member:
> {code:java}
> blocks = {@BlockMetadata(
>     kind = BlockKind.SETUP,
>     texts = {"an a"}
> )} {code}
> then it will render as
> {code:java}
> blocks = [org.spockframework.runtime.model.BlockKind.SETUP["an a"]@org.spockframework.runtime.model.BlockMetadata(kind = org.spockframework.runtime.model.BlockKind.SETUP, texts = ["an a"])]{code}
> instead of the correct
> {code:java}
> blocks = [@org.spockframework.runtime.model.BlockMetadata(kind = org.spockframework.runtime.model.BlockKind.SETUP, texts = ["an a"])]{code}
>  



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