You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2018/08/04 00:13:34 UTC

[1/2] groovy git commit: Revert "Trivial refactoring: remove useless code"

Repository: groovy
Updated Branches:
  refs/heads/master 086b35341 -> aaf789f14


Revert "Trivial refactoring: remove useless code"

This reverts commit 086b353


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

Branch: refs/heads/master
Commit: 6105c6338b58d99b7f90142901603c425741e39b
Parents: 086b353
Author: Daniel Sun <su...@apache.org>
Authored: Sat Aug 4 07:58:13 2018 +0800
Committer: Daniel Sun <su...@apache.org>
Committed: Sat Aug 4 07:58:13 2018 +0800

----------------------------------------------------------------------
 .../org/codehaus/groovy/ast/builder/AstSpecificationCompiler.groovy | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/6105c633/src/main/groovy/org/codehaus/groovy/ast/builder/AstSpecificationCompiler.groovy
----------------------------------------------------------------------
diff --git a/src/main/groovy/org/codehaus/groovy/ast/builder/AstSpecificationCompiler.groovy b/src/main/groovy/org/codehaus/groovy/ast/builder/AstSpecificationCompiler.groovy
index e754d18..e033af8 100644
--- a/src/main/groovy/org/codehaus/groovy/ast/builder/AstSpecificationCompiler.groovy
+++ b/src/main/groovy/org/codehaus/groovy/ast/builder/AstSpecificationCompiler.groovy
@@ -166,6 +166,7 @@ class AstSpecificationCompiler implements GroovyInterceptable {
 
         def oldProps = new ArrayList(expression)
         expression.clear()
+        new AstSpecificationCompiler(argBlock)
         def result = constructorStatement(expression) // invoke custom constructor for node
         expression.clear()
         expression.addAll(oldProps)


[2/2] groovy git commit: Make `captureAndCreateNode` CompileStatic

Posted by su...@apache.org.
Make `captureAndCreateNode` CompileStatic


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

Branch: refs/heads/master
Commit: aaf789f145ffdda187d27ffe48c108d61650d9b9
Parents: 6105c63
Author: Daniel Sun <su...@apache.org>
Authored: Sat Aug 4 08:13:09 2018 +0800
Committer: Daniel Sun <su...@apache.org>
Committed: Sat Aug 4 08:13:09 2018 +0800

----------------------------------------------------------------------
 .../groovy/ast/builder/AstSpecificationCompiler.groovy         | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/aaf789f1/src/main/groovy/org/codehaus/groovy/ast/builder/AstSpecificationCompiler.groovy
----------------------------------------------------------------------
diff --git a/src/main/groovy/org/codehaus/groovy/ast/builder/AstSpecificationCompiler.groovy b/src/main/groovy/org/codehaus/groovy/ast/builder/AstSpecificationCompiler.groovy
index e033af8..7c68a55 100644
--- a/src/main/groovy/org/codehaus/groovy/ast/builder/AstSpecificationCompiler.groovy
+++ b/src/main/groovy/org/codehaus/groovy/ast/builder/AstSpecificationCompiler.groovy
@@ -18,6 +18,7 @@
  */
 package org.codehaus.groovy.ast.builder
 
+import groovy.transform.CompileStatic
 import org.codehaus.groovy.ast.ASTNode
 import org.codehaus.groovy.ast.AnnotationNode
 import org.codehaus.groovy.ast.ClassHelper
@@ -160,14 +161,15 @@ class AstSpecificationCompiler implements GroovyInterceptable {
     *       the actual parameters being specified for the node
     * @param constructorStatement
     *       the type specific construction code that will be run
-    */ 
+    */
+    @CompileStatic
     private void captureAndCreateNode(String name, @DelegatesTo(AstSpecificationCompiler) Closure argBlock, Closure constructorStatement) {
         if (!argBlock) throw new IllegalArgumentException("nodes of type $name require arguments to be specified")
 
         def oldProps = new ArrayList(expression)
         expression.clear()
         new AstSpecificationCompiler(argBlock)
-        def result = constructorStatement(expression) // invoke custom constructor for node
+        ASTNode result = (ASTNode) constructorStatement(expression) // invoke custom constructor for node
         expression.clear()
         expression.addAll(oldProps)
         expression.add(result)