Author: markt Date: Thu Aug 4 08:09:03 2011 New Revision: 1153774 URL: http://svn.apache.org/viewvc?rev=1153774&view=rev Log: Rename to make compilation errors easier to understand when working on generics
Added: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKeyCPDS.java - copied, changed from r1148584, commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKey.java Removed: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKey.java Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java Copied: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKeyCPDS.java (from r1148584, commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKey.java) URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKeyCPDS.java?p2=commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKeyCPDS.java&p1=commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKey.java&r1=1148584&r2=1153774&rev=1153774&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKey.java (original) +++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKeyCPDS.java Thu Aug 4 08:09:03 2011 @@ -18,40 +18,42 @@ package org.apache.commons.dbcp2.cpdsada import java.util.Arrays; +import org.apache.commons.dbcp2.PStmtKey; + /** - * A key uniquely identifying {*link PreparedStatement}s. + * A key uniquely identifying {@link PreparedStatement}s. */ -public class PStmtKey extends org.apache.commons.dbcp2.PStmtKey { +public class PStmtKeyCPDS extends PStmtKey { private Integer _autoGeneratedKeys = null; private Integer _resultSetHoldability = null; private int _columnIndexes[] = null; private String _columnNames[] = null; - public PStmtKey(String sql) { + public PStmtKeyCPDS(String sql) { super(sql); } - public PStmtKey(String sql, int autoGeneratedKeys) { + public PStmtKeyCPDS(String sql, int autoGeneratedKeys) { super(sql); _autoGeneratedKeys = new Integer(autoGeneratedKeys); } - public PStmtKey(String sql, int resultSetType, int resultSetConcurrency) { + public PStmtKeyCPDS(String sql, int resultSetType, int resultSetConcurrency) { super(sql, resultSetType, resultSetConcurrency); } - public PStmtKey(String sql, int resultSetType, int resultSetConcurrency, + public PStmtKeyCPDS(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) { super(sql, resultSetType, resultSetConcurrency); _resultSetHoldability = new Integer(resultSetHoldability); } - public PStmtKey(String sql, int columnIndexes[]) { + public PStmtKeyCPDS(String sql, int columnIndexes[]) { super(sql); _columnIndexes = columnIndexes; } - public PStmtKey(String sql, String columnNames[]) { + public PStmtKeyCPDS(String sql, String columnNames[]) { super(sql); _columnNames = columnNames; } @@ -76,7 +78,7 @@ public class PStmtKey extends org.apache @Override public boolean equals(Object that) { try { - PStmtKey key = (PStmtKey) that; + PStmtKeyCPDS key = (PStmtKeyCPDS) that; return(((null == getSql() && null == key.getSql()) || getSql().equals(key.getSql())) && ((null == getCatalog() && null == key.getCatalog()) || getCatalog().equals(key.getCatalog())) && ((null == getResultSetType() && null == key.getResultSetType()) || getResultSetType().equals(key.getResultSetType())) && 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=1153774&r1=1153773&r2=1153774&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 Thu Aug 4 08:09:03 2011 @@ -41,7 +41,7 @@ import org.apache.commons.pool2.KeyedPoo * @version $Revision$ $Date$ */ class PooledConnectionImpl implements PooledConnection, - KeyedPoolableObjectFactory<PStmtKey,PoolablePreparedStatementStub> { + KeyedPoolableObjectFactory<PStmtKeyCPDS,PoolablePreparedStatementStub> { private static final String CLOSED = "Attempted to use PooledConnection after closed() was called."; @@ -79,7 +79,7 @@ class PooledConnectionImpl implements Po /** My pool of {*link PreparedStatement}s. */ // TODO - make final? - protected KeyedObjectPool<PStmtKey,PoolablePreparedStatementStub> pstmtPool = null; + protected KeyedObjectPool<PStmtKeyCPDS,PoolablePreparedStatementStub> pstmtPool = null; /** * Controls access to the underlying connection @@ -103,7 +103,7 @@ class PooledConnectionImpl implements Po } public void setStatementPool( - KeyedObjectPool<PStmtKey,PoolablePreparedStatementStub> statementPool) { + KeyedObjectPool<PStmtKeyCPDS,PoolablePreparedStatementStub> statementPool) { pstmtPool = statementPool; } @@ -369,47 +369,47 @@ class PooledConnectionImpl implements Po /** * Create a {*link PooledConnectionImpl.PStmtKey} for the given arguments. */ - protected PStmtKey createKey(String sql, int autoGeneratedKeys) { - return new PStmtKey(normalizeSQL(sql), autoGeneratedKeys); + protected PStmtKeyCPDS createKey(String sql, int autoGeneratedKeys) { + return new PStmtKeyCPDS(normalizeSQL(sql), autoGeneratedKeys); } /** * Create a {*link PooledConnectionImpl.PStmtKey} for the given arguments. */ - protected PStmtKey createKey(String sql, int resultSetType, + protected PStmtKeyCPDS createKey(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) { - return new PStmtKey(normalizeSQL(sql), resultSetType, + return new PStmtKeyCPDS(normalizeSQL(sql), resultSetType, resultSetConcurrency, resultSetHoldability); } /** * Create a {*link PooledConnectionImpl.PStmtKey} for the given arguments. */ - protected PStmtKey createKey(String sql, int columnIndexes[]) { - return new PStmtKey(normalizeSQL(sql), columnIndexes); + protected PStmtKeyCPDS createKey(String sql, int columnIndexes[]) { + return new PStmtKeyCPDS(normalizeSQL(sql), columnIndexes); } /** * Create a {*link PooledConnectionImpl.PStmtKey} for the given arguments. */ - protected PStmtKey createKey(String sql, String columnNames[]) { - return new PStmtKey(normalizeSQL(sql), columnNames); + protected PStmtKeyCPDS createKey(String sql, String columnNames[]) { + return new PStmtKeyCPDS(normalizeSQL(sql), columnNames); } /** * Create a {*link PooledConnectionImpl.PStmtKey} for the given arguments. */ - protected PStmtKey createKey(String sql, int resultSetType, + protected PStmtKeyCPDS createKey(String sql, int resultSetType, int resultSetConcurrency) { - return new PStmtKey(normalizeSQL(sql), resultSetType, + return new PStmtKeyCPDS(normalizeSQL(sql), resultSetType, resultSetConcurrency); } /** * Create a {*link PooledConnectionImpl.PStmtKey} for the given arguments. */ - protected PStmtKey createKey(String sql) { - return new PStmtKey(normalizeSQL(sql)); + protected PStmtKeyCPDS createKey(String sql) { + return new PStmtKeyCPDS(normalizeSQL(sql)); } /** @@ -426,7 +426,7 @@ class PooledConnectionImpl implements Po * @param obj the key for the {*link PreparedStatement} to be created */ @Override - public PoolablePreparedStatementStub makeObject(PStmtKey key) throws Exception { + public PoolablePreparedStatementStub makeObject(PStmtKeyCPDS key) throws Exception { if (null == key) { throw new IllegalArgumentException(); } else { @@ -460,7 +460,7 @@ class PooledConnectionImpl implements Po * @param obj the {*link PreparedStatement} to be destroyed. */ @Override - public void destroyObject(PStmtKey key, PoolablePreparedStatementStub ppss) + public void destroyObject(PStmtKeyCPDS key, PoolablePreparedStatementStub ppss) throws Exception { ppss.getInnermostDelegate().close(); } @@ -473,7 +473,7 @@ class PooledConnectionImpl implements Po * @return <tt>true</tt> */ @Override - public boolean validateObject(PStmtKey key, PoolablePreparedStatementStub ppss) { + public boolean validateObject(PStmtKeyCPDS key, PoolablePreparedStatementStub ppss) { return true; } @@ -484,7 +484,7 @@ class PooledConnectionImpl implements Po * @param obj ignored */ @Override - public void activateObject(PStmtKey key, PoolablePreparedStatementStub ppss) + public void activateObject(PStmtKeyCPDS key, PoolablePreparedStatementStub ppss) throws Exception { ppss.activate(); } @@ -496,7 +496,7 @@ class PooledConnectionImpl implements Po * @param obj a {*link PreparedStatement} */ @Override - public void passivateObject(PStmtKey key, PoolablePreparedStatementStub ppss) + public void passivateObject(PStmtKeyCPDS key, PoolablePreparedStatementStub ppss) throws Exception { ppss.clearParameters(); ppss.passivate();