groovy git commit: add a rat exclude for gradle.properties since the artifactory release plugin loses header when bumping version

2016-05-31 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 3a5189e8d -> f3d031014


add a rat exclude for gradle.properties since the artifactory release plugin 
loses header when bumping version


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

Branch: refs/heads/GROOVY_2_4_X
Commit: f3d031014f2ad671271f3c5e5b274211c14784e3
Parents: 3a5189e
Author: paulk 
Authored: Tue May 31 18:56:43 2016 +1000
Committer: paulk 
Committed: Tue May 31 18:56:43 2016 +1000

--
 gradle/quality.gradle | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/f3d03101/gradle/quality.gradle
--
diff --git a/gradle/quality.gradle b/gradle/quality.gradle
index 9959b57..bc8e85e 100644
--- a/gradle/quality.gradle
+++ b/gradle/quality.gradle
@@ -170,6 +170,7 @@ rat {
  'src/test/org/codehaus/groovy/ast/LineColumnCheck.txt', // 
test file
  'security/groovykeys', // excluded from src zip
  '**/.gradle/**', '**/wrapper/**', 'gradlew*',  // gradle 
wrapper files excluded from src zip
+ 'gradle.properties',  // artifactory release plugin removes 
header when bumping version
  '**/target/**', 'licenses/**', 'notices/**',
  'out/**', '*.ipr',  '**/*.iml', '*.iws', // Intellij files
  '**/style.css', // MIT license as per NOTICE/LICENSE files



[2/2] groovy git commit: minor refactor

2016-05-31 Thread paulk
minor refactor


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

Branch: refs/heads/GROOVY_2_4_X
Commit: 036c14fa0ecc883ccc3b931aef40a666e374ed22
Parents: df63a38
Author: paulk 
Authored: Wed Jun 1 13:35:39 2016 +1000
Committer: paulk 
Committed: Wed Jun 1 13:47:09 2016 +1000

--
 src/main/org/codehaus/groovy/ast/ClassNode.java | 45 
 .../groovy/ast/tools/ClassNodeUtils.java| 41 ++
 .../groovy/ast/tools/ParameterUtils.java| 39 +
 .../classgen/ClassCompletionVerifier.java   |  3 +-
 .../groovy/classgen/ExtendedVerifier.java   | 19 +
 .../classgen/asm/OptimizingStatementWriter.java | 18 +---
 6 files changed, 103 insertions(+), 62 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/036c14fa/src/main/org/codehaus/groovy/ast/ClassNode.java
--
diff --git a/src/main/org/codehaus/groovy/ast/ClassNode.java 
b/src/main/org/codehaus/groovy/ast/ClassNode.java
index faf4570..6306f5f 100644
--- a/src/main/org/codehaus/groovy/ast/ClassNode.java
+++ b/src/main/org/codehaus/groovy/ast/ClassNode.java
@@ -24,9 +24,11 @@ import org.codehaus.groovy.ast.expr.Expression;
 import org.codehaus.groovy.ast.expr.FieldExpression;
 import org.codehaus.groovy.ast.expr.MapExpression;
 import org.codehaus.groovy.ast.expr.TupleExpression;
+import org.codehaus.groovy.ast.stmt.BlockStatement;
 import org.codehaus.groovy.ast.stmt.ExpressionStatement;
 import org.codehaus.groovy.ast.stmt.Statement;
-import org.codehaus.groovy.ast.stmt.BlockStatement;
+import org.codehaus.groovy.ast.tools.ClassNodeUtils;
+import org.codehaus.groovy.ast.tools.ParameterUtils;
 import org.codehaus.groovy.control.CompilePhase;
 import org.codehaus.groovy.transform.ASTTransformation;
 import org.codehaus.groovy.transform.GroovyASTTransformation;
@@ -34,8 +36,18 @@ import org.codehaus.groovy.vmplugin.VMPluginFactory;
 import org.objectweb.asm.Opcodes;
 
 import java.lang.reflect.Array;
-import java.lang.reflect.Constructor;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * Represents a class in the AST.
@@ -435,7 +447,7 @@ public class ClassNode extends AnnotatedNode implements 
Opcodes {
 } else {
 result = new HashMap();
 }
-addInterfaceMethods(result);
+ClassNodeUtils.addInterfaceMethods(this, result);
 
 // And add in the methods implemented in this class.
 for (MethodNode method : getMethods()) {
@@ -445,19 +457,6 @@ public class ClassNode extends AnnotatedNode implements 
Opcodes {
 return result;
 }
 
-public void addInterfaceMethods(Map methodsMap) {
-// add in unimplemented abstract methods from the interfaces
-for (ClassNode iface : getInterfaces()) {
-Map ifaceMethodsMap = 
iface.getDeclaredMethodsMap();
-for (String methSig : ifaceMethodsMap.keySet()) {
-if (!methodsMap.containsKey(methSig)) {
-MethodNode methNode = ifaceMethodsMap.get(methSig);
-methodsMap.put(methSig, methNode);
-}
-}
-}
-}
-
 public String getName() {
 return redirect().name;
 }
@@ -1039,17 +1038,7 @@ public class ClassNode extends AnnotatedNode implements 
Opcodes {
  * @return true if the two arrays are of the same size and have the same 
contents
  */
 protected boolean parametersEqual(Parameter[] a, Parameter[] b) {
-if (a.length == b.length) {
-boolean answer = true;
-for (int i = 0; i < a.length; i++) {
-if (!a[i].getType().equals(b[i].getType())) {
-answer = false;
-break;
-}
-}
-return answer;
-}
-return false;
+return ParameterUtils.parametersEqual(a, b);
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/036c14fa/src/main/org/codehaus/groovy/ast/tools/ClassNodeUtils.java
--
diff --git a/src/main/org/codehaus/groovy/ast/tools/ClassNodeUtils.java 

groovy git commit: minor refactor

2016-05-31 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/master 3d60dbd79 -> b57f46df4


minor refactor


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

Branch: refs/heads/master
Commit: b57f46df4783dbc841017cdf540d3c0e5f353767
Parents: 3d60dbd
Author: paulk 
Authored: Wed Jun 1 13:48:55 2016 +1000
Committer: paulk 
Committed: Wed Jun 1 13:48:55 2016 +1000

--
 src/main/org/codehaus/groovy/ast/ClassNode.java | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/b57f46df/src/main/org/codehaus/groovy/ast/ClassNode.java
--
diff --git a/src/main/org/codehaus/groovy/ast/ClassNode.java 
b/src/main/org/codehaus/groovy/ast/ClassNode.java
index 37ad787..a093dc1 100644
--- a/src/main/org/codehaus/groovy/ast/ClassNode.java
+++ b/src/main/org/codehaus/groovy/ast/ClassNode.java
@@ -32,7 +32,18 @@ import org.codehaus.groovy.vmplugin.VMPluginFactory;
 import org.objectweb.asm.Opcodes;
 
 import java.lang.reflect.Array;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * Represents a class in the AST.



[1/2] groovy git commit: GROOVY-7620: No error if abstract getter is not implemented but static field exists (closes #342)

2016-05-31 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/master 4738970c6 -> 3d60dbd79


GROOVY-7620: No error if abstract getter is not implemented but static field 
exists (closes #342)


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

Branch: refs/heads/master
Commit: 973197fdb5e27df579f5ae9b918d3fa13213f482
Parents: 4738970
Author: paulk 
Authored: Tue May 31 21:14:54 2016 +1000
Committer: paulk 
Committed: Wed Jun 1 13:20:06 2016 +1000

--
 src/main/org/codehaus/groovy/ast/ClassNode.java | 23 ---
 .../classgen/ClassCompletionVerifier.java   | 71 +++-
 src/test/groovy/bugs/Groovy7081Bug.groovy   |  2 +-
 src/test/groovy/bugs/Groovy7620Bug.groovy   | 59 
 4 files changed, 114 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/973197fd/src/main/org/codehaus/groovy/ast/ClassNode.java
--
diff --git a/src/main/org/codehaus/groovy/ast/ClassNode.java 
b/src/main/org/codehaus/groovy/ast/ClassNode.java
index 6601ac7..68ac22d 100644
--- a/src/main/org/codehaus/groovy/ast/ClassNode.java
+++ b/src/main/org/codehaus/groovy/ast/ClassNode.java
@@ -425,30 +425,33 @@ public class ClassNode extends AnnotatedNode implements 
Opcodes {
 public Map getDeclaredMethodsMap() {
 // Start off with the methods from the superclass.
 ClassNode parent = getSuperClass();
-Map result = null;
+Map result;
 if (parent != null) {
 result = parent.getDeclaredMethodsMap();
 } else {
 result = new HashMap();
 }
+addInterfaceMethods(result);
 
+// And add in the methods implemented in this class.
+for (MethodNode method : getMethods()) {
+String sig = method.getTypeDescriptor();
+result.put(sig, method);
+}
+return result;
+}
+
+public void addInterfaceMethods(Map methodsMap) {
 // add in unimplemented abstract methods from the interfaces
 for (ClassNode iface : getInterfaces()) {
 Map ifaceMethodsMap = 
iface.getDeclaredMethodsMap();
 for (String methSig : ifaceMethodsMap.keySet()) {
-if (!result.containsKey(methSig)) {
+if (!methodsMap.containsKey(methSig)) {
 MethodNode methNode = ifaceMethodsMap.get(methSig);
-result.put(methSig, methNode);
+methodsMap.put(methSig, methNode);
 }
 }
 }
-
-// And add in the methods implemented in this class.
-for (MethodNode method : getMethods()) {
-String sig = method.getTypeDescriptor();
-result.put(sig, method);
-}
-return result;
 }
 
 public String getName() {

http://git-wip-us.apache.org/repos/asf/groovy/blob/973197fd/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java
--
diff --git a/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java 
b/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java
index 47e3175..c29c705 100644
--- a/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java
+++ b/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java
@@ -84,33 +84,48 @@ public class ClassCompletionVerifier extends 
ClassCodeVisitorSupport {
 }
 
 private void checkNoStaticMethodWithSameSignatureAsNonStatic(final 
ClassNode node) {
-Map result = new HashMap();
-// add in unimplemented abstract methods from the interfaces
-for (ClassNode iface : node.getInterfaces()) {
-Map ifaceMethodsMap = 
iface.getDeclaredMethodsMap();
-for (String methSig : ifaceMethodsMap.keySet()) {
-if (!result.containsKey(methSig)) {
-MethodNode methNode = ifaceMethodsMap.get(methSig);
-result.put(methSig, methNode);
-}
-}
+ClassNode parent = node.getSuperClass();
+Map result;
+// start with methods from the parent if any
+if (parent != null) {
+result = parent.getDeclaredMethodsMap();
+} else {
+result = new HashMap();
 }
+// add in unimplemented abstract 

[1/2] groovy git commit: GROOVY-7620: No error if abstract getter is not implemented but static field exists (closes #342)

2016-05-31 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X f3d031014 -> 036c14fa0


GROOVY-7620: No error if abstract getter is not implemented but static field 
exists (closes #342)


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

Branch: refs/heads/GROOVY_2_4_X
Commit: df63a38da748fc82d2c703059ca6af3c4dcfb36c
Parents: f3d0310
Author: paulk 
Authored: Tue May 31 21:14:54 2016 +1000
Committer: paulk 
Committed: Wed Jun 1 13:44:15 2016 +1000

--
 src/main/org/codehaus/groovy/ast/ClassNode.java | 23 ---
 .../classgen/ClassCompletionVerifier.java   | 71 +++-
 src/test/groovy/bugs/Groovy7081Bug.groovy   |  2 +-
 src/test/groovy/bugs/Groovy7620Bug.groovy   | 59 
 4 files changed, 114 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/df63a38d/src/main/org/codehaus/groovy/ast/ClassNode.java
--
diff --git a/src/main/org/codehaus/groovy/ast/ClassNode.java 
b/src/main/org/codehaus/groovy/ast/ClassNode.java
index c011241..faf4570 100644
--- a/src/main/org/codehaus/groovy/ast/ClassNode.java
+++ b/src/main/org/codehaus/groovy/ast/ClassNode.java
@@ -429,30 +429,33 @@ public class ClassNode extends AnnotatedNode implements 
Opcodes {
 public Map getDeclaredMethodsMap() {
 // Start off with the methods from the superclass.
 ClassNode parent = getSuperClass();
-Map result = null;
+Map result;
 if (parent != null) {
 result = parent.getDeclaredMethodsMap();
 } else {
 result = new HashMap();
 }
+addInterfaceMethods(result);
 
+// And add in the methods implemented in this class.
+for (MethodNode method : getMethods()) {
+String sig = method.getTypeDescriptor();
+result.put(sig, method);
+}
+return result;
+}
+
+public void addInterfaceMethods(Map methodsMap) {
 // add in unimplemented abstract methods from the interfaces
 for (ClassNode iface : getInterfaces()) {
 Map ifaceMethodsMap = 
iface.getDeclaredMethodsMap();
 for (String methSig : ifaceMethodsMap.keySet()) {
-if (!result.containsKey(methSig)) {
+if (!methodsMap.containsKey(methSig)) {
 MethodNode methNode = ifaceMethodsMap.get(methSig);
-result.put(methSig, methNode);
+methodsMap.put(methSig, methNode);
 }
 }
 }
-
-// And add in the methods implemented in this class.
-for (MethodNode method : getMethods()) {
-String sig = method.getTypeDescriptor();
-result.put(sig, method);
-}
-return result;
 }
 
 public String getName() {

http://git-wip-us.apache.org/repos/asf/groovy/blob/df63a38d/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java
--
diff --git a/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java 
b/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java
index 47e3175..c29c705 100644
--- a/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java
+++ b/src/main/org/codehaus/groovy/classgen/ClassCompletionVerifier.java
@@ -84,33 +84,48 @@ public class ClassCompletionVerifier extends 
ClassCodeVisitorSupport {
 }
 
 private void checkNoStaticMethodWithSameSignatureAsNonStatic(final 
ClassNode node) {
-Map result = new HashMap();
-// add in unimplemented abstract methods from the interfaces
-for (ClassNode iface : node.getInterfaces()) {
-Map ifaceMethodsMap = 
iface.getDeclaredMethodsMap();
-for (String methSig : ifaceMethodsMap.keySet()) {
-if (!result.containsKey(methSig)) {
-MethodNode methNode = ifaceMethodsMap.get(methSig);
-result.put(methSig, methNode);
-}
-}
+ClassNode parent = node.getSuperClass();
+Map result;
+// start with methods from the parent if any
+if (parent != null) {
+result = parent.getDeclaredMethodsMap();
+} else {
+result = new HashMap();
 }
+// add in unimplemented