[ https://issues.apache.org/jira/browse/GROOVY-9980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Sun updated GROOVY-9980: ------------------------------- Fix Version/s: 4.0.4 > 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, 4.0.4 > > > {{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)