You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2019/04/12 00:28:16 UTC

[groovy] branch master updated (d1c45d0 -> 1b5381b)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git.


    from d1c45d0  tests seem to work now
     new fda625f  GROOVY-9078: Inefficiency in MethodNode and ConstructorNode
     new a9344d0  Remove extra "a"
     new 1b5381b  Change doc URL from beta to non-beta (closes #908)

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/codehaus/groovy/ast/ConstructorNode.java    | 16 ++++------------
 src/main/java/org/codehaus/groovy/ast/MethodNode.java    |  2 --
 src/spec/doc/core-metaprogramming.adoc                   |  2 +-
 src/spec/doc/style-guide.adoc                            |  2 +-
 4 files changed, 6 insertions(+), 16 deletions(-)


[groovy] 02/03: Remove extra "a"

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit a9344d0fceefe2fc6e5366fea06a04465a692b85
Author: Michael Kutz <mi...@rewe-digital.com>
AuthorDate: Tue Apr 9 15:14:50 2019 +0200

    Remove extra "a"
---
 src/spec/doc/core-metaprogramming.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/spec/doc/core-metaprogramming.adoc b/src/spec/doc/core-metaprogramming.adoc
index eaf262d..331d20f 100644
--- a/src/spec/doc/core-metaprogramming.adoc
+++ b/src/spec/doc/core-metaprogramming.adoc
@@ -98,7 +98,7 @@ include::{projectdir}/src/spec/test/metaprogramming/GroovyObjectTest.groovy[tags
 
 ==== get/setMetaClass
 
-You can a access an object's `metaClass` or set your own `MetaClass` implementation for changing the default interception mechanism. For example, you can write your own implementation of the `MetaClass` interface and assign it to objects in order to change the interception mechanism:
+You can access an object's `metaClass` or set your own `MetaClass` implementation for changing the default interception mechanism. For example, you can write your own implementation of the `MetaClass` interface and assign it to objects in order to change the interception mechanism:
 
 [source,groovy]
 ----


[groovy] 03/03: Change doc URL from beta to non-beta (closes #908)

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 1b5381bd966c5effa004548c617987d340ccc940
Author: Michael Kutz <mi...@rewe-digital.com>
AuthorDate: Wed Apr 10 09:06:45 2019 +0200

    Change doc URL from beta to non-beta (closes #908)
    
    I don't see any reason why the reader should be directed to the beta
    docs instead of the current ones.
---
 src/spec/doc/style-guide.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/spec/doc/style-guide.adoc b/src/spec/doc/style-guide.adoc
index 828e628..fdb47e1 100644
--- a/src/spec/doc/style-guide.adoc
+++ b/src/spec/doc/style-guide.adoc
@@ -498,7 +498,7 @@ These methods add a functional flavor to the programming language and help worki
 Lots of new methods are applied to various types, through decoration, thanks to the dynamic nature of the language.
 You can find lots of very useful methods on String, Files, Streams, Collections, and much more:
 
-http://beta.groovy-lang.org/gdk.html
+http://groovy-lang.org/gdk.html
 
 == The power of switch
 


[groovy] 01/03: GROOVY-9078: Inefficiency in MethodNode and ConstructorNode

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit fda625f5a5fa63995a8f973e303c872cc26b16d0
Author: Paul King <pa...@asert.com.au>
AuthorDate: Fri Apr 12 10:24:49 2019 +1000

    GROOVY-9078: Inefficiency in MethodNode and ConstructorNode
    
    remove redundant call
---
 .../java/org/codehaus/groovy/ast/ConstructorNode.java    | 16 ++++------------
 src/main/java/org/codehaus/groovy/ast/MethodNode.java    |  2 --
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/ast/ConstructorNode.java b/src/main/java/org/codehaus/groovy/ast/ConstructorNode.java
index 66fbed4..da9a87f 100644
--- a/src/main/java/org/codehaus/groovy/ast/ConstructorNode.java
+++ b/src/main/java/org/codehaus/groovy/ast/ConstructorNode.java
@@ -23,27 +23,19 @@ import org.codehaus.groovy.ast.expr.Expression;
 import org.codehaus.groovy.ast.stmt.ExpressionStatement;
 import org.codehaus.groovy.ast.stmt.Statement;
 
-
 /**
  * Represents a constructor declaration
  */
 public class ConstructorNode extends MethodNode {
-    
+
     public ConstructorNode(int modifiers, Statement code) {
         this(modifiers, Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, code);
     }
-    
+
     public ConstructorNode(int modifiers, Parameter[] parameters, ClassNode[] exceptions, Statement code) {
-        super("<init>",modifiers,ClassHelper.VOID_TYPE,parameters,exceptions,code);
-        
-        // This variable scope is thrown out and replaced with a different one during semantic analysis.
-        VariableScope scope = new VariableScope();
-        for (int i = 0; i < parameters.length; i++) {
-            scope.putDeclaredVariable(parameters[i]);
-        }
-        this.setVariableScope(scope);
+        super("<init>", modifiers, ClassHelper.VOID_TYPE, parameters, exceptions, code);
     }
-    
+
     public boolean firstStatementIsSpecialConstructorCall() {
         Statement code = getFirstStatement();
         if (!(code instanceof ExpressionStatement)) return false;
diff --git a/src/main/java/org/codehaus/groovy/ast/MethodNode.java b/src/main/java/org/codehaus/groovy/ast/MethodNode.java
index 25e0aca..37e44ee 100644
--- a/src/main/java/org/codehaus/groovy/ast/MethodNode.java
+++ b/src/main/java/org/codehaus/groovy/ast/MethodNode.java
@@ -54,8 +54,6 @@ public class MethodNode extends AnnotatedNode implements Opcodes {
         this.modifiers = modifiers;
         this.code = code;
         setReturnType(returnType);
-        VariableScope scope = new VariableScope();
-        setVariableScope(scope);
         setParameters(parameters);
         this.hasDefault = false;
         this.exceptions = exceptions;