commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1564436 - /commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolingConnection.java
Date Tue, 04 Feb 2014 19:36:42 GMT
Author: markt
Date: Tue Feb  4 19:36:41 2014
New Revision: 1564436

URL: http://svn.apache.org/r1564436
Log:
Unable to find a way around this final generics warning so suppress it

Modified:
    commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolingConnection.java

Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolingConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolingConnection.java?rev=1564436&r1=1564435&r2=1564436&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolingConnection.java
(original)
+++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolingConnection.java
Tue Feb  4 19:36:41 2014
@@ -21,7 +21,6 @@ import java.sql.CallableStatement;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
-
 import java.util.NoSuchElementException;
 
 import org.apache.commons.pool2.KeyedObjectPool;
@@ -303,17 +302,20 @@ public class PoolingConnection extends D
         } else {
             if( null == key.getResultSetType() && null == key.getResultSetConcurrency())
{
                 if (key.getStmtType() == STATEMENT_PREPAREDSTMT ) {
-                    return new DefaultPooledObject<DelegatingPreparedStatement>(
-                            new PoolablePreparedStatement(getDelegate().prepareStatement(
key.getSql()), key, _pstmtPool, this));
+                    @SuppressWarnings({"rawtypes", "unchecked"}) // Unable to find way to
avoid this
+                    PoolablePreparedStatement pps = new PoolablePreparedStatement(
+                            getDelegate().prepareStatement( key.getSql()), key, _pstmtPool,
this);
+                    return new DefaultPooledObject<DelegatingPreparedStatement>(pps);
                 } else {
                     return new DefaultPooledObject<DelegatingPreparedStatement>(
                             new PoolableCallableStatement(getDelegate().prepareCall( key.getSql()),
key, _pstmtPool, this));
                 }
             } else { // Both _resultSetType and _resultSetConcurrency are non-null here (both
or neither are set by constructors)
                 if(key.getStmtType() == STATEMENT_PREPAREDSTMT) {
-                    return new DefaultPooledObject<DelegatingPreparedStatement>(
-                            new PoolablePreparedStatement(getDelegate().prepareStatement(
-                                    key.getSql(), key.getResultSetType().intValue(),key.getResultSetConcurrency().intValue()),
key, _pstmtPool, this));
+                    @SuppressWarnings({"rawtypes", "unchecked"}) // Unable to find way to
avoid this
+                    PoolablePreparedStatement pps = new PoolablePreparedStatement(getDelegate().prepareStatement(
+                            key.getSql(), key.getResultSetType().intValue(),key.getResultSetConcurrency().intValue()),
key, _pstmtPool, this);
+                    return new DefaultPooledObject<DelegatingPreparedStatement>(pps);
                 } else {
                     return new DefaultPooledObject<DelegatingPreparedStatement>(
                             new PoolableCallableStatement( getDelegate().prepareCall(



Mime
View raw message