db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1745932 [2/2] - in /db/derby/code/trunk/java: build/org/apache/derbyBuild/ client/org/apache/derby/client/ client/org/apache/derby/client/am/ client/org/apache/derby/jdbc/ demo/nserverdemo/ demo/toursdb/ drda/org/apache/derby/impl/drda/ en...
Date Sat, 28 May 2016 20:22:42 GMT
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourceSerializationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourceSerializationTest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourceSerializationTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourceSerializationTest.java Sat May 28 20:22:41 2016
@@ -306,8 +306,8 @@ public class DataSourceSerializationTest
                     "getFactoryClassName", null);
             String factoryClassName =
                     (String)getFactoryClassName.invoke(dsRef, null);
-            Object factory =
-                    Class.forName(factoryClassName).newInstance();
+            Class<?> clazz = Class.forName(factoryClassName);
+            Object factory = clazz.getConstructor().newInstance();
             Method getObjectInstance =
                     factory.getClass().getMethod("getObjectInstance",
                     new Class[] {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourceTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourceTest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourceTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourceTest.java Sat May 28 20:22:41 2016
@@ -251,14 +251,15 @@ public class DataSourceTest extends Base
         
         ClientDataSourceInterface ds = null;
 
+        Class<?> clazz;
+
         if (JDBC.vmSupportsJNDI()) {
             // Use reflection to avoid class not found in non-JNDI context
-            ds = (ClientDataSourceInterface)Class.forName(
-                    "org.apache.derby.jdbc.ClientDataSource").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface)clazz.getConstructor().newInstance();
         } else {
-            ds = (ClientDataSourceInterface)Class.forName(
-                    "org.apache.derby.jdbc.BasicClientDataSource40").
-                    newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientDataSource40");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         ds.setPortNumber(TestConfiguration.getCurrent().getPort());
@@ -303,8 +304,10 @@ public class DataSourceTest extends Base
         JDBCClient dsclient = getTestConfiguration().getJDBCClient();
         String dsName = dsclient.getDataSourceClassName();
         DataSource ds = null;
+        Class<?> clazz;
         try {
-            ds = (javax.sql.DataSource) Class.forName(dsName).newInstance();
+            clazz = Class.forName(dsName);
+            ds = (javax.sql.DataSource) clazz.getConstructor().newInstance();
         } catch (Exception e) {
             fail("unable to complete test because unable to create new instance of datasource");
         }
@@ -423,13 +426,14 @@ public class DataSourceTest extends Base
         // DataSource - retrieveMessageTextProperty
         ClientDataSourceInterface ds = null;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
             // Use reflection to avoid class not found in non-JNDI context
-            ds = (ClientDataSourceInterface)Class.forName(
-              "org.apache.derby.jdbc.ClientDataSource").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            ds = (ClientDataSourceInterface)Class.forName(
-              "org.apache.derby.jdbc.BasicClientDataSource40").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientDataSource40");
+            ds = (ClientDataSourceInterface)clazz.getConstructor().newInstance();
         }
 
         ds.setPortNumber(TestConfiguration.getCurrent().getPort());

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DriverTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DriverTest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DriverTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DriverTest.java Sat May 28 20:22:41 2016
@@ -540,7 +540,8 @@ public class DriverTest extends BaseJDBC
         String driverClass =
             TestConfiguration.getCurrent().getJDBCClient().getJDBCDriverName();
         try {
-            Class.forName(driverClass).newInstance();
+            Class<?> clazz = Class.forName(driverClass);
+            clazz.getConstructor().newInstance();
         } catch (Exception e) {
             fail ("could not instantiate driver");
         }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java Sat May 28 20:22:41 2016
@@ -144,7 +144,8 @@ public class InternationalConnectTest ex
             println("Loading JDBC driver " + driverClass);
             // load the driver
             try {
-                Class.forName(driverClass).newInstance();
+                Class<?> clazz = Class.forName(driverClass);
+                clazz.getConstructor().newInstance();
             } catch (ClassNotFoundException cnfe) {
                 throw new SQLException("Failed to load JDBC driver '" 
                         + driverClass + "', ClassNotFoundException: " 
@@ -157,6 +158,14 @@ public class InternationalConnectTest ex
                 throw new SQLException("Failed to load JDBC driver '" 
                         + driverClass + "', InstantiationException: " 
                         + ie.getMessage());
+            } catch (NoSuchMethodException ie) {
+                throw new SQLException("Failed to load JDBC driver '" 
+                        + driverClass + "', InstantiationException: " 
+                        + ie.getMessage());
+            } catch (java.lang.reflect.InvocationTargetException ie) {
+                throw new SQLException("Failed to load JDBC driver '" 
+                        + driverClass + "', InstantiationException: " 
+                        + ie.getMessage());
             }
         }
     }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/J2EEDataSourceTest.java Sat May 28 20:22:41 2016
@@ -25,6 +25,7 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
 import java.io.Serializable;
+import java.lang.reflect.InvocationTargetException;
 import java.sql.CallableStatement;
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
@@ -655,7 +656,8 @@ public class J2EEDataSourceTest extends
         aes12.resetState();
         if (usingEmbedded())
         {
-            Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
+            Class<?> clazz = Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+            clazz.getConstructor().newInstance();
         }else
         {
         	getTestConfiguration().startNetworkServer();
@@ -2710,21 +2712,22 @@ public class J2EEDataSourceTest extends
      */
     public void testClientDSConnectionAttributes()
             throws SQLException, ClassNotFoundException,
-            IllegalAccessException, InstantiationException {
+                   IllegalAccessException, InstantiationException,
+                   NoSuchMethodException, InvocationTargetException
+    {
         if (usingEmbedded())
             return;
 
         // now with ConnectionPoolDataSource
         ClientConnectionPoolDataSourceInterface cpds;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
-            cpds = (ClientConnectionPoolDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.ClientConnectionPoolDataSource").
-                    newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientConnectionPoolDataSource");
+            cpds = (ClientConnectionPoolDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            cpds = (ClientConnectionPoolDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.BasicClientConnectionPoolDataSource40").
-                    newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientConnectionPoolDataSource40");
+            cpds = (ClientConnectionPoolDataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         cpds.setPortNumber(TestConfiguration.getCurrent().getPort());
@@ -2760,13 +2763,11 @@ public class J2EEDataSourceTest extends
         ClientXADataSourceInterface xads;
         
         if (JDBC.vmSupportsJNDI()) {
-            xads = (ClientXADataSourceInterface)Class.forName(
-                "org.apache.derby.jdbc.ClientXADataSource").
-                    newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientXADataSource");
+            xads = (ClientXADataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            xads = (ClientXADataSourceInterface)Class.forName(
-                "org.apache.derby.jdbc.BasicClientXADataSource40").
-                    newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientXADataSource40");
+            xads = (ClientXADataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         xads.setPortNumber(TestConfiguration.getCurrent().getPort());
@@ -2812,7 +2813,8 @@ public class J2EEDataSourceTest extends
         
         JDBCClient dsclient = getTestConfiguration().getJDBCClient();
         String dsName = dsclient.getDataSourceClassName();
-        DataSource ds = (DataSource) Class.forName(dsName).newInstance();
+        Class<?> clazz = Class.forName(dsName);
+        DataSource ds = (DataSource) clazz.getConstructor().newInstance();
 
         // DataSource - attributesAsPassword=true");
         JDBCDataSource.setBeanProperty(ds, "attributesAsPassword", Boolean.TRUE);
@@ -2875,8 +2877,8 @@ public class J2EEDataSourceTest extends
 
         // now with ConnectionPoolDataSource
         String cpdsName = dsclient.getConnectionPoolDataSourceClassName();
-        ConnectionPoolDataSource cpds =
-              (ConnectionPoolDataSource) Class.forName(cpdsName).newInstance();
+        clazz = Class.forName(cpdsName);
+        ConnectionPoolDataSource cpds =(ConnectionPoolDataSource) clazz.getConstructor().newInstance();
 
         // ConnectionPoolDataSource - EMPTY
         dsCPConnectionRequests(new String[] {
@@ -2920,8 +2922,9 @@ public class J2EEDataSourceTest extends
         // now with XADataSource
 //        EmbeddedXADataSource xads = new EmbeddedXADataSource();
         String xadsName = dsclient.getXADataSourceClassName();
+        clazz = Class.forName(xadsName);
         XADataSource xads =
-                (XADataSource) Class.forName(xadsName).newInstance();
+            (XADataSource) clazz.getConstructor().newInstance();
 
         // XADataSource - EMPTY
         dsXAConnectionRequests(new String[] {
@@ -3045,21 +3048,20 @@ public class J2EEDataSourceTest extends
      */
     public void testClientMessageTextConnectionAttribute()
             throws SQLException, ClassNotFoundException, IllegalAccessException,
-            InstantiationException
+                   InstantiationException, NoSuchMethodException, InvocationTargetException
     {
         String retrieveMessageTextProperty = "retrieveMessageText";
         // with ConnectionPoolDataSource
         // ConnectionPoolDataSource - retrieveMessageTextProperty
         ClientConnectionPoolDataSourceInterface cpds;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
-            cpds = (ClientConnectionPoolDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.ClientConnectionPoolDataSource").
-                    newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientConnectionPoolDataSource");
+            cpds = (ClientConnectionPoolDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            cpds = (ClientConnectionPoolDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.BasicClientConnectionPoolDataSource40").
-                    newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientConnectionPoolDataSource40");
+            cpds = (ClientConnectionPoolDataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         cpds.setPortNumber(TestConfiguration.getCurrent().getPort());
@@ -3080,13 +3082,11 @@ public class J2EEDataSourceTest extends
         // now with XADataSource
         ClientXADataSourceInterface xads;
         if (JDBC.vmSupportsJNDI()) {
-            xads = (ClientXADataSourceInterface)Class.forName(
-                "org.apache.derby.jdbc.ClientXADataSource").
-                    newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientXADataSource");
+            xads = (ClientXADataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            xads = (ClientXADataSourceInterface)Class.forName(
-                "org.apache.derby.jdbc.BasicClientXADataSource40").
-                    newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientXADataSource40");
+            xads = (ClientXADataSourceInterface) clazz.getConstructor().newInstance();
         }
         //XADataSource - retrieveMessageTextProperty
         xads.setPortNumber(TestConfiguration.getCurrent().getPort());

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ConcurrentImplicitCreateSchema.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ConcurrentImplicitCreateSchema.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ConcurrentImplicitCreateSchema.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ConcurrentImplicitCreateSchema.java Sat May 28 20:22:41 2016
@@ -56,7 +56,8 @@ public class ConcurrentImplicitCreateSch
         CreateTable(int id, int schemaId, 
                     ConcurrentImplicitCreateSchema test) 
             throws SQLException, IllegalAccessException, 
-                   ClassNotFoundException, InstantiationException
+                   ClassNotFoundException, InstantiationException, NoSuchMethodException,
+                   java.lang.reflect.InvocationTargetException
         {
             this.myId = id;
             this.schemaId = schemaId;

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GetPropertyInfoTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GetPropertyInfoTest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GetPropertyInfoTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GetPropertyInfoTest.java Sat May 28 20:22:41 2016
@@ -51,7 +51,8 @@ public class GetPropertyInfoTest
 		try
 		{
 			Properties info = new Properties();
-			Class.forName(driver).newInstance();
+            Class<?> clazz = Class.forName(driver);
+			clazz.getConstructor().newInstance();
 			Driver cDriver = DriverManager.getDriver(protocol);
 			boolean canConnect = false;
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/outparams30.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/outparams30.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/outparams30.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/outparams30.java Sat May 28 20:22:41 2016
@@ -22,6 +22,7 @@ limitations under the License.
 package org.apache.derbyTesting.functionTests.tests.lang;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 
 /**
  * outparams30 contains java procedures using java.math.BigDecimal.
@@ -37,7 +38,7 @@ public class outparams30 extends outpara
 	public static void takesBigDecimal(BigDecimal[] outparam, int type)
 	{
 		outparam[0] = (outparam[0] == null ? new BigDecimal("33") : outparam[0].add(outparam[0]));
-		outparam[0].setScale(4, BigDecimal.ROUND_DOWN);
+		outparam[0].setScale(4, RoundingMode.DOWN);
 	}
 	
 	public static BigDecimal returnsBigDecimal(int type)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ConnectionHandlingJunit.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ConnectionHandlingJunit.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ConnectionHandlingJunit.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ConnectionHandlingJunit.java Sat May 28 20:22:41 2016
@@ -266,7 +266,8 @@ public class ConnectionHandlingJunit ext
             println("Loading JDBC driver " + driverClass);
             // load the driver
             try {
-                Class.forName(driverClass).newInstance();
+                Class<?> clazz = Class.forName(driverClass);
+                clazz.getConstructor().newInstance();
             } catch (ClassNotFoundException cnfe) {
                 throw new SQLException("Failed to load JDBC driver '" 
                         + driverClass + "', ClassNotFoundException: " 
@@ -279,6 +280,14 @@ public class ConnectionHandlingJunit ext
                 throw new SQLException("Failed to load JDBC driver '" 
                         + driverClass + "', InstantiationException: " 
                         + ie.getMessage());
+            } catch (NoSuchMethodException ie) {
+                throw new SQLException("Missing constructor for JDBC driver '" 
+                        + driverClass + "', NoSuchMethodException: " 
+                        + ie.getMessage());
+            } catch (java.lang.reflect.InvocationTargetException ie) {
+                throw new SQLException("Could not invoke the constructor for JDBC driver '" 
+                        + driverClass + "', InvocationTargetException: " 
+                        + ie.getMessage());
             }
         }
     }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java Sat May 28 20:22:41 2016
@@ -23,6 +23,7 @@ package org.apache.derbyTesting.function
 
 import org.apache.derbyTesting.functionTests.util.PrivilegedFileOpsForTests;
 import org.apache.derby.drda.NetworkServerControl;
+import java.lang.reflect.InvocationTargetException;
 import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -2778,7 +2779,7 @@ test.postStoppedSlaveServer.return=true
             String dbPath,
             int _noTuplesToInsert)
         throws SQLException, ClassNotFoundException, IllegalAccessException,
-            InstantiationException
+               InstantiationException, NoSuchMethodException, InvocationTargetException
     {
         util.DEBUG("_testInsertUpdateDeleteOnMaster: " + serverHost + ":" +
                    serverPort + "/" + dbPath + " " + _noTuplesToInsert);
@@ -2808,7 +2809,7 @@ test.postStoppedSlaveServer.return=true
             String dbPath,
             int _noTuplesInserted)
         throws SQLException, ClassNotFoundException, IllegalAccessException,
-               InstantiationException
+               InstantiationException, NoSuchMethodException, InvocationTargetException
     {
         util.DEBUG("_verifyDatabase: "+serverHost+":"+serverPort+"/"+dbPath);
         ClientDataSourceInterface ds = configureDataSource(
@@ -3037,18 +3038,17 @@ test.postStoppedSlaveServer.return=true
          int        serverPort,
          String     connectionAttributes
          ) throws ClassNotFoundException, IllegalAccessException,
-             InstantiationException
+                  InstantiationException, NoSuchMethodException, InvocationTargetException
     {
         ClientDataSourceInterface ds;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
-            ds = (ClientDataSourceInterface)Class.forName(
-                "org.apache.derby.jdbc.ClientDataSource").
-                    newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            ds = (ClientDataSourceInterface)Class.forName(
-                "org.apache.derby.jdbc.BasicClientDataSource40").
-                    newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientDataSource40");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         ds.setDatabaseName( dbName );

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_1Indexing.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_1Indexing.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_1Indexing.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_1Indexing.java Sat May 28 20:22:41 2016
@@ -127,12 +127,13 @@ public class ReplicationRun_Local_1Index
     {
         ClientDataSourceInterface ds;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.ClientDataSource").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.BasicClientDataSource40").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientDataSource40");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         ds.setDatabaseName(dbPath);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3.java Sat May 28 20:22:41 2016
@@ -63,12 +63,13 @@ public class ReplicationRun_Local_3 exte
         util.DEBUG("BEGIN _failOver"); 
         ClientDataSourceInterface ds;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.ClientDataSource").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            ds =  (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.BasicClientDataSource40").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientDataSource40");
+            ds =  (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         ds.setDatabaseName(dbPath);
@@ -96,12 +97,13 @@ public class ReplicationRun_Local_3 exte
         util.DEBUG("_startSlaveTrueAndCreateTrue");
         ClientDataSourceInterface ds;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.ClientDataSource").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.BasicClientDataSource40").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientDataSource40");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         ds.setDatabaseName(dbPath);
@@ -124,12 +126,13 @@ public class ReplicationRun_Local_3 exte
         util.DEBUG("_stopMaster");
         ClientDataSourceInterface ds;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.ClientDataSource").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.BasicClientDataSource40").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientDataSource40");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         ds.setDatabaseName(dbPath);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3_p3.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3_p3.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3_p3.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3_p3.java Sat May 28 20:22:41 2016
@@ -196,13 +196,13 @@ public class ReplicationRun_Local_3_p3 e
                     slaveDatabasePath + FS + slaveDbSubPath + FS + replicatedDb;
                 ClientDataSourceInterface ds;
 
+                Class<?> clazz;
                 if (JDBC.vmSupportsJNDI()) {
-                    ds = (ClientDataSourceInterface)Class.forName(
-                        "org.apache.derby.jdbc.ClientDataSource").newInstance();
+                    clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+                    ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
                 } else {
-                    ds = (ClientDataSourceInterface)Class.forName(
-                        "org.apache.derby.jdbc.BasicClientDataSource40").
-                            newInstance();
+                    clazz = Class.forName("org.apache.derby.jdbc.BasicClientDataSource40");
+                    ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
                 }
 
                 ds.setDatabaseName(connectionURL);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3_p4.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3_p4.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3_p4.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3_p4.java Sat May 28 20:22:41 2016
@@ -179,12 +179,13 @@ public class ReplicationRun_Local_3_p4 e
         util.DEBUG("_connectToSlave");
         ClientDataSourceInterface ds;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.ClientDataSource").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.BasicClientDataSource40").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientDataSource40");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         ds.setDatabaseName(dbPath);
@@ -207,12 +208,13 @@ public class ReplicationRun_Local_3_p4 e
         util.DEBUG("_internal_stopSlave");
         ClientDataSourceInterface ds;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.ClientDataSource").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.BasicClientDataSource40").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientDataSource40");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         ds.setDatabaseName(dbPath);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3_p6.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3_p6.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3_p6.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_3_p6.java Sat May 28 20:22:41 2016
@@ -226,12 +226,13 @@ public class ReplicationRun_Local_3_p6 e
     {
         ClientDataSourceInterface ds;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.ClientDataSource").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.BasicClientDataSource40").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientDataSource40");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         ds.setDatabaseName(databasePath +FS+ dbSubPath +FS+ dbName);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_Encrypted_1.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_Encrypted_1.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_Encrypted_1.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun_Local_Encrypted_1.java Sat May 28 20:22:41 2016
@@ -225,12 +225,13 @@ public class ReplicationRun_Local_Encryp
         util.DEBUG("_connectToSlave");
         ClientDataSourceInterface ds;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.ClientDataSource").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
-            ds = (ClientDataSourceInterface)Class.forName(
-               "org.apache.derby.jdbc.BasicClientDataSource40").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.BasicClientDataSource40");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         }
 
         ds.setDatabaseName(dbPath);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/SimplePerfTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/SimplePerfTest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/SimplePerfTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/SimplePerfTest.java Sat May 28 20:22:41 2016
@@ -22,6 +22,7 @@ limitations under the License.
 package org.apache.derbyTesting.functionTests.tests.replicationTests;
 
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
@@ -83,7 +84,8 @@ public class SimplePerfTest extends Base
      */
     public void testInserts()
     throws SQLException, IOException, InterruptedException,
-        ClassNotFoundException, IllegalAccessException, InstantiationException
+           ClassNotFoundException, IllegalAccessException, InstantiationException,
+           NoSuchMethodException, InvocationTargetException
     {        
         String vc = "";
         for ( int i=0;i<20000;i++ )
@@ -128,7 +130,7 @@ public class SimplePerfTest extends Base
     public void verifyTestInserts()
         throws SQLException, IOException, InterruptedException,
             ClassNotFoundException, IllegalAccessException,
-            InstantiationException
+               InstantiationException, NoSuchMethodException, InvocationTargetException
     {
         Connection conn = clientConnection(masterHostName, masterPortNo, dbPath);
         
@@ -141,13 +143,14 @@ public class SimplePerfTest extends Base
     }
     private Connection clientConnection(String hostName, int portNo, String dbPath)
             throws SQLException, ClassNotFoundException, IllegalAccessException,
-            InstantiationException
+                   InstantiationException, NoSuchMethodException, InvocationTargetException
     {
         ClientDataSourceInterface ds;
 
+        Class<?> clazz;
         if (JDBC.vmSupportsJNDI()) {
-            ds = (ClientDataSourceInterface)Class.forName(
-                    "org.apache.derby.jdbc.ClientDataSource").newInstance();
+            clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
             ds = new BasicClientDataSource40();
         }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/SimplePerfTest_Verify.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/SimplePerfTest_Verify.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/SimplePerfTest_Verify.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/SimplePerfTest_Verify.java Sat May 28 20:22:41 2016
@@ -22,6 +22,7 @@ limitations under the License.
 package org.apache.derbyTesting.functionTests.tests.replicationTests;
 
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -78,13 +79,15 @@ public class SimplePerfTest_Verify exten
      */
     public void testVerify()
         throws SQLException, IOException, InterruptedException,
-        ClassNotFoundException, IllegalAccessException, InstantiationException
+               ClassNotFoundException, IllegalAccessException, InstantiationException,
+               NoSuchMethodException, InvocationTargetException
     {
         verifyTestInserts();
     }
     private void verifyTestInserts()
         throws SQLException, IOException, InterruptedException,
-        ClassNotFoundException, IllegalAccessException, InstantiationException
+               ClassNotFoundException, IllegalAccessException, InstantiationException,
+               NoSuchMethodException, InvocationTargetException
     {
         Connection conn = clientConnection(masterHostName, masterPortNo, dbPath); // getConnection();
         
@@ -97,13 +100,14 @@ public class SimplePerfTest_Verify exten
     }
     private Connection clientConnection(String hostName, int portNo, String dbPath)
             throws SQLException, ClassNotFoundException, IllegalAccessException,
-            InstantiationException
+                   InstantiationException, NoSuchMethodException,
+                   InvocationTargetException
     {
         ClientDataSourceInterface ds;
 
         if (JDBC.vmSupportsJNDI()) {
-            ds = (ClientDataSourceInterface)Class.forName(
-                    "org.apache.derby.jdbc.ClientDataSource").newInstance();
+            Class<?> clazz = Class.forName("org.apache.derby.jdbc.ClientDataSource");
+            ds = (ClientDataSourceInterface) clazz.getConstructor().newInstance();
         } else {
             ds = new BasicClientDataSource40();
         }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Beetle6038.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Beetle6038.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Beetle6038.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Beetle6038.java Sat May 28 20:22:41 2016
@@ -37,7 +37,8 @@ public class Beetle6038  {
 		throws Exception
 	{
 		String driver = "org.apache.derby.jdbc.EmbeddedDriver";
-		Class.forName(driver).newInstance();
+        Class<?> clazz = Class.forName(driver);
+        clazz.getConstructor().newInstance();
 		String dburl = "jdbc:derby:Beetle6038Db;create=true;dataEncryption=true;bootPassword=Thursday;encryptionAlgorithm=DES/CBC/NoPadding";
 
 		Connection conn = DriverManager.getConnection(dburl);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootAllTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootAllTest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootAllTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootAllTest.java Sat May 28 20:22:41 2016
@@ -142,7 +142,8 @@ public class BootAllTest  extends BaseJD
         } catch (SQLException e) {
        }
 
-        Class.forName(driverName).newInstance();
+        Class<?> clazz = Class.forName(driverName);
+        clazz.getConstructor().newInstance();
 
         Driver driver = DriverManager.getDriver(url);
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EncryptionAESTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EncryptionAESTest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EncryptionAESTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EncryptionAESTest.java Sat May 28 20:22:41 2016
@@ -429,13 +429,18 @@ extends BaseJDBCTestCase {
         String driver =
             getTestConfiguration().getJDBCClient().getJDBCDriverName();
         try {
-            Class.forName(driver).newInstance();
+            Class<?> clazz = Class.forName(driver);
+            clazz.getConstructor().newInstance();
         } catch (ClassNotFoundException cnfe) {
             fail("\nUnable to load the JDBC driver " + driver);
         } catch (InstantiationException ie) {
             fail("\nUnable to instantiate the JDBC driver " + driver);
         } catch (IllegalAccessException iae) {
             fail("\nNot allowed to access the JDBC driver " + driver);
+        } catch (NoSuchMethodException iae) {
+            fail("\nNo such constructor for the JDBC driver " + driver);
+        } catch (java.lang.reflect.InvocationTargetException iae) {
+            fail("\nCannot invoke the constructor for the the JDBC driver " + driver);
         }
         Connection conn = DriverManager.getConnection(url);
         return conn;

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java Sat May 28 20:22:41 2016
@@ -115,7 +115,8 @@ public class InterruptResilienceTest ext
     protected void setUp()
             throws java.lang.Exception {
         try {
-            Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
+            Class<?> clazz = Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+            clazz.getConstructor().newInstance();
         } catch (Exception e) {
         }
         super.setUp();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/dblook_test.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/dblook_test.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/dblook_test.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/dblook_test.java Sat May 28 20:22:41 2016
@@ -143,7 +143,8 @@ public class dblook_test {
 				"old test db before creating a new one...");
 		}
 
-		Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
+        Class<?> clazz = Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+        clazz.getConstructor().newInstance();
 		jdbcProtocol = "jdbc:derby:";
 		createDBFromDDL(testDBName, scriptName);
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java Sat May 28 20:22:41 2016
@@ -293,7 +293,8 @@ public class TestUtil {
                   AccessController.doPrivileged
                       (new PrivilegedExceptionAction<Void>() {
                               public Void run() throws Exception {
-                                  Class.forName(driverName).newInstance();
+                                  Class<?> clazz = Class.forName(driverName);
+                                  clazz.getConstructor().newInstance();
                                   return null;
                               }
                           }
@@ -400,7 +401,8 @@ public class TestUtil {
 		}
 		
 		try {
-		ds  = Class.forName(classname).newInstance();
+            Class<?> clazz = Class.forName(classname);
+            ds = clazz.getConstructor().newInstance();
 
 		// for remote server testing, check whether the hostName is set for the test
 		// if so, and serverName is not yet set explicitly for the datasource, set it now
@@ -790,7 +792,8 @@ public class TestUtil {
                         break;
                 } 
                 // q: do we need a privileged action here, like in loadDriver?
-                Class.forName(driverName).newInstance();
+                Class<?> clazz = Class.forName(driverName);
+                clazz.getConstructor().newInstance();
 				
                 String url = getJdbcUrlPrefix() + databaseName;
                 if (connAttrs != null) url += ";" + connAttrs;
@@ -822,6 +825,14 @@ public class TestUtil {
     		System.out.println("FAILure: Not allowed to use class");
     		ille.printStackTrace();
     		return null;
+    	} catch (NoSuchMethodException ille) {
+    		System.out.println("FAILure: No such constructor");
+    		ille.printStackTrace();
+    		return null;
+    	} catch (java.lang.reflect.InvocationTargetException ille) {
+    		System.out.println("FAILure: Cannot execute constructor");
+    		ille.printStackTrace();
+    		return null;
     	}
     }
     

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptDiskStorageFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptDiskStorageFactory.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptDiskStorageFactory.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptDiskStorageFactory.java Sat May 28 20:22:41 2016
@@ -73,9 +73,9 @@ public class CorruptDiskStorageFactory e
 		
 		WritableStorageFactory storageFactory = null;
 		try{
-			Class storageFactoryClass = Class.forName(dirStorageFactoryClass);
+			Class<?> storageFactoryClass = Class.forName(dirStorageFactoryClass);
 			storageFactory = 
-                (WritableStorageFactory) storageFactoryClass.newInstance();
+                (WritableStorageFactory) storageFactoryClass.getConstructor().newInstance();
 		}catch(Exception e)
 		{
 			System.out.println(

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/ConnectorSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/ConnectorSetup.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/ConnectorSetup.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/ConnectorSetup.java Sat May 28 20:22:41 2016
@@ -41,8 +41,8 @@ final class ConnectorSetup extends Chang
             new TestConfiguration(old);
         
         try {
-            newConfig.connector = (Connector)
-             Class.forName(connectorClass).newInstance();
+            Class<?> clazz = Class.forName(connectorClass);
+            newConfig.connector = (Connector) clazz.getConstructor().newInstance();
         } catch (Exception e) {
             Assert.fail(e.getMessage());
         }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/DriverManagerConnector.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/DriverManagerConnector.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/DriverManagerConnector.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/DriverManagerConnector.java Sat May 28 20:22:41 2016
@@ -237,7 +237,8 @@ public class DriverManagerConnector impl
     private void loadJDBCDriver() throws SQLException {
         String driverClass = config.getJDBCClient().getJDBCDriverName();
         try {
-            Class.forName(driverClass).newInstance();
+            Class<?> clazz = Class.forName(driverClass);
+            clazz.getConstructor().newInstance();
         } catch (ClassNotFoundException cnfe) {
             throw new SQLException("Failed to load JDBC driver '" + driverClass
                     + "': " + cnfe.getMessage());
@@ -247,6 +248,12 @@ public class DriverManagerConnector impl
         } catch (InstantiationException ie) {
             throw new SQLException("Failed to load JDBC driver '" + driverClass
                     + "': " + ie.getMessage());
+        } catch (NoSuchMethodException ie) {
+            throw new SQLException("Failed to load JDBC driver '" + driverClass
+                    + "': " + ie.getMessage());
+        } catch (java.lang.reflect.InvocationTargetException ie) {
+            throw new SQLException("Failed to load JDBC driver '" + driverClass
+                    + "': " + ie.getMessage());
         }
     }
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCDataSource.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCDataSource.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCDataSource.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCDataSource.java Sat May 28 20:22:41 2016
@@ -156,7 +156,8 @@ public class JDBCDataSource {
             if (contextLoader != null)
             {
                 try {
-                    ds = (javax.sql.DataSource) Class.forName(classname, true, contextLoader).newInstance();
+                    Class<?> clazz = Class.forName(classname, true, contextLoader);
+                    ds = (javax.sql.DataSource) clazz.getConstructor().newInstance();
                 } catch (Exception e) {
                     // context loader may not be correctly hooked up
                     // with parent, try without it.
@@ -165,7 +166,8 @@ public class JDBCDataSource {
             
             if (ds == null)
             {
-                ds = (javax.sql.DataSource) Class.forName(classname).newInstance();
+                Class<?> clazz = Class.forName(classname);
+                ds = (javax.sql.DataSource) clazz.getConstructor().newInstance();
             }
             
             for (Iterator i = beanProperties.keySet().iterator();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java Sat May 28 20:22:41 2016
@@ -1398,8 +1398,8 @@ public final class TestConfiguration {
             // configuration we are copying from.
             
             try {
-                connector = (Connector) Class.forName(
-                  oldConnector.getClass().getName()).newInstance();
+                Class<?> clazz = Class.forName(oldConnector.getClass().getName());
+                connector = (Connector) clazz.getConstructor().newInstance();
             } catch (Exception e) {
                 Assert.fail(e.getMessage());
             }            
@@ -1407,8 +1407,8 @@ public final class TestConfiguration {
         else if (JDBC.vmSupportsJDBC3())
         {
             try {
-                connector = (Connector) Class.forName(
-                  "org.apache.derbyTesting.junit.DriverManagerConnector").newInstance();
+                Class<?> clazz = Class.forName("org.apache.derbyTesting.junit.DriverManagerConnector");
+                connector = (Connector) clazz.getConstructor().newInstance();
             } catch (Exception e) {
                 Assert.fail(e.getMessage());
             }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/clients/Runner.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/clients/Runner.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/clients/Runner.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/perf/clients/Runner.java Sat May 28 20:22:41 2016
@@ -88,7 +88,8 @@ public class Runner {
             System.exit(1);
         }
 
-        Class.forName(driver).newInstance();
+        Class<?> clazz = Class.forName(driver);
+        clazz.getConstructor().newInstance();
 
         if (init) {
             DBFiller filler = getDBFiller();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/mailjdbc/utils/DbTasks.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/mailjdbc/utils/DbTasks.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/mailjdbc/utils/DbTasks.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/mailjdbc/utils/DbTasks.java Sat May 28 20:22:41 2016
@@ -131,7 +131,8 @@ public class DbTasks {
 	public static Connection getConnection(String usr, String passwd){
 		try {
 			// Returns the Connection object
-			Class.forName(System.getProperty("driver")).newInstance();
+            Class<?> clazz = Class.forName(System.getProperty("driver"));
+            clazz.getConstructor().newInstance();
 
 			Connection con = DriverManager.getConnection(System
 					.getProperty("database"), usr, passwd);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/nstest/NsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/nstest/NsTest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/nstest/NsTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/nstest/NsTest.java Sat May 28 20:22:41 2016
@@ -416,18 +416,21 @@ public class NsTest extends Thread
 
 		// Load the driver and get a connection to the database
 		String jdbcUrl = "";
+        Class<?> clazz;
 		try {
 			if (driver_type.equalsIgnoreCase("Embedded")) {
 				// logger.println("Driver embedd : " + driver_type);
 				logger.println("Loading the embedded driver...");
-				Class.forName(embedDriver).newInstance();
+				clazz = Class.forName(embedDriver);
+                clazz.getConstructor().newInstance();
 				jdbcUrl = embedDbURL + ";" + dataEncypt + ";" + bootPwd;
 				embeddedMode = true;
 			} else {
 				logger.println("Driver type : " + driver_type);
 				logger.println("Loading the Derby Client driver..."
 						+ driver);
-				Class.forName(driver).newInstance();
+				clazz = Class.forName(driver);
+                clazz.getConstructor().newInstance();
 				logger.println("Client Driver loaded");
 				jdbcUrl = clientDbURL + ";" + dataEncypt + ";" + bootPwd;
 			}

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/client/Submitter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/client/Submitter.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/client/Submitter.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/oe/client/Submitter.java Sat May 28 20:22:41 2016
@@ -21,6 +21,7 @@ package org.apache.derbyTesting.system.o
 
 import java.io.PrintStream;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -533,7 +534,7 @@ public class Submitter {
         BigDecimal c = BigDecimal.valueOf((long) count * 100L);
         BigDecimal t = BigDecimal.valueOf((long) total);
         
-        BigDecimal p = c.divide(t, 2, BigDecimal.ROUND_DOWN);
+        BigDecimal p = c.divide(t, 2, RoundingMode.DOWN);
         
         return p.toString().concat("%");
     }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/sttest/Sttest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/sttest/Sttest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/sttest/Sttest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/sttest/Sttest.java Sat May 28 20:22:41 2016
@@ -128,7 +128,8 @@ public class Sttest extends Thread {
 		// get any properties user may have set in Sttest.properties file
 		// these will override any of those set above
 		userProperties();
-		Class.forName(driver).newInstance();
+		Class<?> clazz = Class.forName(driver);
+        clazz.getConstructor().newInstance();
 		if (Setup.doit(dbURL) == false)
 			System.exit(1);
 		status = new StStatus();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/sttest/utils/CompressTable.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/sttest/utils/CompressTable.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/sttest/utils/CompressTable.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/system/sttest/utils/CompressTable.java Sat May 28 20:22:41 2016
@@ -46,8 +46,9 @@ public class CompressTable {
 	InterruptedException, Exception, Throwable {
 		Connection conn = null;
 		Date d = null;
-		
-		Class.forName(driver).newInstance();
+
+        Class<?> clazz = Class.forName(driver);
+        clazz.getConstructor().newInstance();
 		
 		try {
 			conn = mystartJBMS();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/junit/MissingPermissionsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/junit/MissingPermissionsTest.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/junit/MissingPermissionsTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/junit/MissingPermissionsTest.java Sat May 28 20:22:41 2016
@@ -403,7 +403,7 @@ public class MissingPermissionsTest exte
             final int exitCode = spawned.complete(120000L); // 2 minutes
 
             assertTrue(spawned.getFailMessage("subprocess run failed: "),
-                    exitCode == 0);
+                    exitCode == 1);
 
             final String expectedMessageOnConsole =
                     "WARNING: could not do ThreadGroup#setDaemon on Derby " +

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RawStoreFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RawStoreFactory.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RawStoreFactory.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RawStoreFactory.java Sat May 28 20:22:41 2016
@@ -208,8 +208,8 @@ public class T_RawStoreFactory extends T
 	protected T_MultiThreadedIterations newTestObject() {
 		try
 		{
-			Class thisClass = this.getClass();
-			return (T_MultiThreadedIterations)(thisClass.newInstance());
+			Class<?> thisClass = this.getClass();
+			return (T_MultiThreadedIterations)(thisClass.getConstructor().newInstance());
 		}
 		catch (InstantiationException ie)
 		{
@@ -219,6 +219,14 @@ public class T_RawStoreFactory extends T
 		{
 			return new T_RawStoreFactory();
 		}
+		catch (NoSuchMethodException iae)
+		{
+			return new T_RawStoreFactory();
+		}
+		catch (java.lang.reflect.InvocationTargetException iae)
+		{
+			return new T_RawStoreFactory();
+		}
 	}	
 
 

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ConnectionEnv.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ConnectionEnv.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ConnectionEnv.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ConnectionEnv.java Sat May 28 20:22:41 2016
@@ -23,6 +23,7 @@ package org.apache.derby.impl.tools.ij;
 
 import java.io.File;
 import java.io.FileNotFoundException;
+import java.lang.reflect.InvocationTargetException;
 
 import java.util.Hashtable;
 import java.util.Enumeration;
@@ -59,7 +60,7 @@ class ConnectionEnv {
 		separate from the constructor so that connection
 		failure does not prevent object creation.
 	 */
-	void init(LocalizedOutput out) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException {
+    void init(LocalizedOutput out) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
 
 		Connection c = util.startJBMS(null,null);
 

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/ij.jj Sat May 28 20:22:41 2016
@@ -154,7 +154,8 @@ class ij {
        if (ij.JDBC20X() && ij.JTA())
 		{
 			try {
-				xahelper = (xaAbstractHelper) Class.forName("org.apache.derby.impl.tools.ij.xaHelper").newInstance();
+                Class<?> clazz = Class.forName("org.apache.derby.impl.tools.ij.xaHelper");
+				xahelper = (xaAbstractHelper) clazz.getConstructor().newInstance();
 				xahelper.setFramework(framework_property);
 			} catch (Exception e) {
 			}
@@ -298,6 +299,10 @@ class ij {
 			throw ijException.classNotFoundForProtocol(value);
 	    } catch (InstantiationException e) {
 			throw ijException.classNotFoundForProtocol(value);
+	    } catch (NoSuchMethodException e) {
+			throw ijException.classNotFoundForProtocol(value);
+	    } catch (java.lang.reflect.InvocationTargetException e) {
+			throw ijException.classNotFoundForProtocol(value);
 	    }
 		if (name == null)
 			protocol = value;
@@ -1681,6 +1686,10 @@ throws SQLException
 			throw ijException.classNotFound(sVal);
 	    } catch (InstantiationException e) {
 			throw ijException.classNotFound(sVal);
+	    } catch (NoSuchMethodException e) {
+			throw ijException.classNotFound(sVal);
+	    } catch (java.lang.reflect.InvocationTargetException e) {
+			throw ijException.classNotFound(sVal);
 	    }
 		return null;
 	}

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/util.java Sat May 28 20:22:41 2016
@@ -351,7 +351,7 @@ public final class util implements java.
 			
 		    Class<?> dc = Class.forName(dsName);
             if (DataSource.class.isAssignableFrom(dc)) {
-                ds = (DataSource) dc.newInstance();
+                ds = (DataSource) dc.getConstructor().newInstance();
             } else {
                 throw new ijException(LocalizedResource.getMessage(
                     "TL_notInstanceOf", dsName, DataSource.class.getName()));
@@ -395,7 +395,8 @@ public final class util implements java.
 	 */
     static public Connection startJBMS(String defaultDriver, String defaultURL,
 				       Properties connInfo) 
-	throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException
+      throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException,
+        NoSuchMethodException, InvocationTargetException
     {
 	Connection con = null;
         String driverName;
@@ -500,7 +501,7 @@ public final class util implements java.
 		@exception InstantiationException on failure to load driver.
 		@exception IllegalAccessException on failure to load driver.
 	 */
-    static public Connection startJBMS() throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException {
+    static public Connection startJBMS() throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
 		return startJBMS(null,null);
 	}
 	
@@ -519,7 +520,7 @@ public final class util implements java.
 	 */
     static public Connection startJBMS(String defaultDriver, String defaultURL) 
 			throws SQLException, ClassNotFoundException, InstantiationException,
-				   IllegalAccessException {
+                   IllegalAccessException, NoSuchMethodException, InvocationTargetException {
 		return startJBMS(defaultDriver,defaultURL,null);
 		
 	}
@@ -736,7 +737,7 @@ AppUI.out.println("SIZE="+l);
 			create an instance.
 		@exception IllegalAccessException if driver class constructor not visible.
 	 */
-	public static void loadDriverIfKnown(String jdbcProtocol) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
+	public static void loadDriverIfKnown(String jdbcProtocol) throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
 		for (int i=0; i < protocolDrivers.length; i++) {
 			if (jdbcProtocol.startsWith(protocolDrivers[i][0])) {
 				loadDriver(protocolDrivers[i][1]);
@@ -755,11 +756,12 @@ AppUI.out.println("SIZE="+l);
 		@exception IllegalAccessException if driver class constructor not visible.
 	 */
     static void loadDriver(String driverClass)
-            throws ClassNotFoundException, InstantiationException,
-                   IllegalAccessException {
+        throws
+            ClassNotFoundException, InstantiationException,
+            IllegalAccessException, NoSuchMethodException, InvocationTargetException {
         Class<?> klass = Class.forName(driverClass);
         if (Driver.class.isAssignableFrom(klass)) {
-            klass.newInstance();
+            klass.getConstructor().newInstance();
         } else {
             throw new ijException(LocalizedResource.getMessage(
                     "TL_notInstanceOf", driverClass, Driver.class.getName()));

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java Sat May 28 20:22:41 2016
@@ -185,6 +185,10 @@ public class utilMain {
 				JDBCDisplayUtil.ShowException(out, i); // will continue past driver failure
 			} catch (IllegalAccessException ia) {
 				JDBCDisplayUtil.ShowException(out, ia); // will continue past driver failure
+			} catch (NoSuchMethodException ia) {
+				JDBCDisplayUtil.ShowException(out, ia); // will continue past driver failure
+			} catch (java.lang.reflect.InvocationTargetException ia) {
+				JDBCDisplayUtil.ShowException(out, ia); // will continue past driver failure
             } catch (ijException ie) {
                 JDBCDisplayUtil.ShowException(out, ie); // will continue past driver failure
             }

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/xaHelper.java Sat May 28 20:22:41 2016
@@ -58,7 +58,7 @@ class xaHelper implements xaAbstractHelp
 	private boolean isNetClient;
 	private String framework;
 
-  xaHelper()
+  public xaHelper()
   {
   }
 	  
@@ -426,7 +426,8 @@ class xaHelper implements xaAbstractHelp
 	{
 
 		try {
-			currentDataSource = (DataSource) (Class.forName("org.apache.derby.jdbc.EmbeddedDataSource").newInstance());
+            Class<?> clazz = Class.forName("org.apache.derby.jdbc.EmbeddedDataSource");
+			currentDataSource = (DataSource) (clazz.getConstructor().newInstance());
 		} catch (Exception e) {
 			throw new SQLException(e.toString());
 		}
@@ -459,7 +460,8 @@ class xaHelper implements xaAbstractHelp
 		 throws SQLException
 	{
 		try {
-			currentCPDataSource = (ConnectionPoolDataSource) (Class.forName("org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource").newInstance());
+          Class<?> clazz = Class.forName("org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource");
+          currentCPDataSource = (ConnectionPoolDataSource) (clazz.getConstructor().newInstance());
 		} catch (Exception e) {
 			throw new SQLException(e.toString());
 		}
@@ -516,18 +518,19 @@ class xaHelper implements xaAbstractHelp
 		// if we new it directly, then it will the tools.jar file to bloat.
 		try
 		{
-		    
+            Class<?> clazz;
             if (isJCC)
-               return (XADataSource) 
-                (Class.forName("com.ibm.db2.jcc.DB2XADataSource").newInstance());
+            {
+                clazz = Class.forName("com.ibm.db2.jcc.DB2XADataSource");
+                return (XADataSource) clazz.getConstructor().newInstance();
+            }
             else if (isNetClient){
                 if (ij.JNDI()) {
                     //running under jdk1.6 or higher
                     // try instantiating EmbeddedXADataSource40
                     try {
-                        return (XADataSource)(Class.forName(
-                                "org.apache.derby.jdbc.ClientXADataSource40").
-                                newInstance());
+                        clazz = Class.forName("org.apache.derby.jdbc.ClientXADataSource40");
+                        return (XADataSource) clazz.getConstructor().newInstance();
                     }
                     catch (ClassNotFoundException e) {
                         //probably it was not compiled with jdbc4.0
@@ -536,22 +539,21 @@ class xaHelper implements xaAbstractHelp
                     catch (UnsupportedClassVersionError ue) {
                         // ClientXADataSource
                     }
-                    return (XADataSource) (Class.forName(
-                            "org.apache.derby.jdbc.ClientXADataSource"
-                            ).newInstance());
+                    
+                    clazz = Class.forName("org.apache.derby.jdbc.ClientXADataSource");
+                                                         
+                    return (XADataSource) clazz.getConstructor().newInstance();
                 } else {
-                    return (XADataSource)(Class.forName(
-                        "org.apache.derby.jdbc.BasicClientXADataSource40").
-                            newInstance());
+                    clazz = Class.forName("org.apache.derby.jdbc.BasicClientXADataSource40");
+                    return (XADataSource) clazz.getConstructor().newInstance();
                 }
             } else {
                 if (ij.JNDI()) {
                     //running under jdk1.6 or higher
                     // try instantiating EmbeddedXADataSource40
                     try {
-                        return (XADataSource)(Class.forName(
-                            "org.apache.derby.jdbc.EmbeddedXADataSource40").
-                                newInstance());
+                        clazz = Class.forName("org.apache.derby.jdbc.EmbeddedXADataSource40");
+                        return (XADataSource) clazz.getConstructor().newInstance();
                     } catch (ClassNotFoundException e) {
                         //probably it was not compiled with jdbc4.0
                         //support go ahead with EmbeddedXADataSource
@@ -560,21 +562,21 @@ class xaHelper implements xaAbstractHelp
                         // EmbeddedXADataSource
                     }
 
-                    return (XADataSource)(Class.forName(
-                        "org.apache.derby.jdbc.EmbeddedXADataSource").
-                            newInstance());
+                    clazz = Class.forName("org.apache.derby.jdbc.EmbeddedXADataSource");
+                    return (XADataSource) clazz.getConstructor().newInstance();
                 } else {
-                    return (XADataSource)(Class.forName(
-                        "org.apache.derby.jdbc.BasicEmbeddedXADataSource40").
-                            newInstance());
+                    clazz = Class.forName("org.apache.derby.jdbc.BasicEmbeddedXADataSource40");
+                    return (XADataSource) clazz.getConstructor().newInstance();
                 }
             }
         }
         catch(ClassNotFoundException cnfe) {
 			throw new ijException(LocalizedResource.getMessage("IJ_XAClass"));
 		}
-		catch (InstantiationException e) { }
-		catch (IllegalAccessException e) { }
+		catch (InstantiationException e) {}
+		catch (IllegalAccessException e) {}
+		catch (NoSuchMethodException e) {}
+        catch (java.lang.reflect.InvocationTargetException e) {}
 
 		throw new ijException(LocalizedResource.getMessage("IJ_XANoI"));
 	}

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java Sat May 28 20:22:41 2016
@@ -21,6 +21,7 @@
 
 package org.apache.derby.impl.tools.planexporter;
 
+import java.lang.reflect.InvocationTargetException;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.PreparedStatement;
@@ -79,7 +80,7 @@ public class AccessDatabase {
      */
     public AccessDatabase(String dburl, String aSchema, String aQuery)
             throws InstantiationException, IllegalAccessException,
-            ClassNotFoundException, SQLException
+                   ClassNotFoundException, SQLException, NoSuchMethodException, InvocationTargetException
     {
         this(createConnection(dburl), aSchema, aQuery);
     }
@@ -114,14 +115,15 @@ public class AccessDatabase {
      */
     private static Connection createConnection(String dbURL)
             throws InstantiationException, IllegalAccessException,
-            ClassNotFoundException, SQLException
+                   ClassNotFoundException, SQLException, NoSuchMethodException,
+                   InvocationTargetException
     {
 
-        if(dbURL.indexOf("://") != -1)
-            Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
-
-        else
-            Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
+        Class<?> clazz = (dbURL.indexOf("://") != -1) ?
+          Class.forName("org.apache.derby.jdbc.ClientDriver")
+          :
+          Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+        clazz.getConstructor().newInstance();
 
         //Get a connection
         return DriverManager.getConnection(dbURL);

Modified: db/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/tools/dblook.java Sat May 28 20:22:41 2016
@@ -325,7 +325,7 @@ public final class dblook {
 		try {
             Class<?> klass = Class.forName(derbyDriver);
             if (Driver.class.isAssignableFrom(klass)) {
-                klass.newInstance();
+                klass.getConstructor().newInstance();
             } else {
                 Logs.debug(
                         "TL_notInstanceOf",

Modified: db/derby/code/trunk/java/tools/org/apache/derby/tools/ij.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/tools/ij.java?rev=1745932&r1=1745931&r2=1745932&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/tools/ij.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/tools/ij.java Sat May 28 20:22:41 2016
@@ -138,7 +138,8 @@ public class ij {
   }
 
   public static java.sql.Connection startJBMS()
-	  throws java.sql.SQLException, IllegalAccessException, ClassNotFoundException, InstantiationException
+    throws java.sql.SQLException, IllegalAccessException, ClassNotFoundException, InstantiationException,
+           NoSuchMethodException, java.lang.reflect.InvocationTargetException
   {			
 		return org.apache.derby.impl.tools.ij.util.startJBMS();
   }



Mime
View raw message