jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1847989 - in /jmeter/trunk/src: components/org/apache/jmeter/visualizers/backend/influxdb/ core/org/apache/jmeter/gui/util/ core/org/apache/jmeter/save/ core/org/apache/jmeter/testbeans/gui/ core/org/apache/jmeter/threads/
Date Sun, 02 Dec 2018 11:34:39 GMT
Author: fschumacher
Date: Sun Dec  2 11:34:38 2018
New Revision: 1847989

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

Part of #435 and Bugzilla Id: 62972

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/influxdb/InfluxdbBackendListenerClient.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java
    jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java
    jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java
    jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java
    jmeter/trunk/src/core/org/apache/jmeter/threads/RemoteThreadsListenerImpl.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/influxdb/InfluxdbBackendListenerClient.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/influxdb/InfluxdbBackendListenerClient.java?rev=1847989&r1=1847988&r2=1847989&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/influxdb/InfluxdbBackendListenerClient.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/influxdb/InfluxdbBackendListenerClient.java
Sun Dec  2 11:34:38 2018
@@ -365,7 +365,7 @@ public class InfluxdbBackendListenerClie
         userTag = userTagBuilder.toString();
 
         Class<?> clazz = Class.forName(influxdbMetricsSender);
-        this.influxdbMetricsManager = (InfluxdbMetricsSender) clazz.newInstance();
+        this.influxdbMetricsManager = (InfluxdbMetricsSender) clazz.getDeclaredConstructor().newInstance();
         influxdbMetricsManager.setup(influxdbUrl);
         samplersToFilter = Pattern.compile(samplersRegex);
         addAnnotation(true);

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java?rev=1847989&r1=1847988&r2=1847989&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java Sun Dec  2 11:34:38
2018
@@ -222,7 +222,7 @@ public class JMeterMenuBar extends JMenu
                     Class<?> commandClass = Class.forName(strClassName);
                     if (!Modifier.isAbstract(commandClass.getModifiers())) {
                         log.debug("Instantiating: {}", commandClass);
-                        MenuCreator creator = (MenuCreator) commandClass.newInstance();
+                        MenuCreator creator = (MenuCreator) commandClass.getDeclaredConstructor().newInstance();
                         creators.add(creator);
                     }
                 } catch (Exception e) {

Modified: jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java?rev=1847989&r1=1847988&r2=1847989&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java Sun Dec  2 11:34:38 2018
@@ -284,7 +284,7 @@ public class SaveService {
         if (useMapper){
             jmxsaver.registerConverter((Converter) Class.forName(key).getConstructor(Mapper.class).newInstance(jmxsaver.getMapper()));
         } else {
-            jmxsaver.registerConverter((Converter) Class.forName(key).newInstance());
+            jmxsaver.registerConverter((Converter) Class.forName(key).getDeclaredConstructor().newInstance());
         }
     }
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java?rev=1847989&r1=1847988&r2=1847989&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java Sun
Dec  2 11:34:38 2018
@@ -243,8 +243,8 @@ public class GenericTestBeanCustomizer e
 
                 if (editorClass != null) {
                     try {
-                        propertyEditor = (PropertyEditor) editorClass.newInstance();
-                    } catch (InstantiationException | IllegalAccessException e) {
+                        propertyEditor = (PropertyEditor) editorClass.getDeclaredConstructor().newInstance();
+                    } catch (ReflectiveOperationException e) {
                         log.error("Can't create property editor.", e);
                         throw new Error(e.toString());
                     }

Modified: jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java?rev=1847989&r1=1847988&r2=1847989&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java Sun Dec  2 11:34:38
2018
@@ -174,8 +174,8 @@ public class TestBeanGUI extends Abstrac
 
     private Customizer createCustomizer() {
         try {
-            return (Customizer) customizerClass.newInstance();
-        } catch (InstantiationException | IllegalAccessException e) {
+            return (Customizer) customizerClass.getDeclaredConstructor().newInstance();
+        } catch (ReflectiveOperationException e) {
             log.error("Could not instantiate customizer of {}", customizerClass, e);
             throw new Error(e.toString());
         }
@@ -198,7 +198,7 @@ public class TestBeanGUI extends Abstrac
    @Override
     public TestElement createTestElement() {
         try {
-            TestElement element = (TestElement) testBeanClass.newInstance();
+            TestElement element = (TestElement) testBeanClass.getDeclaredConstructor().newInstance();
             // In other GUI component, clearGUI resets the value to defaults one as there
is one GUI per Element
             // With TestBeanGUI as it's shared, its default values are only known here, we
must call setValues with 
             // element (as it holds default values)
@@ -209,7 +209,7 @@ public class TestBeanGUI extends Abstrac
             // put the default values back into the new element
             modifyTestElement(element);
             return element;
-        } catch (InstantiationException | IllegalAccessException e) {
+        } catch (ReflectiveOperationException e) {
             log.error("Can't create test element", e);
             throw new Error(e); // Programming error. Don't continue.
         }

Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/RemoteThreadsListenerImpl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/RemoteThreadsListenerImpl.java?rev=1847989&r1=1847988&r2=1847989&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/RemoteThreadsListenerImpl.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/RemoteThreadsListenerImpl.java Sun Dec
 2 11:34:38 2018
@@ -67,7 +67,7 @@ public class RemoteThreadsListenerImpl e
                     Class<?> commandClass = Class.forName(strClassName);
                     if (!Modifier.isAbstract(commandClass.getModifiers())) {
                         log.debug("Instantiating: {}", commandClass);
-                        RemoteThreadsLifeCycleListener listener = (RemoteThreadsLifeCycleListener)
commandClass.newInstance();
+                        RemoteThreadsLifeCycleListener listener = (RemoteThreadsLifeCycleListener)
commandClass.getDeclaredConstructor().newInstance();
                         listeners.add(listener);
                     }
                 } catch (Exception e) {



Mime
View raw message