Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java Mon Feb 8 21:58:41 2016 @@ -121,7 +121,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getBlockWhenExhausted()} for the * specified user's pool or the default if no user specific value is defined. */ - public boolean getPerUserBlockWhenExhausted(String key) { + public boolean getPerUserBlockWhenExhausted(final String key) { Boolean value = null; if (perUserBlockWhenExhausted != null) { value = perUserBlockWhenExhausted.get(key); @@ -137,8 +137,8 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getBlockWhenExhausted()} for the specified * user's pool. */ - public void setPerUserBlockWhenExhausted(String username, - Boolean value) { + public void setPerUserBlockWhenExhausted(final String username, + final Boolean value) { assertInitializationAllowed(); if (perUserBlockWhenExhausted == null) { perUserBlockWhenExhausted = new HashMap<>(); @@ -147,7 +147,7 @@ public class PerUserPoolDataSource exten } void setPerUserBlockWhenExhausted( - Map<String,Boolean> userDefaultBlockWhenExhausted) { + final Map<String,Boolean> userDefaultBlockWhenExhausted) { assertInitializationAllowed(); if (perUserBlockWhenExhausted == null) { perUserBlockWhenExhausted = new HashMap<>(); @@ -163,7 +163,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getEvictionPolicyClassName()} for the * specified user's pool or the default if no user specific value is defined. */ - public String getPerUserEvictionPolicyClassName(String key) { + public String getPerUserEvictionPolicyClassName(final String key) { String value = null; if (perUserEvictionPolicyClassName != null) { value = perUserEvictionPolicyClassName.get(key); @@ -179,8 +179,8 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getEvictionPolicyClassName()} for the specified * user's pool. */ - public void setPerUserEvictionPolicyClassName(String username, - String value) { + public void setPerUserEvictionPolicyClassName(final String username, + final String value) { assertInitializationAllowed(); if (perUserEvictionPolicyClassName == null) { perUserEvictionPolicyClassName = new HashMap<>(); @@ -189,7 +189,7 @@ public class PerUserPoolDataSource exten } void setPerUserEvictionPolicyClassName( - Map<String,String> userDefaultEvictionPolicyClassName) { + final Map<String,String> userDefaultEvictionPolicyClassName) { assertInitializationAllowed(); if (perUserEvictionPolicyClassName == null) { perUserEvictionPolicyClassName = new HashMap<>(); @@ -205,7 +205,7 @@ public class PerUserPoolDataSource exten * the specified user's pool or the default if no user specific value is * defined. */ - public boolean getPerUserLifo(String key) { + public boolean getPerUserLifo(final String key) { Boolean value = null; if (perUserLifo != null) { value = perUserLifo.get(key); @@ -221,7 +221,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getLifo()} for the specified * user's pool. */ - public void setPerUserLifo(String username, Boolean value) { + public void setPerUserLifo(final String username, final Boolean value) { assertInitializationAllowed(); if (perUserLifo == null) { perUserLifo = new HashMap<>(); @@ -229,7 +229,7 @@ public class PerUserPoolDataSource exten perUserLifo.put(username, value); } - void setPerUserLifo(Map<String,Boolean> userDefaultLifo) { + void setPerUserLifo(final Map<String,Boolean> userDefaultLifo) { assertInitializationAllowed(); if (perUserLifo == null) { perUserLifo = new HashMap<>(); @@ -245,7 +245,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getMaxIdle()} for the * specified user's pool or the default if no user specific value is defined. */ - public int getPerUserMaxIdle(String key) { + public int getPerUserMaxIdle(final String key) { Integer value = null; if (perUserMaxIdle != null) { value = perUserMaxIdle.get(key); @@ -261,7 +261,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getMaxIdle()} for the specified * user's pool. */ - public void setPerUserMaxIdle(String username, Integer value) { + public void setPerUserMaxIdle(final String username, final Integer value) { assertInitializationAllowed(); if (perUserMaxIdle == null) { perUserMaxIdle = new HashMap<>(); @@ -269,7 +269,7 @@ public class PerUserPoolDataSource exten perUserMaxIdle.put(username, value); } - void setPerUserMaxIdle(Map<String,Integer> userDefaultMaxIdle) { + void setPerUserMaxIdle(final Map<String,Integer> userDefaultMaxIdle) { assertInitializationAllowed(); if (perUserMaxIdle == null) { perUserMaxIdle = new HashMap<>(); @@ -285,7 +285,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getMaxTotal()} for the * specified user's pool or the default if no user specific value is defined. */ - public int getPerUserMaxTotal(String key) { + public int getPerUserMaxTotal(final String key) { Integer value = null; if (perUserMaxTotal != null) { value = perUserMaxTotal.get(key); @@ -301,7 +301,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getMaxTotal()} for the specified * user's pool. */ - public void setPerUserMaxTotal(String username, Integer value) { + public void setPerUserMaxTotal(final String username, final Integer value) { assertInitializationAllowed(); if (perUserMaxTotal == null) { perUserMaxTotal = new HashMap<>(); @@ -309,7 +309,7 @@ public class PerUserPoolDataSource exten perUserMaxTotal.put(username, value); } - void setPerUserMaxTotal(Map<String,Integer> userDefaultMaxTotal) { + void setPerUserMaxTotal(final Map<String,Integer> userDefaultMaxTotal) { assertInitializationAllowed(); if (perUserMaxTotal == null) { perUserMaxTotal = new HashMap<>(); @@ -325,7 +325,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getMaxWaitMillis()} for the * specified user's pool or the default if no user specific value is defined. */ - public long getPerUserMaxWaitMillis(String key) { + public long getPerUserMaxWaitMillis(final String key) { Long value = null; if (perUserMaxWaitMillis != null) { value = perUserMaxWaitMillis.get(key); @@ -341,7 +341,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getMaxWaitMillis()} for the specified * user's pool. */ - public void setPerUserMaxWaitMillis(String username, Long value) { + public void setPerUserMaxWaitMillis(final String username, final Long value) { assertInitializationAllowed(); if (perUserMaxWaitMillis == null) { perUserMaxWaitMillis = new HashMap<>(); @@ -350,7 +350,7 @@ public class PerUserPoolDataSource exten } void setPerUserMaxWaitMillis( - Map<String,Long> userDefaultMaxWaitMillis) { + final Map<String,Long> userDefaultMaxWaitMillis) { assertInitializationAllowed(); if (perUserMaxWaitMillis == null) { perUserMaxWaitMillis = new HashMap<>(); @@ -366,7 +366,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getMinEvictableIdleTimeMillis()} for the * specified user's pool or the default if no user specific value is defined. */ - public long getPerUserMinEvictableIdleTimeMillis(String key) { + public long getPerUserMinEvictableIdleTimeMillis(final String key) { Long value = null; if (perUserMinEvictableIdleTimeMillis != null) { value = perUserMinEvictableIdleTimeMillis.get(key); @@ -382,8 +382,8 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getMinEvictableIdleTimeMillis()} for the * specified user's pool. */ - public void setPerUserMinEvictableIdleTimeMillis(String username, - Long value) { + public void setPerUserMinEvictableIdleTimeMillis(final String username, + final Long value) { assertInitializationAllowed(); if (perUserMinEvictableIdleTimeMillis == null) { perUserMinEvictableIdleTimeMillis = new HashMap<>(); @@ -392,7 +392,7 @@ public class PerUserPoolDataSource exten } void setPerUserMinEvictableIdleTimeMillis( - Map<String,Long> userDefaultMinEvictableIdleTimeMillis) { + final Map<String,Long> userDefaultMinEvictableIdleTimeMillis) { assertInitializationAllowed(); if (perUserMinEvictableIdleTimeMillis == null) { perUserMinEvictableIdleTimeMillis = new HashMap<>(); @@ -409,7 +409,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getMinIdle()} for the * specified user's pool or the default if no user specific value is defined. */ - public int getPerUserMinIdle(String key) { + public int getPerUserMinIdle(final String key) { Integer value = null; if (perUserMinIdle != null) { value = perUserMinIdle.get(key); @@ -425,7 +425,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getMinIdle()} for the specified * user's pool. */ - public void setPerUserMinIdle(String username, Integer value) { + public void setPerUserMinIdle(final String username, final Integer value) { assertInitializationAllowed(); if (perUserMinIdle == null) { perUserMinIdle = new HashMap<>(); @@ -433,7 +433,7 @@ public class PerUserPoolDataSource exten perUserMinIdle.put(username, value); } - void setPerUserMinIdle(Map<String,Integer> userDefaultMinIdle) { + void setPerUserMinIdle(final Map<String,Integer> userDefaultMinIdle) { assertInitializationAllowed(); if (perUserMinIdle == null) { perUserMinIdle = new HashMap<>(); @@ -449,7 +449,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getNumTestsPerEvictionRun()} for the * specified user's pool or the default if no user specific value is defined. */ - public int getPerUserNumTestsPerEvictionRun(String key) { + public int getPerUserNumTestsPerEvictionRun(final String key) { Integer value = null; if (perUserNumTestsPerEvictionRun != null) { value = perUserNumTestsPerEvictionRun.get(key); @@ -465,8 +465,8 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getNumTestsPerEvictionRun()} for the specified * user's pool. */ - public void setPerUserNumTestsPerEvictionRun(String username, - Integer value) { + public void setPerUserNumTestsPerEvictionRun(final String username, + final Integer value) { assertInitializationAllowed(); if (perUserNumTestsPerEvictionRun == null) { perUserNumTestsPerEvictionRun = new HashMap<>(); @@ -475,7 +475,7 @@ public class PerUserPoolDataSource exten } void setPerUserNumTestsPerEvictionRun( - Map<String,Integer> userDefaultNumTestsPerEvictionRun) { + final Map<String,Integer> userDefaultNumTestsPerEvictionRun) { assertInitializationAllowed(); if (perUserNumTestsPerEvictionRun == null) { perUserNumTestsPerEvictionRun = new HashMap<>(); @@ -491,7 +491,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getSoftMinEvictableIdleTimeMillis()} for the * specified user's pool or the default if no user specific value is defined. */ - public long getPerUserSoftMinEvictableIdleTimeMillis(String key) { + public long getPerUserSoftMinEvictableIdleTimeMillis(final String key) { Long value = null; if (perUserSoftMinEvictableIdleTimeMillis != null) { value = perUserSoftMinEvictableIdleTimeMillis.get(key); @@ -507,8 +507,8 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getSoftMinEvictableIdleTimeMillis()} for the * specified user's pool. */ - public void setPerUserSoftMinEvictableIdleTimeMillis(String username, - Long value) { + public void setPerUserSoftMinEvictableIdleTimeMillis(final String username, + final Long value) { assertInitializationAllowed(); if (perUserSoftMinEvictableIdleTimeMillis == null) { perUserSoftMinEvictableIdleTimeMillis = new HashMap<>(); @@ -517,7 +517,7 @@ public class PerUserPoolDataSource exten } void setPerUserSoftMinEvictableIdleTimeMillis( - Map<String,Long> userDefaultSoftMinEvictableIdleTimeMillis) { + final Map<String,Long> userDefaultSoftMinEvictableIdleTimeMillis) { assertInitializationAllowed(); if (perUserSoftMinEvictableIdleTimeMillis == null) { perUserSoftMinEvictableIdleTimeMillis = new HashMap<>(); @@ -533,7 +533,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getTestOnCreate()} for the * specified user's pool or the default if no user specific value is defined. */ - public boolean getPerUserTestOnCreate(String key) { + public boolean getPerUserTestOnCreate(final String key) { Boolean value = null; if (perUserTestOnCreate != null) { value = perUserTestOnCreate.get(key); @@ -549,7 +549,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getTestOnCreate()} for the specified * user's pool. */ - public void setPerUserTestOnCreate(String username, Boolean value) { + public void setPerUserTestOnCreate(final String username, final Boolean value) { assertInitializationAllowed(); if (perUserTestOnCreate == null) { perUserTestOnCreate = new HashMap<>(); @@ -557,7 +557,7 @@ public class PerUserPoolDataSource exten perUserTestOnCreate.put(username, value); } - void setPerUserTestOnCreate(Map<String,Boolean> userDefaultTestOnCreate) { + void setPerUserTestOnCreate(final Map<String,Boolean> userDefaultTestOnCreate) { assertInitializationAllowed(); if (perUserTestOnCreate == null) { perUserTestOnCreate = new HashMap<>(); @@ -573,7 +573,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getTestOnBorrow()} for the * specified user's pool or the default if no user specific value is defined. */ - public boolean getPerUserTestOnBorrow(String key) { + public boolean getPerUserTestOnBorrow(final String key) { Boolean value = null; if (perUserTestOnBorrow != null) { value = perUserTestOnBorrow.get(key); @@ -589,7 +589,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getTestOnBorrow()} for the specified * user's pool. */ - public void setPerUserTestOnBorrow(String username, Boolean value) { + public void setPerUserTestOnBorrow(final String username, final Boolean value) { assertInitializationAllowed(); if (perUserTestOnBorrow == null) { perUserTestOnBorrow = new HashMap<>(); @@ -597,7 +597,7 @@ public class PerUserPoolDataSource exten perUserTestOnBorrow.put(username, value); } - void setPerUserTestOnBorrow(Map<String,Boolean> userDefaultTestOnBorrow) { + void setPerUserTestOnBorrow(final Map<String,Boolean> userDefaultTestOnBorrow) { assertInitializationAllowed(); if (perUserTestOnBorrow == null) { perUserTestOnBorrow = new HashMap<>(); @@ -613,7 +613,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getTestOnReturn()} for the * specified user's pool or the default if no user specific value is defined. */ - public boolean getPerUserTestOnReturn(String key) { + public boolean getPerUserTestOnReturn(final String key) { Boolean value = null; if (perUserTestOnReturn != null) { value = perUserTestOnReturn.get(key); @@ -629,7 +629,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getTestOnReturn()} for the specified * user's pool. */ - public void setPerUserTestOnReturn(String username, Boolean value) { + public void setPerUserTestOnReturn(final String username, final Boolean value) { assertInitializationAllowed(); if (perUserTestOnReturn == null) { perUserTestOnReturn = new HashMap<>(); @@ -638,7 +638,7 @@ public class PerUserPoolDataSource exten } void setPerUserTestOnReturn( - Map<String,Boolean> userDefaultTestOnReturn) { + final Map<String,Boolean> userDefaultTestOnReturn) { assertInitializationAllowed(); if (perUserTestOnReturn == null) { perUserTestOnReturn = new HashMap<>(); @@ -654,7 +654,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getTestWhileIdle()} for the * specified user's pool or the default if no user specific value is defined. */ - public boolean getPerUserTestWhileIdle(String key) { + public boolean getPerUserTestWhileIdle(final String key) { Boolean value = null; if (perUserTestWhileIdle != null) { value = perUserTestWhileIdle.get(key); @@ -670,7 +670,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getTestWhileIdle()} for the specified * user's pool. */ - public void setPerUserTestWhileIdle(String username, Boolean value) { + public void setPerUserTestWhileIdle(final String username, final Boolean value) { assertInitializationAllowed(); if (perUserTestWhileIdle == null) { perUserTestWhileIdle = new HashMap<>(); @@ -679,7 +679,7 @@ public class PerUserPoolDataSource exten } void setPerUserTestWhileIdle( - Map<String,Boolean> userDefaultTestWhileIdle) { + final Map<String,Boolean> userDefaultTestWhileIdle) { assertInitializationAllowed(); if (perUserTestWhileIdle == null) { perUserTestWhileIdle = new HashMap<>(); @@ -695,7 +695,7 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getTimeBetweenEvictionRunsMillis()} for the * specified user's pool or the default if no user specific value is defined. */ - public long getPerUserTimeBetweenEvictionRunsMillis(String key) { + public long getPerUserTimeBetweenEvictionRunsMillis(final String key) { Long value = null; if (perUserTimeBetweenEvictionRunsMillis != null) { value = perUserTimeBetweenEvictionRunsMillis.get(key); @@ -711,8 +711,8 @@ public class PerUserPoolDataSource exten * {@link GenericObjectPool#getTimeBetweenEvictionRunsMillis ()} for the specified * user's pool. */ - public void setPerUserTimeBetweenEvictionRunsMillis(String username, - Long value) { + public void setPerUserTimeBetweenEvictionRunsMillis(final String username, + final Long value) { assertInitializationAllowed(); if (perUserTimeBetweenEvictionRunsMillis == null) { perUserTimeBetweenEvictionRunsMillis = new HashMap<>(); @@ -721,7 +721,7 @@ public class PerUserPoolDataSource exten } void setPerUserTimeBetweenEvictionRunsMillis( - Map<String,Long> userDefaultTimeBetweenEvictionRunsMillis ) { + final Map<String,Long> userDefaultTimeBetweenEvictionRunsMillis ) { assertInitializationAllowed(); if (perUserTimeBetweenEvictionRunsMillis == null) { perUserTimeBetweenEvictionRunsMillis = new HashMap<>(); @@ -737,7 +737,7 @@ public class PerUserPoolDataSource exten * Gets the user specific default value for * {@link Connection#setAutoCommit(boolean)} for the specified user's pool. */ - public Boolean getPerUserDefaultAutoCommit(String key) { + public Boolean getPerUserDefaultAutoCommit(final String key) { Boolean value = null; if (perUserDefaultAutoCommit != null) { value = perUserDefaultAutoCommit.get(key); @@ -749,7 +749,7 @@ public class PerUserPoolDataSource exten * Sets a user specific default value for * {@link Connection#setAutoCommit(boolean)} for the specified user's pool. */ - public void setPerUserDefaultAutoCommit(String username, Boolean value) { + public void setPerUserDefaultAutoCommit(final String username, final Boolean value) { assertInitializationAllowed(); if (perUserDefaultAutoCommit == null) { perUserDefaultAutoCommit = new HashMap<>(); @@ -757,7 +757,7 @@ public class PerUserPoolDataSource exten perUserDefaultAutoCommit.put(username, value); } - void setPerUserDefaultAutoCommit(Map<String,Boolean> userDefaultAutoCommit) { + void setPerUserDefaultAutoCommit(final Map<String,Boolean> userDefaultAutoCommit) { assertInitializationAllowed(); if (perUserDefaultAutoCommit == null) { perUserDefaultAutoCommit = new HashMap<>(); @@ -772,7 +772,7 @@ public class PerUserPoolDataSource exten * Gets the user specific default value for * {@link Connection#setReadOnly(boolean)} for the specified user's pool. */ - public Boolean getPerUserDefaultReadOnly(String key) { + public Boolean getPerUserDefaultReadOnly(final String key) { Boolean value = null; if (perUserDefaultReadOnly != null) { value = perUserDefaultReadOnly.get(key); @@ -784,7 +784,7 @@ public class PerUserPoolDataSource exten * Sets a user specific default value for * {@link Connection#setReadOnly(boolean)} for the specified user's pool. */ - public void setPerUserDefaultReadOnly(String username, Boolean value) { + public void setPerUserDefaultReadOnly(final String username, final Boolean value) { assertInitializationAllowed(); if (perUserDefaultReadOnly == null) { perUserDefaultReadOnly = new HashMap<>(); @@ -792,7 +792,7 @@ public class PerUserPoolDataSource exten perUserDefaultReadOnly.put(username, value); } - void setPerUserDefaultReadOnly(Map<String,Boolean> userDefaultReadOnly) { + void setPerUserDefaultReadOnly(final Map<String,Boolean> userDefaultReadOnly) { assertInitializationAllowed(); if (perUserDefaultReadOnly == null) { perUserDefaultReadOnly = new HashMap<>(); @@ -807,7 +807,7 @@ public class PerUserPoolDataSource exten * Gets the user specific default value for * {@link Connection#setTransactionIsolation(int)} for the specified user's pool. */ - public Integer getPerUserDefaultTransactionIsolation(String key) { + public Integer getPerUserDefaultTransactionIsolation(final String key) { Integer value = null; if (perUserDefaultTransactionIsolation != null) { value = perUserDefaultTransactionIsolation.get(key); @@ -819,8 +819,8 @@ public class PerUserPoolDataSource exten * Sets a user specific default value for * {@link Connection#setTransactionIsolation(int)} for the specified user's pool. */ - public void setPerUserDefaultTransactionIsolation(String username, - Integer value) { + public void setPerUserDefaultTransactionIsolation(final String username, + final Integer value) { assertInitializationAllowed(); if (perUserDefaultTransactionIsolation == null) { perUserDefaultTransactionIsolation = new HashMap<>(); @@ -829,7 +829,7 @@ public class PerUserPoolDataSource exten } void setPerUserDefaultTransactionIsolation( - Map<String,Integer> userDefaultTransactionIsolation) { + final Map<String,Integer> userDefaultTransactionIsolation) { assertInitializationAllowed(); if (perUserDefaultTransactionIsolation == null) { perUserDefaultTransactionIsolation = new HashMap<>(); @@ -853,7 +853,7 @@ public class PerUserPoolDataSource exten /** * Get the number of active connections in the pool for a given user. */ - public int getNumActive(String username) { + public int getNumActive(final String username) { final ObjectPool<PooledConnectionAndInfo> pool = getPool(getPoolKey(username)); return pool == null ? 0 : pool.getNumActive(); @@ -869,7 +869,7 @@ public class PerUserPoolDataSource exten /** * Get the number of idle connections in the pool for a given user. */ - public int getNumIdle(String username) { + public int getNumIdle(final String username) { final ObjectPool<PooledConnectionAndInfo> pool = getPool(getPoolKey(username)); return pool == null ? 0 : pool.getNumIdle(); @@ -881,7 +881,7 @@ public class PerUserPoolDataSource exten @Override protected PooledConnectionAndInfo - getPooledConnectionAndInfo(String username, String password) + getPooledConnectionAndInfo(final String username, final String password) throws SQLException { final PoolKey key = getPoolKey(username); @@ -938,7 +938,7 @@ public class PerUserPoolDataSource exten } @Override - protected void setupDefaults(Connection con, String username) + protected void setupDefaults(final Connection con, final String username) throws SQLException { Boolean defaultAutoCommit = isDefaultAutoCommit(); if (username != null) { @@ -980,7 +980,7 @@ public class PerUserPoolDataSource exten } @Override - protected PooledConnectionManager getConnectionManager(UserPassKey upkey) { + protected PooledConnectionManager getConnectionManager(final UserPassKey upkey) { return managers.get(getPoolKey(upkey.getUsername())); } @@ -1001,11 +1001,11 @@ public class PerUserPoolDataSource exten * @param username User name * @return The pool key */ - private PoolKey getPoolKey(String username) { + private PoolKey getPoolKey(final String username) { return new PoolKey(getDataSourceName(), username); } - private synchronized void registerPool(String username, String password) + private synchronized void registerPool(final String username, final String password) throws NamingException, SQLException { final ConnectionPoolDataSource cpds = testCPDS(username, password); @@ -1058,7 +1058,7 @@ public class PerUserPoolDataSource exten * @exception IOException if an error occurs * @exception ClassNotFoundException if an error occurs */ - private void readObject(ObjectInputStream in) + private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { try { @@ -1081,7 +1081,7 @@ public class PerUserPoolDataSource exten * @return the GenericObjectPool pooling connections for the username and datasource * specified by the PoolKey */ - private ObjectPool<PooledConnectionAndInfo> getPool(PoolKey key) { + private ObjectPool<PooledConnectionAndInfo> getPool(final PoolKey key) { final CPDSConnectionFactory mgr = (CPDSConnectionFactory) managers.get(key); return mgr == null ? null : mgr.getPool(); }
Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSourceFactory.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSourceFactory.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSourceFactory.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSourceFactory.java Mon Feb 8 21:58:41 2016 @@ -36,13 +36,13 @@ public class PerUserPoolDataSourceFactor PerUserPoolDataSource.class.getName(); @Override - protected boolean isCorrectClass(String className) { + protected boolean isCorrectClass(final String className) { return PER_USER_POOL_CLASSNAME.equals(className); } @SuppressWarnings("unchecked") // Avoid warnings on deserialization @Override - protected InstanceKeyDataSource getNewInstance(Reference ref) + protected InstanceKeyDataSource getNewInstance(final Reference ref) throws IOException, ClassNotFoundException { final PerUserPoolDataSource pupds = new PerUserPoolDataSource(); RefAddr ra = ref.get("defaultMaxTotal"); Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PoolKey.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PoolKey.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PoolKey.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PoolKey.java Mon Feb 8 21:58:41 2016 @@ -29,13 +29,13 @@ class PoolKey implements Serializable { private final String datasourceName; private final String username; - PoolKey(String datasourceName, String username) { + PoolKey(final String datasourceName, final String username) { this.datasourceName = datasourceName; this.username = username; } @Override - public boolean equals(Object obj) { + public boolean equals(final Object obj) { if (obj instanceof PoolKey) { final PoolKey pk = (PoolKey)obj; return (null == datasourceName ? null == pk.datasourceName : datasourceName.equals(pk.datasourceName)) && Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java Mon Feb 8 21:58:41 2016 @@ -32,7 +32,7 @@ final class PooledConnectionAndInfo { private final String username; private final UserPassKey upkey; - PooledConnectionAndInfo(PooledConnection pc, String username, String password) { + PooledConnectionAndInfo(final PooledConnection pc, final String username, final String password) { this.pooledConnection = pc; this.username = username; this.password = password; Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java Mon Feb 8 21:58:41 2016 @@ -91,7 +91,7 @@ public class SharedPoolDataSource extend /** * Get {@link GenericKeyedObjectPool#getMaxTotal()} for this pool. */ - public void setMaxTotal(int maxTotal) { + public void setMaxTotal(final int maxTotal) { assertInitializationAllowed(); this.maxTotal = maxTotal; } @@ -119,7 +119,7 @@ public class SharedPoolDataSource extend @Override protected PooledConnectionAndInfo - getPooledConnectionAndInfo(String username, String password) + getPooledConnectionAndInfo(final String username, final String password) throws SQLException { synchronized(this) { @@ -147,7 +147,7 @@ public class SharedPoolDataSource extend } @Override - protected PooledConnectionManager getConnectionManager(UserPassKey upkey) { + protected PooledConnectionManager getConnectionManager(final UserPassKey upkey) { return factory; } @@ -162,7 +162,7 @@ public class SharedPoolDataSource extend return ref; } - private void registerPool(String username, String password) + private void registerPool(final String username, final String password) throws NamingException, SQLException { final ConnectionPoolDataSource cpds = testCPDS(username, password); @@ -201,7 +201,7 @@ public class SharedPoolDataSource extend } @Override - protected void setupDefaults(Connection con, String username) throws SQLException { + protected void setupDefaults(final Connection con, final String username) throws SQLException { final Boolean defaultAutoCommit = isDefaultAutoCommit(); if (defaultAutoCommit != null && con.getAutoCommit() != defaultAutoCommit.booleanValue()) { @@ -227,7 +227,7 @@ public class SharedPoolDataSource extend * @exception IOException if an error occurs * @exception ClassNotFoundException if an error occurs */ - private void readObject(ObjectInputStream in) + private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { try { Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSourceFactory.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSourceFactory.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSourceFactory.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSourceFactory.java Mon Feb 8 21:58:41 2016 @@ -32,12 +32,12 @@ public class SharedPoolDataSourceFactory SharedPoolDataSource.class.getName(); @Override - protected boolean isCorrectClass(String className) { + protected boolean isCorrectClass(final String className) { return SHARED_POOL_CLASSNAME.equals(className); } @Override - protected InstanceKeyDataSource getNewInstance(Reference ref) { + protected InstanceKeyDataSource getNewInstance(final Reference ref) { final SharedPoolDataSource spds = new SharedPoolDataSource(); final RefAddr ra = ref.get("maxTotal"); if (ra != null && ra.getContent() != null) { Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/UserPassKey.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/UserPassKey.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/UserPassKey.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/UserPassKey.java Mon Feb 8 21:58:41 2016 @@ -36,7 +36,7 @@ class UserPassKey implements Serializabl private final String password; private final String username; - UserPassKey(String username, String password) { + UserPassKey(final String username, final String password) { this.username = username; this.password = password; } @@ -65,7 +65,7 @@ class UserPassKey implements Serializabl * @see java.lang.Object#equals(java.lang.Object) */ @Override - public boolean equals(Object obj) { + public boolean equals(final Object obj) { if (obj == null) { return false; } Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java Mon Feb 8 21:58:41 2016 @@ -82,7 +82,7 @@ public class BasicManagedDataSource exte * * @param xaDataSourceInstance XADataSource instance */ - public synchronized void setXaDataSourceInstance(XADataSource xaDataSourceInstance) { + public synchronized void setXaDataSourceInstance(final XADataSource xaDataSourceInstance) { this.xaDataSourceInstance = xaDataSourceInstance; xaDataSource = xaDataSourceInstance == null ? null : xaDataSourceInstance.getClass().getName(); } @@ -107,7 +107,7 @@ public class BasicManagedDataSource exte * Sets the required transaction manager property. * @param transactionManager the transaction manager used to enlist connections */ - public void setTransactionManager(TransactionManager transactionManager) { + public void setTransactionManager(final TransactionManager transactionManager) { this.transactionManager = transactionManager; } @@ -123,7 +123,7 @@ public class BasicManagedDataSource exte * Sets the optional XADataSource class name. * @param xaDataSource the optional XADataSource class name */ - public synchronized void setXADataSource(String xaDataSource) { + public synchronized void setXADataSource(final String xaDataSource) { this.xaDataSource = xaDataSource; } @@ -181,7 +181,7 @@ public class BasicManagedDataSource exte */ @Override protected PoolableConnectionFactory createPoolableConnectionFactory( - ConnectionFactory driverConnectionFactory) throws SQLException { + final ConnectionFactory driverConnectionFactory) throws SQLException { PoolableConnectionFactory connectionFactory = null; try { connectionFactory = new PoolableManagedConnectionFactory( Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/DataSourceXAConnectionFactory.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/DataSourceXAConnectionFactory.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/DataSourceXAConnectionFactory.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/DataSourceXAConnectionFactory.java Mon Feb 8 21:58:41 2016 @@ -48,7 +48,7 @@ public class DataSourceXAConnectionFacto * @param transactionManager the transaction manager in which connections will be enlisted * @param xaDataSource the data source from which connections will be retrieved */ - public DataSourceXAConnectionFactory(TransactionManager transactionManager, XADataSource xaDataSource) { + public DataSourceXAConnectionFactory(final TransactionManager transactionManager, final XADataSource xaDataSource) { this(transactionManager, xaDataSource, null, null); } @@ -61,7 +61,7 @@ public class DataSourceXAConnectionFacto * @param username the username used for authenticating new connections or null for unauthenticated * @param password the password used for authenticating new connections */ - public DataSourceXAConnectionFactory(TransactionManager transactionManager, XADataSource xaDataSource, String username, String password) { + public DataSourceXAConnectionFactory(final TransactionManager transactionManager, final XADataSource xaDataSource, final String username, final String password) { if (transactionManager == null) { throw new NullPointerException("transactionManager is null"); } @@ -87,7 +87,7 @@ public class DataSourceXAConnectionFacto * Sets the username used to authenticate new connections. * @param username the username used for authenticating the connection or null for unauthenticated */ - public void setUsername(String username) { + public void setUsername(final String username) { this.username = username; } @@ -95,7 +95,7 @@ public class DataSourceXAConnectionFacto * Sets the password used to authenticate new connections. * @param password the password used for authenticating the connection or null for unauthenticated */ - public void setPassword(String password) { + public void setPassword(final String password) { this.password = password; } @@ -127,7 +127,7 @@ public class DataSourceXAConnectionFacto xaConnection.addConnectionEventListener(new ConnectionEventListener() { @Override - public void connectionClosed(ConnectionEvent event) { + public void connectionClosed(final ConnectionEvent event) { final PooledConnection pc = (PooledConnection) event.getSource(); pc.removeConnectionEventListener(this); try { @@ -139,7 +139,7 @@ public class DataSourceXAConnectionFacto } @Override - public void connectionErrorOccurred(ConnectionEvent event) { + public void connectionErrorOccurred(final ConnectionEvent event) { connectionClosed(event); } }); Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java Mon Feb 8 21:58:41 2016 @@ -46,7 +46,7 @@ public class LocalXAConnectionFactory im * @param transactionManager the transaction manager in which connections will be enlisted * @param connectionFactory the connection factory from which connections will be retrieved */ - public LocalXAConnectionFactory(TransactionManager transactionManager, ConnectionFactory connectionFactory) { + public LocalXAConnectionFactory(final TransactionManager transactionManager, final ConnectionFactory connectionFactory) { if (transactionManager == null) { throw new NullPointerException("transactionManager is null"); } @@ -95,7 +95,7 @@ public class LocalXAConnectionFactory im private Xid currentXid; // @GuardedBy("this") private boolean originalAutoCommit; // @GuardedBy("this") - public LocalXAResource(Connection localTransaction) { + public LocalXAResource(final Connection localTransaction) { this.connection = localTransaction; } @@ -119,7 +119,7 @@ public class LocalXAConnectionFactory im * could not be disabled */ @Override - public synchronized void start(Xid xid, int flag) throws XAException { + public synchronized void start(final Xid xid, final int flag) throws XAException { if (flag == XAResource.TMNOFLAGS) { // first time in this transaction @@ -161,7 +161,7 @@ public class LocalXAConnectionFactory im * @throws XAException if the connection is already enlisted in another transaction */ @Override - public synchronized void end(Xid xid, int flag) throws XAException { + public synchronized void end(final Xid xid, final int flag) throws XAException { if (xid == null) { throw new NullPointerException("xid is null"); } @@ -184,7 +184,7 @@ public class LocalXAConnectionFactory im * @return XAResource.XA_RDONLY if the connection.isReadOnly(); XAResource.XA_OK otherwise */ @Override - public synchronized int prepare(Xid xid) { + public synchronized int prepare(final Xid xid) { // if the connection is read-only, then the resource is read-only // NOTE: this assumes that the outer proxy throws an exception when application code // attempts to set this in a transaction @@ -212,7 +212,7 @@ public class LocalXAConnectionFactory im * @throws XAException if connection.commit() throws a SQLException */ @Override - public synchronized void commit(Xid xid, boolean flag) throws XAException { + public synchronized void commit(final Xid xid, final boolean flag) throws XAException { if (xid == null) { throw new NullPointerException("xid is null"); } @@ -252,7 +252,7 @@ public class LocalXAConnectionFactory im * @throws XAException if connection.rollback() throws a SQLException */ @Override - public synchronized void rollback(Xid xid) throws XAException { + public synchronized void rollback(final Xid xid) throws XAException { if (xid == null) { throw new NullPointerException("xid is null"); } @@ -280,7 +280,7 @@ public class LocalXAConnectionFactory im * @return true if the specified XAResource == this XAResource; false otherwise */ @Override - public boolean isSameRM(XAResource xaResource) { + public boolean isSameRM(final XAResource xaResource) { return this == xaResource; } @@ -290,7 +290,7 @@ public class LocalXAConnectionFactory im * @param xid the id of the transaction to forget */ @Override - public synchronized void forget(Xid xid) { + public synchronized void forget(final Xid xid) { if (xid != null && xid.equals(currentXid)) { currentXid = null; } @@ -303,7 +303,7 @@ public class LocalXAConnectionFactory im * @return always a zero length Xid array. */ @Override - public Xid[] recover(int flag) { + public Xid[] recover(final int flag) { return new Xid[0]; } @@ -324,7 +324,7 @@ public class LocalXAConnectionFactory im * @return always false */ @Override - public boolean setTransactionTimeout(int transactionTimeout) { + public boolean setTransactionTimeout(final int transactionTimeout) { return false; } } Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/ManagedConnection.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/ManagedConnection.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/ManagedConnection.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/ManagedConnection.java Mon Feb 8 21:58:41 2016 @@ -50,9 +50,9 @@ public class ManagedConnection<C extends private TransactionContext transactionContext; private boolean isSharedConnection; - public ManagedConnection(ObjectPool<C> pool, - TransactionRegistry transactionRegistry, - boolean accessToUnderlyingConnectionAllowed) throws SQLException { + public ManagedConnection(final ObjectPool<C> pool, + final TransactionRegistry transactionRegistry, + final boolean accessToUnderlyingConnectionAllowed) throws SQLException { super(null); this.pool = pool; this.transactionRegistry = transactionRegistry; @@ -179,7 +179,7 @@ public class ManagedConnection<C extends */ protected class CompletionListener implements TransactionContextListener { @Override - public void afterCompletion(TransactionContext completedContext, boolean commited) { + public void afterCompletion(final TransactionContext completedContext, final boolean commited) { if (completedContext == transactionContext) { transactionComplete(); } @@ -219,7 +219,7 @@ public class ManagedConnection<C extends // @Override - public void setAutoCommit(boolean autoCommit) throws SQLException { + public void setAutoCommit(final boolean autoCommit) throws SQLException { if (transactionContext != null) { throw new SQLException("Auto-commit can not be set while enrolled in a transaction"); } @@ -245,7 +245,7 @@ public class ManagedConnection<C extends @Override - public void setReadOnly(boolean readOnly) throws SQLException { + public void setReadOnly(final boolean readOnly) throws SQLException { if (transactionContext != null) { throw new SQLException("Read-only can not be set while enrolled in a transaction"); } Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/ManagedDataSource.java Mon Feb 8 21:58:41 2016 @@ -46,8 +46,8 @@ public class ManagedDataSource<C extends * @param transactionRegistry the transaction registry obtained from the * XAConnectionFactory used to create the connection pool object factory */ - public ManagedDataSource(ObjectPool<C> pool, - TransactionRegistry transactionRegistry) { + public ManagedDataSource(final ObjectPool<C> pool, + final TransactionRegistry transactionRegistry) { super(pool); this.transactionRegistry = transactionRegistry; } @@ -59,7 +59,7 @@ public class ManagedDataSource<C extends * @param transactionRegistry the transaction registry acquired from the XAConnectionFactory * used to create the pool */ - public void setTransactionRegistry(TransactionRegistry transactionRegistry) { + public void setTransactionRegistry(final TransactionRegistry transactionRegistry) { if(this.transactionRegistry != null) { throw new IllegalStateException("TransactionRegistry already set"); } Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/PoolableManagedConnection.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/PoolableManagedConnection.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/PoolableManagedConnection.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/PoolableManagedConnection.java Mon Feb 8 21:58:41 2016 @@ -41,8 +41,8 @@ public class PoolableManagedConnection e * @param conn underlying connection * @param pool connection pool */ - public PoolableManagedConnection(TransactionRegistry transactionRegistry, - Connection conn, ObjectPool<PoolableConnection> pool) { + public PoolableManagedConnection(final TransactionRegistry transactionRegistry, + final Connection conn, final ObjectPool<PoolableConnection> pool) { super(conn, pool, null); this.transactionRegistry = transactionRegistry; } Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/PoolableManagedConnectionFactory.java Mon Feb 8 21:58:41 2016 @@ -48,8 +48,8 @@ public class PoolableManagedConnectionFa * * @param connFactory XAConnectionFactory */ - public PoolableManagedConnectionFactory(XAConnectionFactory connFactory, - ObjectName dataSourceJmxName) { + public PoolableManagedConnectionFactory(final XAConnectionFactory connFactory, + final ObjectName dataSourceJmxName) { super(connFactory, dataSourceJmxName); this.transactionRegistry = connFactory.getTransactionRegistry(); } Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/TransactionContext.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/TransactionContext.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/TransactionContext.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/TransactionContext.java Mon Feb 8 21:58:41 2016 @@ -51,7 +51,7 @@ public class TransactionContext { * shared connection * @param transaction the transaction */ - public TransactionContext(TransactionRegistry transactionRegistry, Transaction transaction) { + public TransactionContext(final TransactionRegistry transactionRegistry, final Transaction transaction) { if (transactionRegistry == null) { throw new NullPointerException("transactionRegistry is null"); } @@ -81,7 +81,7 @@ public class TransactionContext { * could not be found in the transaction registry, or if there was a problem enlisting the * connection in the transaction */ - public void setSharedConnection(Connection sharedConnection) throws SQLException { + public void setSharedConnection(final Connection sharedConnection) throws SQLException { if (this.sharedConnection != null) { throw new IllegalStateException("A shared connection is already set"); } @@ -117,7 +117,7 @@ public class TransactionContext { } @Override - public void afterCompletion(int status) { + public void afterCompletion(final int status) { listener.afterCompletion(TransactionContext.this, status == Status.STATUS_COMMITTED); } }); Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/TransactionRegistry.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/TransactionRegistry.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/TransactionRegistry.java (original) +++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/TransactionRegistry.java Mon Feb 8 21:58:41 2016 @@ -51,7 +51,7 @@ public class TransactionRegistry { * Creates a TransactionRegistry for the specified transaction manager. * @param transactionManager the transaction manager used to enlist connections */ - public TransactionRegistry(TransactionManager transactionManager) { + public TransactionRegistry(final TransactionManager transactionManager) { this.transactionManager = transactionManager; } @@ -63,7 +63,7 @@ public class TransactionRegistry { * @param connection the JDBC connection * @param xaResource the XAResource which managed the connection within a transaction */ - public synchronized void registerConnection(Connection connection, XAResource xaResource) { + public synchronized void registerConnection(final Connection connection, final XAResource xaResource) { if (connection == null) { throw new NullPointerException("connection is null"); } @@ -79,7 +79,7 @@ public class TransactionRegistry { * @return the XAResource registered for the connection; never null * @throws SQLException if the connection does not have a registered XAResource */ - public synchronized XAResource getXAResource(Connection connection) throws SQLException { + public synchronized XAResource getXAResource(final Connection connection) throws SQLException { if (connection == null) { throw new NullPointerException("connection is null"); } @@ -130,13 +130,13 @@ public class TransactionRegistry { * Unregisters a destroyed connection from {@link TransactionRegistry} * @param connection */ - public synchronized void unregisterConnection(Connection connection) { + public synchronized void unregisterConnection(final Connection connection) { final Connection key = getConnectionKey(connection); xaResources.remove(key); } - private Connection getConnectionKey(Connection connection) { + private Connection getConnectionKey(final Connection connection) { Connection result; if (connection instanceof DelegatingConnection) { result = ((DelegatingConnection<?>) connection).getInnermostDelegateInternal(); Modified: commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/StackMessageLog.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/StackMessageLog.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/StackMessageLog.java (original) +++ commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/StackMessageLog.java Mon Feb 8 21:58:41 2016 @@ -39,7 +39,7 @@ public class StackMessageLog extends Sim private static Stack<String> messageStack = new Stack<>(); private static Lock lock = new ReentrantLock(); - public StackMessageLog(String name) { + public StackMessageLog(final String name) { super(name); } @@ -47,7 +47,7 @@ public class StackMessageLog extends Sim * Ignores type. Pushes message followed by stack trace of t onto the stack. */ @Override - protected void log(int type, Object message, Throwable t) { + protected void log(final int type, final Object message, final Throwable t) { lock.lock(); try { final StringBuffer buf = new StringBuffer(); Modified: commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestAbandonedBasicDataSource.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestAbandonedBasicDataSource.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestAbandonedBasicDataSource.java (original) +++ commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestAbandonedBasicDataSource.java Mon Feb 8 21:58:41 2016 @@ -267,7 +267,7 @@ public class TestAbandonedBasicDataSourc Assert.assertEquals(0, conn.getTrace().size()); } - private void createStatement(Connection conn) throws Exception{ + private void createStatement(final Connection conn) throws Exception{ final PreparedStatement ps = conn.prepareStatement(""); Assert.assertNotNull(ps); } @@ -276,7 +276,7 @@ public class TestAbandonedBasicDataSourc /** * Verifies that Statement executeXxx methods update lastUsed on the parent connection */ - private void checkLastUsedStatement(Statement st, DelegatingConnection<?> conn) throws Exception { + private void checkLastUsedStatement(final Statement st, final DelegatingConnection<?> conn) throws Exception { st.execute(""); assertAndReset(conn); st.execute("", new int[] {}); @@ -300,7 +300,7 @@ public class TestAbandonedBasicDataSourc /** * Verifies that PreparedStatement executeXxx methods update lastUsed on the parent connection */ - private void checkLastUsedPreparedStatement(PreparedStatement ps, DelegatingConnection<?> conn) throws Exception { + private void checkLastUsedPreparedStatement(final PreparedStatement ps, final DelegatingConnection<?> conn) throws Exception { ps.execute(); assertAndReset(conn); Assert.assertNotNull(ps.executeQuery()); @@ -312,7 +312,7 @@ public class TestAbandonedBasicDataSourc /** * Verifies that con.lastUsed has been updated and then resets it to 0 */ - private void assertAndReset(DelegatingConnection<?> con) { + private void assertAndReset(final DelegatingConnection<?> con) { assertTrue(con.getLastUsed() > 0); con.setLastUsed(0); } Modified: commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSource.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSource.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSource.java (original) +++ commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSource.java Mon Feb 8 21:58:41 2016 @@ -805,13 +805,13 @@ class TesterConnRequestCountDriver exten private static AtomicInteger connectionRequestCount = new AtomicInteger(0); @Override - public Connection connect(String url, Properties info) throws SQLException { + public Connection connect(final String url, final Properties info) throws SQLException { connectionRequestCount.incrementAndGet(); return super.connect(url, info); } @Override - public boolean acceptsURL(String url) throws SQLException { + public boolean acceptsURL(final String url) throws SQLException { return CONNECT_STRING.startsWith(url); } @@ -832,7 +832,7 @@ class TesterConnectionDelayDriver extend private static final String CONNECT_STRING = "jdbc:apache:commons:testerConnectionDelayDriver"; @Override - public Connection connect(String url, Properties info) throws SQLException { + public Connection connect(final String url, final Properties info) throws SQLException { final String[] parsedUrl = url.split(":"); final int delay = Integer.parseInt(parsedUrl[parsedUrl.length - 1]); try { @@ -844,7 +844,7 @@ class TesterConnectionDelayDriver extend } @Override - public boolean acceptsURL(String url) throws SQLException { + public boolean acceptsURL(final String url) throws SQLException { return url.startsWith(CONNECT_STRING); } Modified: commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java (original) +++ commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java Mon Feb 8 21:58:41 2016 @@ -145,7 +145,7 @@ public class TestBasicDataSourceFactory return properties; } - private void checkDataSourceProperties(BasicDataSource ds) throws Exception { + private void checkDataSourceProperties(final BasicDataSource ds) throws Exception { assertEquals("org.apache.commons.dbcp2.TesterDriver", ds.getDriverClassName()); assertEquals("jdbc:apache:commons:testdriver", ds.getUrl()); assertEquals(10, ds.getMaxTotal()); Modified: commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestConnectionPool.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestConnectionPool.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestConnectionPool.java (original) +++ commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestConnectionPool.java Mon Feb 8 21:58:41 2016 @@ -92,7 +92,7 @@ public abstract class TestConnectionPool // ----------- Utility Methods --------------------------------- - protected String getUsername(Connection conn) throws SQLException { + protected String getUsername(final Connection conn) throws SQLException { final Statement stmt = conn.createStatement(); final ResultSet rs = stmt.executeQuery("select username"); if (rs.next()) { @@ -283,7 +283,7 @@ public abstract class TestConnectionPool assertBackPointers(conn, conn.prepareCall("select * from dual", 0, 0, 0)); } - protected void assertBackPointers(Connection conn, Statement statement) throws SQLException { + protected void assertBackPointers(final Connection conn, final Statement statement) throws SQLException { assertFalse(conn.isClosed()); assertFalse(isClosed(statement)); @@ -593,11 +593,11 @@ public abstract class TestConnectionPool public TestThread() { } - public TestThread(int iter) { + public TestThread(final int iter) { _iter = iter; } - public TestThread(int iter, int delay) { + public TestThread(final int iter, final int delay) { _iter = iter; _delay = delay; } @@ -687,7 +687,7 @@ public abstract class TestConnectionPool assertTrue(conn1.hashCode() != conn2.hashCode()); } - protected boolean isClosed(Statement statement) { + protected boolean isClosed(final Statement statement) { try { statement.getWarnings(); return false; @@ -700,7 +700,7 @@ public abstract class TestConnectionPool } } - protected boolean isClosed(ResultSet resultSet) { + protected boolean isClosed(final ResultSet resultSet) { try { resultSet.getWarnings(); return false; @@ -757,13 +757,13 @@ public abstract class TestConnectionPool */ protected void multipleThreads(final int holdTime, final boolean expectError, final boolean loopOnce, - final long maxWaitMillis, int numStatements, int numThreads, long duration) throws Exception { + final long maxWaitMillis, final int numStatements, final int numThreads, final long duration) throws Exception { final long startTime = timeStamp(); final PoolTest[] pts = new PoolTest[numThreads]; // Catch Exception so we can stop all threads if one fails final ThreadGroup threadGroup = new ThreadGroup("foo") { @Override - public void uncaughtException(Thread t, Throwable e) { + public void uncaughtException(final Thread t, final Throwable e) { for (final PoolTest pt : pts) { pt.stop(); } @@ -893,15 +893,15 @@ public abstract class TestConnectionPool private final boolean loopOnce; // If true, don't repeat loop - public PoolTest(ThreadGroup threadGroup, int connHoldTime, boolean isStopOnException) { + public PoolTest(final ThreadGroup threadGroup, final int connHoldTime, final boolean isStopOnException) { this(threadGroup, connHoldTime, isStopOnException, false, 1); } - public PoolTest(ThreadGroup threadGroup, int connHoldTime, boolean isStopOnException, int numStatements) { + public PoolTest(final ThreadGroup threadGroup, final int connHoldTime, final boolean isStopOnException, final int numStatements) { this(threadGroup, connHoldTime, isStopOnException, false, numStatements); } - private PoolTest(ThreadGroup threadGroup, int connHoldTime, boolean isStopOnException, boolean once, int numStatements) { + private PoolTest(final ThreadGroup threadGroup, final int connHoldTime, final boolean isStopOnException, final boolean once, final int numStatements) { this.loopOnce = once; this.connHoldTime = connHoldTime; stopOnException = isStopOnException; Modified: commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestDelegatingStatement.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestDelegatingStatement.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestDelegatingStatement.java (original) +++ commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestDelegatingStatement.java Mon Feb 8 21:58:41 2016 @@ -93,12 +93,12 @@ public class TestDelegatingStatement { private static class TesterStatementNonWrapping extends TesterStatement { - public TesterStatementNonWrapping(Connection conn) { + public TesterStatementNonWrapping(final Connection conn) { super(conn); } @Override - public boolean isWrapperFor(Class<?> iface) throws SQLException { + public boolean isWrapperFor(final Class<?> iface) throws SQLException { return false; } } Modified: commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestDriverManagerConnectionFactory.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestDriverManagerConnectionFactory.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestDriverManagerConnectionFactory.java (original) +++ commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestDriverManagerConnectionFactory.java Mon Feb 8 21:58:41 2016 @@ -114,7 +114,7 @@ public class TestDriverManagerConnection private final DataSource ds; private volatile boolean result = true; - private ConnectionThread(DataSource ds) { + private ConnectionThread(final DataSource ds) { this.ds = ds; } Modified: commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestJndi.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestJndi.java?rev=1729277&r1=1729276&r2=1729277&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestJndi.java (original) +++ commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestJndi.java Mon Feb 8 21:58:41 2016 @@ -102,7 +102,7 @@ public class TestJndi { * * @throws Exception if the bind, lookup or connect fails */ - protected void checkBind(DataSource dataSource) throws Exception { + protected void checkBind(final DataSource dataSource) throws Exception { bindDataSource(dataSource); retrieveDataSource(); } @@ -112,7 +112,7 @@ public class TestJndi { * * @throws Exception if creation or binding fails. */ - protected void bindDataSource(DataSource dataSource) throws Exception { + protected void bindDataSource(final DataSource dataSource) throws Exception { context.bind(JNDI_PATH, dataSource); }