jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1847982 - in /jmeter/trunk/src/core/org/apache/jmeter: gui/util/MenuFactory.java testelement/property/MapProperty.java util/BeanShellServer.java
Date Sun, 02 Dec 2018 11:24:36 GMT
Author: fschumacher
Date: Sun Dec  2 11:24:36 2018
New Revision: 1847982

URL: http://svn.apache.org/viewvc?rev=1847982&view=rev
Log:
Replace calls to deprecated Class#newInstance method

Part of #435 and Bugzilla Id: 62972

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java
    jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MapProperty.java
    jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellServer.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java?rev=1847982&r1=1847981&r2=1847982&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java Sun Dec  2 11:24:36
2018
@@ -171,7 +171,7 @@ public final class MenuFactory {
                         || (testBeanGUI.isExpert() && !JMeterUtils.isExpertMode());
                 item = testBeanGUI;
             } else {
-                item = (JMeterGUIComponent) c.newInstance();
+                item = (JMeterGUIComponent) c.getDeclaredConstructor().newInstance();
             }
         } catch (NoClassDefFoundError e) {
             log.warn("Configuration error, probably corrupt or missing third party library(jar)?
Could not create class: {}.",

Modified: jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MapProperty.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MapProperty.java?rev=1847982&r1=1847981&r2=1847982&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MapProperty.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testelement/property/MapProperty.java Sun Dec
 2 11:24:36 2018
@@ -118,7 +118,7 @@ public class MapProperty extends MultiPr
     private Map<String, JMeterProperty> cloneMap() {
         try {
             @SuppressWarnings("unchecked") // value is the correct class
-            Map<String, JMeterProperty> newCol = value.getClass().newInstance();
+            Map<String, JMeterProperty> newCol = value.getClass().getDeclaredConstructor().newInstance();
             PropertyIterator iter = valueIterator();
             while (iter.hasNext()) {
                 JMeterProperty item = iter.next();

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=1847982&r1=1847981&r2=1847982&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:24:36
2018
@@ -73,7 +73,7 @@ public class BeanShellServer implements
 
         try {
             Class<?> interpreter = loader.loadClass("bsh.Interpreter");//$NON-NLS-1$
-            Object instance = interpreter.newInstance();
+            Object instance = interpreter.getDeclaredConstructor().newInstance();
             Class<String> string = String.class;
             Class<Object> object = Object.class;
 



Mime
View raw message