Repository: groovy Updated Branches: refs/heads/master 93d9fe61d -> 05b5bf770
Revert the change of invoking `toArray` Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/05b5bf77 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/05b5bf77 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/05b5bf77 Branch: refs/heads/master Commit: 05b5bf770c5d60c8312bf6c563e0a3755bcc5f07 Parents: 93d9fe6 Author: sunlan <[email protected]> Authored: Thu Nov 23 22:21:53 2017 +0800 Committer: sunlan <[email protected]> Committed: Thu Nov 23 22:21:53 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/05b5bf77/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) {
