You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/08/30 13:09:59 UTC
[commons-dbcp] branch master updated: Reuse constant
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-dbcp.git
The following commit(s) were added to refs/heads/master by this push:
new 94e22d0d Reuse constant
new 41f208cf Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-dbcp.git
94e22d0d is described below
commit 94e22d0df8e18f79f082a52e58d25097daeb1997
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Aug 30 09:08:27 2022 -0400
Reuse constant
---
src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java | 2 +-
src/main/java/org/apache/commons/dbcp2/ConnectionFactoryFactory.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java b/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
index f5a73c89..e832ca8c 100644
--- a/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
+++ b/src/main/java/org/apache/commons/dbcp2/BasicDataSourceFactory.java
@@ -86,7 +86,7 @@ public class BasicDataSourceFactory implements ObjectFactory {
private static final String PROP_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS = "softMinEvictableIdleTimeMillis";
private static final String PROP_EVICTION_POLICY_CLASS_NAME = "evictionPolicyClassName";
private static final String PROP_TEST_WHILE_IDLE = "testWhileIdle";
- private static final String PROP_PASSWORD = "password";
+ private static final String PROP_PASSWORD = Constants.KEY_PASSWORD;
private static final String PROP_URL = "url";
private static final String PROP_USER_NAME = "username";
private static final String PROP_VALIDATION_QUERY = "validationQuery";
diff --git a/src/main/java/org/apache/commons/dbcp2/ConnectionFactoryFactory.java b/src/main/java/org/apache/commons/dbcp2/ConnectionFactoryFactory.java
index 451edf1a..2e87efb0 100644
--- a/src/main/java/org/apache/commons/dbcp2/ConnectionFactoryFactory.java
+++ b/src/main/java/org/apache/commons/dbcp2/ConnectionFactoryFactory.java
@@ -51,7 +51,7 @@ final class ConnectionFactoryFactory {
final String pwd = basicDataSource.getPassword();
if (pwd != null) {
- connectionProperties.put("password", pwd);
+ connectionProperties.put(Constants.KEY_PASSWORD, pwd);
} else {
basicDataSource.log("DBCP DataSource configured without a 'password'");
}