commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1148514 - in /commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2: DelegatingConnection.java PoolingDataSource.java
Date Tue, 19 Jul 2011 20:34:55 GMT
Author: markt
Date: Tue Jul 19 20:34:55 2011
New Revision: 1148514

URL: http://svn.apache.org/viewvc?rev=1148514&view=rev
Log:
Generics

Modified:
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/DelegatingConnection.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDataSource.java

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/DelegatingConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/DelegatingConnection.java?rev=1148514&r1=1148513&r2=1148514&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/DelegatingConnection.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/DelegatingConnection.java
Tue Jul 19 20:34:55 2011
@@ -391,7 +391,7 @@ public class DelegatingConnection extend
     { checkOpen(); try { return _conn.getTransactionIsolation(); } catch (SQLException e)
{ handleException(e); return -1; } }
     
     @Override
-    public Map getTypeMap() throws SQLException
+    public Map<String,Class<?>> getTypeMap() throws SQLException
     { checkOpen(); try { return _conn.getTypeMap(); } catch (SQLException e) { handleException(e);
return null; } }
     
     @Override
@@ -479,7 +479,7 @@ public class DelegatingConnection extend
     { checkOpen(); try { _conn.setTransactionIsolation(level); } catch (SQLException e) {
handleException(e); } }
 
     @Override
-    public void setTypeMap(Map map) throws SQLException
+    public void setTypeMap(Map<String,Class<?>> map) throws SQLException
     { checkOpen(); try { _conn.setTypeMap(map); } catch (SQLException e) { handleException(e);
} }
 
     @Override

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDataSource.java?rev=1148514&r1=1148513&r2=1148514&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDataSource.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDataSource.java Tue
Jul 19 20:34:55 2011
@@ -51,11 +51,12 @@ public class PoolingDataSource implement
         this(null);
     }
 
-    public PoolingDataSource(ObjectPool pool) {
+    public PoolingDataSource(ObjectPool<Connection> pool) {
         _pool = pool;
     }
 
-    public void setPool(ObjectPool pool) throws IllegalStateException, NullPointerException
{
+    public void setPool(ObjectPool<Connection> pool)
+            throws IllegalStateException, NullPointerException {
         if(null != _pool) {
             throw new IllegalStateException("Pool already set");
         } else if(null == pool) {
@@ -106,7 +107,7 @@ public class PoolingDataSource implement
     @Override
     public Connection getConnection() throws SQLException {
         try {
-            Connection conn = (Connection)(_pool.borrowObject());
+            Connection conn = _pool.borrowObject();
             if (conn != null) {
                 conn = new PoolGuardConnectionWrapper(conn);
             } 
@@ -173,7 +174,7 @@ public class PoolingDataSource implement
     /** My log writer. */
     protected PrintWriter _logWriter = null;
 
-    protected ObjectPool _pool = null;
+    protected ObjectPool<Connection> _pool = null;
 
     /**
      * PoolGuardConnectionWrapper is a Connection wrapper that makes sure a 
@@ -271,7 +272,7 @@ public class PoolingDataSource implement
         }
 
         @Override
-        public Map getTypeMap() throws SQLException {
+        public Map<String,Class<?>> getTypeMap() throws SQLException {
             checkOpen();
             return delegate.getTypeMap();
         }
@@ -379,7 +380,7 @@ public class PoolingDataSource implement
         }
 
         @Override
-        public void setTypeMap(Map map) throws SQLException {
+        public void setTypeMap(Map<String,Class<?>> map) throws SQLException
{
             checkOpen();
             delegate.setTypeMap(map);
         }



Mime
View raw message