groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Revert the change of invoking `toArray`
Date Thu, 23 Nov 2017 14:24:08 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X bbe1d061e -> 164ddd610


Revert the change of invoking `toArray`

(cherry picked from commit 05b5bf7)


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 164ddd610f38f589e64fc85e1fa50c17fdbf80e5
Parents: bbe1d06
Author: sunlan <sunlan@apache.org>
Authored: Thu Nov 23 22:21:53 2017 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Thu Nov 23 22:24:00 2017 +0800

----------------------------------------------------------------------
 src/main/groovy/util/ProxyGenerator.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/164ddd61/src/main/groovy/util/ProxyGenerator.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/util/ProxyGenerator.java b/src/main/groovy/util/ProxyGenerator.java
index fb73056..62e9c6c 100644
--- a/src/main/groovy/util/ProxyGenerator.java
+++ b/src/main/groovy/util/ProxyGenerator.java
@@ -50,8 +50,7 @@ import java.util.Set;
  * @author Cedric Champeau
  */
 public class ProxyGenerator {
-    private static final Class[] EMPTY_CLASS_ARRAY = new Class[0];
-    private static final Class[] EMPTY_INTERFACE_ARRAY = EMPTY_CLASS_ARRAY;
+    private static final Class[] EMPTY_INTERFACE_ARRAY = new Class[0];
     private static final Map<Object,Object> EMPTY_CLOSURE_MAP = Collections.emptyMap();
     private static final Set<String> EMPTY_KEYSET = Collections.emptySet();
 
@@ -209,7 +208,7 @@ public class ProxyGenerator {
     }
 
     private ProxyGeneratorAdapter createAdapter(Map closureMap, List<Class> interfaces,
Class delegateClass, Class baseClass) {
-        Class[] intfs = interfaces != null ? interfaces.toArray(EMPTY_CLASS_ARRAY) : EMPTY_INTERFACE_ARRAY;
+        Class[] intfs = interfaces != null ? interfaces.toArray(new Class[interfaces.size()])
: EMPTY_INTERFACE_ARRAY;
         Class base = baseClass;
         if (base == null) {
             if (intfs.length > 0) {


Mime
View raw message