Repository: groovy Updated Branches: refs/heads/GROOVY_2_4_X 0cfb0d91a -> af215f4e9
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/af215f4e Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/af215f4e Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/af215f4e Branch: refs/heads/GROOVY_2_4_X Commit: af215f4e98bdcf4820e5e29a12750d54309cbc81 Parents: 0cfb0d9 Author: sunlan <[email protected]> Authored: Thu Nov 23 22:21:53 2017 +0800 Committer: sunlan <[email protected]> Committed: Thu Nov 23 22:24:43 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/af215f4e/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) {
