This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/7.0.x by this push: new e41f64e Remove unused code: password e41f64e is described below commit e41f64e71ffa0d53ccc85872a8250372e08be5ce Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Mar 22 09:21:43 2019 +0000 Remove unused code: password --- .../dbcp/dbcp/datasources/PerUserPoolDataSource.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/java/org/apache/tomcat/dbcp/dbcp/datasources/PerUserPoolDataSource.java b/java/org/apache/tomcat/dbcp/dbcp/datasources/PerUserPoolDataSource.java index 4ed8ad0..9e20e52 100644 --- a/java/org/apache/tomcat/dbcp/dbcp/datasources/PerUserPoolDataSource.java +++ b/java/org/apache/tomcat/dbcp/dbcp/datasources/PerUserPoolDataSource.java @@ -342,8 +342,8 @@ public class PerUserPoolDataSource /** * Get the number of active connections in the pool for a given user. */ - public int getNumActive(String username, String password) { - ObjectPool pool = getPool(getPoolKey(username,password)); + public int getNumActive(String username, @SuppressWarnings("unused") String password) { + ObjectPool pool = getPool(getPoolKey(username)); return (pool == null) ? 0 : pool.getNumActive(); } @@ -357,8 +357,8 @@ public class PerUserPoolDataSource /** * Get the number of idle connections in the pool for a given user. */ - public int getNumIdle(String username, String password) { - ObjectPool pool = getPool(getPoolKey(username,password)); + public int getNumIdle(String username, @SuppressWarnings("unused") String password) { + ObjectPool pool = getPool(getPoolKey(username)); return (pool == null) ? 0 : pool.getNumIdle(); } @@ -371,7 +371,7 @@ public class PerUserPoolDataSource getPooledConnectionAndInfo(String username, String password) throws SQLException { - final PoolKey key = getPoolKey(username,password); + final PoolKey key = getPoolKey(username); ObjectPool pool; PooledConnectionManager manager; synchronized(this) { @@ -466,8 +466,7 @@ public class PerUserPoolDataSource @Override protected PooledConnectionManager getConnectionManager(UserPassKey upkey) { - return (PooledConnectionManager) managers.get(getPoolKey( - upkey.getUsername(), upkey.getPassword())); + return (PooledConnectionManager) managers.get(getPoolKey(upkey.getUsername())); } /** @@ -483,7 +482,7 @@ public class PerUserPoolDataSource return ref; } - private PoolKey getPoolKey(String username, String password) { + private PoolKey getPoolKey(String username) { return new PoolKey(getDataSourceName(), username); } @@ -523,7 +522,7 @@ public class PerUserPoolDataSource CPDSConnectionFactory factory = new CPDSConnectionFactory(cpds, pool, getValidationQuery(), isRollbackAfterValidation(), username, password); - Object old = managers.put(getPoolKey(username,password), factory); + Object old = managers.put(getPoolKey(username), factory); if (old != null) { throw new IllegalStateException("Pool already contains an entry for this user/password: "+username); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org