commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [commons-bcel] 02/02: Remove unnecessary array creation for varargs.
Date Wed, 18 Dec 2019 20:36:11 GMT
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git

commit db51c106bd7de0f70d1fd5512471ec0afd9148b3
Author: Gary Gregory <gardgregory@gmail.com>
AuthorDate: Wed Dec 18 15:36:05 2019 -0500

    Remove unnecessary array creation for varargs.
---
 src/main/java/org/apache/bcel/util/JavaWrapper.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/bcel/util/JavaWrapper.java b/src/main/java/org/apache/bcel/util/JavaWrapper.java
index cbe6d51..89dc474 100644
--- a/src/main/java/org/apache/bcel/util/JavaWrapper.java
+++ b/src/main/java/org/apache/bcel/util/JavaWrapper.java
@@ -72,9 +72,7 @@ public class JavaWrapper {
         final Class<?> cl = loader.loadClass(class_name);
         Method method = null;
         try {
-            method = cl.getMethod("main", new Class[] {
-                argv.getClass()
-            });
+            method = cl.getMethod("main", argv.getClass());
             /* Method main is sane ?
              */
             final int m = method.getModifiers();
@@ -89,9 +87,7 @@ public class JavaWrapper {
             return;
         }
         try {
-            method.invoke(null, new Object[] {
-                argv
-            });
+            method.invoke(null, argv);
         } catch (final Exception ex) {
             ex.printStackTrace();
         }


Mime
View raw message