jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1847985 - in /jmeter/trunk/src/core/org/apache/jmeter: gui/util/PowerTableModel.java testbeans/gui/TableEditor.java
Date Sun, 02 Dec 2018 11:27:21 GMT
Author: fschumacher
Date: Sun Dec  2 11:27:21 2018
New Revision: 1847985

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

Part of #435 and Bugzilla Id: 62972

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/PowerTableModel.java
    jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TableEditor.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/PowerTableModel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/PowerTableModel.java?rev=1847985&r1=1847984&r2=1847985&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/util/PowerTableModel.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/PowerTableModel.java Sun Dec  2 11:27:21
2018
@@ -157,7 +157,7 @@ public class PowerTableModel extends Def
     private Object createDefaultValue(int i) { // CHECKSTYLE IGNORE ReturnCount
         Class<?> colClass = getColumnClass(i);
         try {
-            return colClass.newInstance();
+            return colClass.getDeclaredConstructor().newInstance();
         } catch (Exception e) {
             try {
                 Constructor<?> constr = colClass.getConstructor(new Class[] { String.class
});

Modified: jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TableEditor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TableEditor.java?rev=1847985&r1=1847984&r2=1847985&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TableEditor.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TableEditor.java Sun Dec  2 11:27:21
2018
@@ -298,7 +298,7 @@ public class TableEditor extends Propert
         @Override
         public void actionPerformed(ActionEvent e) {
             try {
-                model.addRow(clazz.newInstance());
+                model.addRow(clazz.getDeclaredConstructor().newInstance());
                 
                 removeButton.setEnabled(true);
                 clearButton.setEnabled(true);
@@ -321,7 +321,7 @@ public class TableEditor extends Propert
                 for (String clipboardLine : clipboardLines) {
                     String[] columns = clipboardLine.split("\t"); // $NON-NLS-1$
 
-                    model.addRow(clazz.newInstance());
+                    model.addRow(clazz.getDeclaredConstructor().newInstance());
                     
                     for (int i=0; i < columns.length; i++) {
                         model.setValueAt(columns[i], model.getRowCount() - 1, i);



Mime
View raw message