groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] branch master updated: Trivial refactoring: extract array constant
Date Tue, 13 Aug 2019 17:54:22 GMT
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 bf265e4  Trivial refactoring: extract array constant
bf265e4 is described below

commit bf265e4aaea56c85886e450a3949a2670c21463c
Author: Daniel Sun <sunlan@apache.org>
AuthorDate: Wed Aug 14 01:48:24 2019 +0800

    Trivial refactoring: extract array constant
---
 src/main/java/org/codehaus/groovy/runtime/ProxyGeneratorAdapter.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/runtime/ProxyGeneratorAdapter.java b/src/main/java/org/codehaus/groovy/runtime/ProxyGeneratorAdapter.java
index cd88448..d3ba083 100644
--- a/src/main/java/org/codehaus/groovy/runtime/ProxyGeneratorAdapter.java
+++ b/src/main/java/org/codehaus/groovy/runtime/ProxyGeneratorAdapter.java
@@ -90,12 +90,14 @@ public class ProxyGeneratorAdapter extends ClassVisitor implements Opcodes
{
 
     private static final String CLOSURES_MAP_FIELD = "$closures$delegate$map";
     private static final String DELEGATE_OBJECT_FIELD = "$delegate";
+
     private static List<Method> OBJECT_METHODS = getInheritedMethods(Object.class,
new ArrayList<Method>());
     private static List<Method> GROOVYOBJECT_METHODS = getInheritedMethods(GroovyObject.class,
new ArrayList<Method>());
 
     private static final AtomicLong pxyCounter = new AtomicLong();
     private static final Set<String> GROOVYOBJECT_METHOD_NAMESS;
     private static final Object[] EMPTY_ARGS = new Object[0];
+    private static final String[] EMPTY_STRING_ARRAY = new String[0];
 
     static {
         List<String> names = new ArrayList<String>();
@@ -341,7 +343,7 @@ public class ProxyGeneratorAdapter extends ClassVisitor implements Opcodes
{
             classList.add(GeneratedGroovyProxy.class);
             interfacesSet.add("groovy/lang/GeneratedGroovyProxy");
         }
-        super.visit(V1_5, ACC_PUBLIC, proxyName, signature, BytecodeHelper.getClassInternalName(superClass),
interfacesSet.toArray(new String[0]));
+        super.visit(V1_5, ACC_PUBLIC, proxyName, signature, BytecodeHelper.getClassInternalName(superClass),
interfacesSet.toArray(EMPTY_STRING_ARRAY));
         visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
         addDelegateFields();
         if (addGroovyObjectSupport) {


Mime
View raw message