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

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

paulk-asert opened a new pull request, #2769:
URL: https://github.com/apache/groovy/pull/2769

   …le system property
   
   The @ASTTest closure is evaluated during compilation, so merely compiling 
source which carries the annotation executes that code, whether or not the 
compiled result is subsequently run. Embedders which compile source they do not 
control have no way to turn this off.
   
   Add a groovy.asttest.enable system property, defaulting to true, which makes 
the annotation a no-op when set to false. This mirrors groovy.grape.enable for 
@Grab. The check is in visit(), so the closure is never scheduled onto a 
compilation phase rather than being scheduled and skipped.
   
   The property is read per-visit rather than into a static final field so that 
it can be exercised without relying on JVM startup state. Being a system 
property it is process-wide, exactly as groovy.grape.enable is: a JVM cannot 
enable @ASTTest for one compilation and disable it for another.




> Allow @ASTTest to be disabled via a groovy.asttest.enable system property
> -------------------------------------------------------------------------
>
>                 Key: GROOVY-12236
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12236
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>




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

Reply via email to