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:37:56 UTC

[groovy] branch GROOVY_2_4_X updated (c01a2f6 -> acd211e)

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

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


    from c01a2f6  GROOVY-8953: Imported enum causes compilation bug preventing tests from compiling (port to 2_4_X)
     new cdaa596  Change doc URL from beta to non-beta (closes #908)
     new e65c945  Remove extra "a"
     new acd211e  GROOVY-9078: Inefficiency in MethodNode and ConstructorNode

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:
 src/main/org/codehaus/groovy/ast/ConstructorNode.java | 18 ++++--------------
 src/main/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(+), 18 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 GROOVY_2_4_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit e65c945603e6c95c5cdcf3698159b75035ed4e9a
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 a4429e4..6e13812 100644
--- a/src/spec/doc/core-metaprogramming.adoc
+++ b/src/spec/doc/core-metaprogramming.adoc
@@ -97,7 +97,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] 01/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 GROOVY_2_4_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit cdaa596fd66a84fd5b04ac7cef9638a46ab11913
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 eea447d..30a36ef 100644
--- a/src/spec/doc/style-guide.adoc
+++ b/src/spec/doc/style-guide.adoc
@@ -477,7 +477,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] 03/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 GROOVY_2_4_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit acd211ef724ec8f53f4e17ac6c43b848504d80b0
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
---
 src/main/org/codehaus/groovy/ast/ConstructorNode.java | 18 ++++--------------
 src/main/org/codehaus/groovy/ast/MethodNode.java      |  2 --
 2 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/src/main/org/codehaus/groovy/ast/ConstructorNode.java b/src/main/org/codehaus/groovy/ast/ConstructorNode.java
index fe7a7da..15139f1 100644
--- a/src/main/org/codehaus/groovy/ast/ConstructorNode.java
+++ b/src/main/org/codehaus/groovy/ast/ConstructorNode.java
@@ -23,29 +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
- * 
- * @author <a href="mailto:james@coredevelopers.net">James Strachan</a>
  */
 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 == null || !(code instanceof ExpressionStatement)) return false;
diff --git a/src/main/org/codehaus/groovy/ast/MethodNode.java b/src/main/org/codehaus/groovy/ast/MethodNode.java
index 1c867c3..f219005 100644
--- a/src/main/org/codehaus/groovy/ast/MethodNode.java
+++ b/src/main/org/codehaus/groovy/ast/MethodNode.java
@@ -57,8 +57,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;