You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/02/15 12:27:54 UTC

[groovy] branch master updated: Trivial refactoring: remove duplicated code

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new b0c0df7  Trivial refactoring: remove duplicated code
b0c0df7 is described below

commit b0c0df78d2f975f97e6a76a0d84cc31e8ddd10b3
Author: Daniel Sun <su...@apache.org>
AuthorDate: Mon Feb 15 20:27:24 2021 +0800

    Trivial refactoring: remove duplicated code
---
 .../org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
index ef9e7ad..59cb1ac 100644
--- a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
+++ b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
@@ -209,7 +209,7 @@ public class MetaClassRegistryImpl implements MetaClassRegistry{
                 for (GeneratedMetaMethod.DgmMethodRecord record : records) {
                     if (disabling && disabledNames.contains(record.methodName)) continue;
                     Class[] newParams = new Class[record.parameters.length - 1];
-                    System.arraycopy(record.parameters, 1, newParams, 0, record.parameters.length-1);
+                    System.arraycopy(record.parameters, 1, newParams, 0, newParams.length);
 
                     MetaMethod method = new GeneratedMetaMethod.Proxy(
                             record.className,