Repository: commons-dbcp
Updated Branches:
  refs/heads/master 954012287 -> 064c81483


Better param name.

Project: http://git-wip-us.apache.org/repos/asf/commons-dbcp/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbcp/commit/064c8148
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbcp/tree/064c8148
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbcp/diff/064c8148

Branch: refs/heads/master
Commit: 064c814833c50fe1f3f87771e6e85dd6b1dfa42a
Parents: 9540122
Author: Gary Gregory <garydgreg...@gmail.com>
Authored: Sun Jun 10 12:52:59 2018 -0600
Committer: Gary Gregory <garydgreg...@gmail.com>
Committed: Sun Jun 10 12:52:59 2018 -0600

----------------------------------------------------------------------
 .../dbcp2/datasources/InstanceKeyDataSource.java      | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/064c8148/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java 
b/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
index 475fd41..bef86cc 100644
--- 
a/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
+++ 
b/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
@@ -902,7 +902,7 @@ public abstract class InstanceKeyDataSource implements 
DataSource, Referenceable
      * <code>PooledConnectionAndInfo</code> instance with the new password is 
returned.
      */
     @Override
-    public Connection getConnection(final String userName, final String 
password) throws SQLException {
+    public Connection getConnection(final String userName, final String 
userPassword) throws SQLException {
         if (instanceKey == null) {
             throw new SQLException("Must set the ConnectionPoolDataSource "
                     + "through setDataSourceName or 
setConnectionPoolDataSource" + " before calling getConnection.");
@@ -910,7 +910,7 @@ public abstract class InstanceKeyDataSource implements 
DataSource, Referenceable
         getConnectionCalled = true;
         PooledConnectionAndInfo info = null;
         try {
-            info = getPooledConnectionAndInfo(userName, password);
+            info = getPooledConnectionAndInfo(userName, userPassword);
         } catch (final NoSuchElementException e) {
             closeDueToException(info);
             throw new SQLException("Cannot borrow connection from pool", e);
@@ -926,9 +926,9 @@ public abstract class InstanceKeyDataSource implements 
DataSource, Referenceable
         }
 
         // Password on PooledConnectionAndInfo does not match
-        if (!(null == password ? null == info.getPassword() : 
password.equals(info.getPassword()))) { 
+        if (!(null == userPassword ? null == info.getPassword() : 
userPassword.equals(info.getPassword()))) { 
             try { // See if password has changed by attempting connection
-                testCPDS(userName, password);
+                testCPDS(userName, userPassword);
             } catch (final SQLException ex) {
                 // Password has not changed, so refuse client, but return 
connection to the pool
                 closeDueToException(info);
@@ -950,7 +950,7 @@ public abstract class InstanceKeyDataSource implements 
DataSource, Referenceable
             info = null;
             for (int i = 0; i < 10; i++) { // Bound the number of retries - 
only needed if bad instances return
                 try {
-                    info = getPooledConnectionAndInfo(userName, password);
+                    info = getPooledConnectionAndInfo(userName, userPassword);
                 } catch (final NoSuchElementException e) {
                     closeDueToException(info);
                     throw new SQLException("Cannot borrow connection from 
pool", e);
@@ -964,7 +964,7 @@ public abstract class InstanceKeyDataSource implements 
DataSource, Referenceable
                     closeDueToException(info);
                     throw new SQLException("Cannot borrow connection from 
pool", e);
                 }
-                if (info != null && password != null && 
password.equals(info.getPassword())) {
+                if (info != null && userPassword != null && 
userPassword.equals(info.getPassword())) {
                     break;
                 }
                 if (info != null) {
@@ -992,7 +992,7 @@ public abstract class InstanceKeyDataSource implements 
DataSource, Referenceable
         }
     }
 
-    protected abstract PooledConnectionAndInfo 
getPooledConnectionAndInfo(String userName, String password)
+    protected abstract PooledConnectionAndInfo 
getPooledConnectionAndInfo(String userName, String userPassword)
             throws SQLException;
 
     protected abstract void setupDefaults(Connection connection, String 
userName) throws SQLException;

Reply via email to