Björn Kautler created GROOVY-9980:
-------------------------------------
Summary: 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: 3.0.6, 2.5.12
Reporter: Björn Kautler
{{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.3.4#803005)