groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Refine "GROOVY-8543: Support setting compileStatic by default via system properties"
Date Fri, 13 Apr 2018 03:35:31 GMT
Repository: groovy
Updated Branches:
  refs/heads/master 81ffc8099 -> 39e4078c5


Refine "GROOVY-8543: Support setting compileStatic by default via system properties"

If `groovy.transform.CompileDynamic` annotation attached, skip attaching `groovy.transform.CompileStatic`
annotation automatically.


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/39e4078c
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/39e4078c
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/39e4078c

Branch: refs/heads/master
Commit: 39e4078c55d9f0824351310eebda260f2fb360ab
Parents: 81ffc80
Author: sunlan <sunlan@apache.org>
Authored: Fri Apr 13 11:35:26 2018 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Fri Apr 13 11:35:26 2018 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/groovy/parser/antlr4/AstBuilder.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/39e4078c/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
index 22c59d2..e548a0b 100644
--- a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
@@ -1188,7 +1188,9 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object>
implements Groov
         classNode.setSyntheticPublic(syntheticPublic);
 
         if (COMPILE_STATIC_BY_DEFAULT) {
-            attachCompileStaticAnnotation(classNode);
+            if (classNode.getAnnotations(ClassHelper.make(GROOVY_TRANSFORM_COMPILE_DYNAMIC)).isEmpty())
{
+                attachCompileStaticAnnotation(classNode);
+            }
         }
         if (asBoolean(ctx.TRAIT())) {
             attachTraitAnnotation(classNode);
@@ -4753,6 +4755,7 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object>
implements Groov
     private static final String PACKAGE_INFO = "package-info";
     private static final String PACKAGE_INFO_FILE_NAME = PACKAGE_INFO + ".groovy";
     private static final String GROOVY_TRANSFORM_COMPILE_STATIC = "groovy.transform.CompileStatic";
+    private static final String GROOVY_TRANSFORM_COMPILE_DYNAMIC = "groovy.transform.CompileDynamic";
     private static final String GROOVY_TRANSFORM_TRAIT = "groovy.transform.Trait";
     private static final Set<String> PRIMITIVE_TYPE_SET = Collections.unmodifiableSet(new
HashSet<>(Arrays.asList("boolean", "char", "byte", "short", "int", "long", "float",
"double")));
     private static final Logger LOGGER = Logger.getLogger(AstBuilder.class.getName());


Mime
View raw message