Author: markt Date: Tue Dec 3 23:09:25 2013 New Revision: 1547635 URL: http://svn.apache.org/r1547635 Log: Rather than always cast and let things blow up at runtime if the developer gets it wrong, use the required type in the API and highlight any issue at compile time.
Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableCallableStatement.java Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableCallableStatement.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableCallableStatement.java?rev=1547635&r1=1547634&r2=1547635&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableCallableStatement.java (original) +++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableCallableStatement.java Tue Dec 3 23:09:25 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. @@ -49,18 +49,19 @@ public class PoolableCallableStatement e /** * Constructor. - * + * * @param stmt the underlying {@link CallableStatement} * @param key the key for this statement in the {@link KeyedObjectPool} * @param pool the {@link KeyedObjectPool} from which this CallableStatement was obtained - * @param conn the {@link Connection} that created this CallableStatement + * @param conn the {@link DelegatingConnection} that created this CallableStatement */ - public PoolableCallableStatement(CallableStatement stmt, Object key, KeyedObjectPool pool, Connection conn) { - super((DelegatingConnection)conn, stmt); + public PoolableCallableStatement(CallableStatement stmt, Object key, + KeyedObjectPool pool, DelegatingConnection<Connection> conn) { + super(conn, stmt); _pool = pool; _key = key; - // Remove from trace now because this statement will be + // Remove from trace now because this statement will be // added by the activate method. if(_conn != null) { _conn.removeTrace(this);