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

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

eric-milles opened a new pull request, #2388:
URL: https://github.com/apache/groovy/pull/2388

   Move target checking from vmplugin to ast node.  Only compute once per 
annotation type.
   
   If this is okay, retention policy will follow.




> 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)

Reply via email to