jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1847984 - /jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellServer.java
Date Sun, 02 Dec 2018 11:25:42 GMT
Author: fschumacher
Date: Sun Dec  2 11:25:42 2018
New Revision: 1847984

URL: http://svn.apache.org/viewvc?rev=1847984&view=rev
Log:
With varargs there is no need for an extra array

Part of #435 and Bugzilla Id: 62972

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellServer.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellServer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellServer.java?rev=1847984&r1=1847983&r2=1847984&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellServer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellServer.java Sun Dec  2 11:25:42
2018
@@ -77,17 +77,17 @@ public class BeanShellServer implements
             Class<String> string = String.class;
             Class<Object> object = Object.class;
 
-            Method eval = interpreter.getMethod("eval", new Class[] { string });//$NON-NLS-1$
-            Method setObj = interpreter.getMethod("set", new Class[] { string, object });//$NON-NLS-1$
-            Method setInt = interpreter.getMethod("set", new Class[] { string, int.class
});//$NON-NLS-1$
-            Method source = interpreter.getMethod("source", new Class[] { string });//$NON-NLS-1$
+            Method eval = interpreter.getMethod("eval", string);//$NON-NLS-1$
+            Method setObj = interpreter.getMethod("set", string, object);//$NON-NLS-1$
+            Method setInt = interpreter.getMethod("set", string, int.class);//$NON-NLS-1$
+            Method source = interpreter.getMethod("source", string);//$NON-NLS-1$
 
-            setObj.invoke(instance, new Object[] { "t", this });//$NON-NLS-1$
-            setInt.invoke(instance, new Object[] { "portnum", Integer.valueOf(serverport)
});//$NON-NLS-1$
+            setObj.invoke(instance, "t", this );//$NON-NLS-1$
+            setInt.invoke(instance, "portnum", Integer.valueOf(serverport));//$NON-NLS-1$
 
             if (serverfile.length() > 0) {
                 try {
-                    source.invoke(instance, new Object[] { serverfile });
+                    source.invoke(instance, serverfile);
                 } catch (InvocationTargetException ite) {
                     Throwable cause = ite.getCause();
                     if (log.isWarnEnabled()) {
@@ -99,8 +99,8 @@ public class BeanShellServer implements
                     }
                 }
             }
-            eval.invoke(instance, new Object[] { "setAccessibility(true);" });//$NON-NLS-1$
-            eval.invoke(instance, new Object[] { "server(portnum);" });//$NON-NLS-1$
+            eval.invoke(instance, "setAccessibility(true);");//$NON-NLS-1$
+            eval.invoke(instance, "server(portnum);");//$NON-NLS-1$
 
         } catch (ClassNotFoundException e) {
             log.error("Beanshell Interpreter not found");



Mime
View raw message