You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2013/12/03 23:34:16 UTC
svn commit: r1547619 - in
/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter:
ConnectionImpl.java PoolablePreparedStatementStub.java
PooledConnectionImpl.java
Author: markt
Date: Tue Dec 3 22:34:16 2013
New Revision: 1547619
URL: http://svn.apache.org/r1547619
Log:
Fix the generics warnings in o.a.c.dbcp2.cpdsadapter package
Modified:
commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/ConnectionImpl.java
commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PoolablePreparedStatementStub.java
commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java
Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/ConnectionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/ConnectionImpl.java?rev=1547619&r1=1547618&r2=1547619&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/ConnectionImpl.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/ConnectionImpl.java Tue Dec 3 22:34:16 2013
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,20 +26,20 @@ import org.apache.commons.dbcp2.Delegati
/**
* This class is the <code>Connection</code> that will be returned
- * from <code>PooledConnectionImpl.getConnection()</code>.
- * Most methods are wrappers around the jdbc 1.x <code>Connection</code>.
+ * from <code>PooledConnectionImpl.getConnection()</code>.
+ * Most methods are wrappers around the jdbc 1.x <code>Connection</code>.
* A few exceptions include preparedStatement and close.
* In accordance with the jdbc specification this Connection cannot
* be used after closed() is called. Any further usage will result in an
* SQLException.
- *
+ *
* ConnectionImpl extends DelegatingConnection to enable access to the
* underlying connection.
*
* @author John D. McNally
* @version $Revision$ $Date$
*/
-class ConnectionImpl extends DelegatingConnection {
+class ConnectionImpl extends DelegatingConnection<Connection> {
private final boolean accessToUnderlyingConnectionAllowed;
@@ -47,13 +47,13 @@ class ConnectionImpl extends DelegatingC
private final PooledConnectionImpl pooledConnection;
/**
- * Creates a <code>ConnectionImpl</code>.
+ * Creates a <code>ConnectionImpl</code>.
*
* @param pooledConnection The PooledConnection that is calling the ctor.
* @param connection The JDBC 1.x Connection to wrap.
* @param accessToUnderlyingConnectionAllowed if true, then access is allowed to the underlying connectiion
*/
- ConnectionImpl(PooledConnectionImpl pooledConnection,
+ ConnectionImpl(PooledConnectionImpl pooledConnection,
Connection connection,
boolean accessToUnderlyingConnectionAllowed) {
super(connection);
@@ -115,8 +115,8 @@ class ConnectionImpl extends DelegatingC
* in the wrapped connection.
*/
@Override
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency)
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency)
throws SQLException {
checkOpen();
try {
Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PoolablePreparedStatementStub.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PoolablePreparedStatementStub.java?rev=1547619&r1=1547618&r2=1547619&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PoolablePreparedStatementStub.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PoolablePreparedStatementStub.java Tue Dec 3 22:34:16 2013
@@ -43,8 +43,9 @@ class PoolablePreparedStatementStub exte
*/
public PoolablePreparedStatementStub(PreparedStatement stmt,
PStmtKeyCPDS key,
- KeyedObjectPool<PStmtKeyCPDS, PoolablePreparedStatement<PStmtKeyCPDS, PoolablePreparedStatementStub>> pool,
- DelegatingConnection conn) {
+ KeyedObjectPool<PStmtKeyCPDS, PoolablePreparedStatement<PStmtKeyCPDS,
+ PoolablePreparedStatementStub>> pool,
+ DelegatingConnection<?> conn) {
super(stmt, key, pool, conn);
}
Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java?rev=1547619&r1=1547618&r2=1547619&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java Tue Dec 3 22:34:16 2013
@@ -57,7 +57,7 @@ class PooledConnectionImpl implements Po
/**
* A DelegatingConnection used to create a PoolablePreparedStatementStub
*/
- private final DelegatingConnection delegatingConnection;
+ private final DelegatingConnection<?> delegatingConnection;
/**
* The JDBC database logical connection.
@@ -96,9 +96,9 @@ class PooledConnectionImpl implements Po
PooledConnectionImpl(Connection connection) {
this.connection = connection;
if (connection instanceof DelegatingConnection) {
- this.delegatingConnection = (DelegatingConnection) connection;
+ this.delegatingConnection = (DelegatingConnection<?>) connection;
} else {
- this.delegatingConnection = new DelegatingConnection(connection);
+ this.delegatingConnection = new DelegatingConnection<>(connection);
}
eventListeners = new Vector<>();
isClosed = false;