Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 4526cc0d2 -> 5760c6604


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/5760c660
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/5760c660
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/5760c660

Branch: refs/heads/GROOVY_2_6_X
Commit: 5760c66044e198d6bde9e639808ac6d4c8b8a041
Parents: 4526cc0
Author: sunlan <[email protected]>
Authored: Thu Nov 23 22:21:53 2017 +0800
Committer: sunlan <[email protected]>
Committed: Thu Nov 23 22:22:26 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/5760c660/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) {

Reply via email to