commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1562952 - in /commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed: TestManagedDataSource.java TestManagedDataSourceInTx.java
Date Thu, 30 Jan 2014 20:42:33 GMT
Author: markt
Date: Thu Jan 30 20:42:33 2014
New Revision: 1562952

URL: http://svn.apache.org/r1562952
Log:
Fix a couple of FindBugs warnings

Modified:
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSourceInTx.java

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java?rev=1562952&r1=1562951&r2=1562952&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java
Thu Jan 30 20:42:33 2014
@@ -203,7 +203,7 @@ public class TestManagedDataSource exten
 
     public void testManagedConnectionEqualsType() throws Exception {
         Connection con1 = ds.getConnection();
-        Integer con2 = new Integer(0);
+        Integer con2 = Integer.valueOf(0);
         assertFalse(con1.equals(con2));
         con1.close();
     }

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSourceInTx.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSourceInTx.java?rev=1562952&r1=1562951&r2=1562952&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSourceInTx.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSourceInTx.java
Thu Jan 30 20:42:33 2014
@@ -19,6 +19,7 @@ package org.apache.commons.dbcp2.managed
 
 import org.apache.commons.dbcp2.DelegatingConnection;
 
+import java.sql.CallableStatement;
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.sql.Statement;
@@ -137,7 +138,7 @@ public class TestManagedDataSourceInTx e
         assertNotNull(connection);
 
         // generate SQLWarning on connection
-        connection.prepareCall("warning");
+        CallableStatement statement = connection.prepareCall("warning");
         assertNotNull(connection.getWarnings());
 
         // create a new shared connection
@@ -154,6 +155,7 @@ public class TestManagedDataSourceInTx e
         assertNotNull(connection.getWarnings());
         assertNotNull(sharedConnection.getWarnings());
 
+        statement.close();
         connection.close();
         sharedConnection.close();
     }



Mime
View raw message