commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1537569 - /commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestConnectionPool.java
Date Thu, 31 Oct 2013 18:12:04 GMT
Author: sebb
Date: Thu Oct 31 18:12:04 2013
New Revision: 1537569

URL: http://svn.apache.org/r1537569
Log:
Generics fixes

Modified:
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestConnectionPool.java

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestConnectionPool.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestConnectionPool.java?rev=1537569&r1=1537568&r2=1537569&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestConnectionPool.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestConnectionPool.java Thu
Oct 31 18:12:04 2013
@@ -52,7 +52,7 @@ public abstract class TestConnectionPool
         super.tearDown();
         // Close any connections opened by the test
         while (!connections.isEmpty()) {
-            Connection conn = (Connection) connections.pop();
+            Connection conn = connections.pop();
             try {
                 conn.close();
             } catch (Exception ex) {
@@ -74,7 +74,7 @@ public abstract class TestConnectionPool
     }
 
     /** Connections opened during the course of a test */
-    protected Stack connections = new Stack();
+    protected Stack<Connection> connections = new Stack<>();
 
     /** Acquire a connection and push it onto the connections stack */
     protected Connection newConnection() throws Exception {
@@ -521,7 +521,7 @@ public abstract class TestConnectionPool
      */
     public void testHashing() throws Exception {
         Connection con = getConnection();
-        Hashtable hash = new Hashtable();
+        Hashtable<Connection, String> hash = new Hashtable<>();
         hash.put(con, "test");
         assertEquals("test", hash.get(con));
         assertTrue(hash.containsKey(con));



Mime
View raw message