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/12/11 06:43:06 UTC

[groovy] branch master updated: Inline temp variable and format 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 e0bb9cc  Inline temp variable and format code
e0bb9cc is described below

commit e0bb9cc77432a2afced196bc9915530904209681
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Dec 11 14:42:40 2021 +0800

    Inline temp variable and format code
---
 src/main/java/groovy/lang/Closure.java | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/main/java/groovy/lang/Closure.java b/src/main/java/groovy/lang/Closure.java
index 536598d..7d48cf8 100644
--- a/src/main/java/groovy/lang/Closure.java
+++ b/src/main/java/groovy/lang/Closure.java
@@ -207,7 +207,7 @@ public abstract class Closure<V> extends GroovyObjectSupport implements Cloneabl
     private Object thisObject;
     private int resolveStrategy = OWNER_FIRST;
     private int directive;
-    protected Class[] parameterTypes;
+    protected Class<?>[] parameterTypes;
     protected int maximumNumberOfParameters;
     private static final long serialVersionUID = 4368710879820278874L;
     private BooleanClosureWrapper bcw;
@@ -409,18 +409,17 @@ public abstract class Closure<V> extends GroovyObjectSupport implements Cloneabl
      */
     @Override
     public V call() {
-        final Object[] NOARGS = EMPTY_OBJECT_ARRAY;
-        return call(NOARGS);
+        return call(EMPTY_OBJECT_ARRAY);
     }
 
     @SuppressWarnings("unchecked")
     public V call(Object... args) {
         try {
-            return (V) getMetaClass().invokeMethod(this,"doCall",args);
+            return (V) getMetaClass().invokeMethod(this, "doCall", args);
         } catch (InvokerInvocationException e) {
             UncheckedThrow.rethrow(e.getCause());
             return null; // unreachable statement
-        }  catch (Exception e) {
+        } catch (Exception e) {
             return (V) throwRuntimeException(e);
         }
     }
@@ -472,7 +471,7 @@ public abstract class Closure<V> extends GroovyObjectSupport implements Cloneabl
      * @return the parameter types of the longest doCall method
      * of this closure
      */
-    public Class[] getParameterTypes() {
+    public Class<?>[] getParameterTypes() {
         return parameterTypes;
     }