[
https://issues.apache.org/jira/browse/GROOVY-6526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles reassigned GROOVY-6526:
-----------------------------------
Assignee: Eric Milles
> AnnotationNode.isTargetAllowed returns true for any value
> ---------------------------------------------------------
>
> Key: GROOVY-6526
> URL: https://issues.apache.org/jira/browse/GROOVY-6526
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 2.2.1
> Reporter: Andres Almiray
> Assignee: Eric Milles
> Priority: Major
> Labels: annotations
>
> As the title says, invoking {{isTargetAllowed()}} with any of the accepted
> target constants always returns true, completely disregarding any values that
> the annotation may have. For example
> {code}
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.METHOD)
> public @interface Threading {
> }
> {code}
> {code}
> AnnotationNode annotation = classNode.getAnnotation(Threading.class)
> assert annotationNode.isTargetAllowed(AnnotationNode.FIELD_TARGET) // passes!
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)