[commons-jcs] 04/05: Use inherited serializer
This is an automated email from the ASF dual-hosted git repository. tv pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jcs.git commit 076b8a22d862430b30dda5ed7e667403fffdfbe8 Author: Thomas Vandahl AuthorDate: Sun Jun 6 13:16:07 2021 +0200 Use inherited serializer --- .../jcs3/auxiliary/disk/jdbc/JDBCDiskCache.java| 23 -- 1 file changed, 23 deletions(-) diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/jdbc/JDBCDiskCache.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/jdbc/JDBCDiskCache.java index c1db9ed..4cdcb18 100644 --- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/jdbc/JDBCDiskCache.java +++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/jdbc/JDBCDiskCache.java @@ -39,7 +39,6 @@ import org.apache.commons.jcs3.auxiliary.disk.AbstractDiskCache; import org.apache.commons.jcs3.auxiliary.disk.jdbc.dsfactory.DataSourceFactory; import org.apache.commons.jcs3.engine.behavior.ICache; import org.apache.commons.jcs3.engine.behavior.ICacheElement; -import org.apache.commons.jcs3.engine.behavior.IElementSerializer; import org.apache.commons.jcs3.engine.logging.behavior.ICacheEvent; import org.apache.commons.jcs3.engine.logging.behavior.ICacheEventLogger; import org.apache.commons.jcs3.engine.stats.StatElement; @@ -47,7 +46,6 @@ import org.apache.commons.jcs3.engine.stats.behavior.IStatElement; import org.apache.commons.jcs3.engine.stats.behavior.IStats; import org.apache.commons.jcs3.log.Log; import org.apache.commons.jcs3.log.LogManager; -import org.apache.commons.jcs3.utils.serialization.StandardSerializer; /** * This is the jdbc disk cache plugin. @@ -85,9 +83,6 @@ public class JDBCDiskCache /** The local logger. */ private static final Log log = LogManager.getLog( JDBCDiskCache.class ); -/** custom serialization */ -private IElementSerializer elementSerializer = new StandardSerializer(); - /** configuration */ private JDBCDiskCacheAttributes jdbcDiskCacheAttributes; @@ -701,24 +696,6 @@ public class JDBCDiskCache } /** - * @param elementSerializer The elementSerializer to set. - */ -@Override -public void setElementSerializer( final IElementSerializer elementSerializer ) -{ -this.elementSerializer = elementSerializer; -} - -/** - * @return Returns the elementSerializer. - */ -@Override -public IElementSerializer getElementSerializer() -{ -return elementSerializer; -} - -/** * @param jdbcDiskCacheAttributes The jdbcDiskCacheAttributes to set. */ protected void setJdbcDiskCacheAttributes( final JDBCDiskCacheAttributes jdbcDiskCacheAttributes )
[commons-jcs] branch master updated (4468297 -> f657f3e)
This is an automated email from the ASF dual-hosted git repository. tv pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/commons-jcs.git. from 4468297 Update commons-io 2.8.0 -> 2.9.0. new df354d8 Give credit new 3360e1a Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-jcs.git new 6c4ce25 Make note of JCS-222 new 076b8a2 Use inherited serializer new f657f3e Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-jcs.git The 5 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../jcs3/auxiliary/disk/jdbc/JDBCDiskCache.java| 23 -- .../jcs3/engine/memory/behavior/IMemoryCache.java | 2 +- src/changes/changes.xml| 4 ++-- 3 files changed, 3 insertions(+), 26 deletions(-)
[commons-jcs] 02/05: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-jcs.git
This is an automated email from the ASF dual-hosted git repository. tv pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jcs.git commit 3360e1a7d92f696b7dc7de3bba2d1f083467201f Merge: df354d8 5e2237b Author: Thomas Vandahl AuthorDate: Mon May 24 18:32:10 2021 +0200 Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-jcs.git .github/workflows/maven.yml | 3 ++- CODE_OF_CONDUCT.md | 17 + .../jcs3/auxiliary/disk/indexed/IndexedDiskCache.java | 6 +++--- .../auxiliary/disk/jdbc/mysql/MySQLTableOptimizer.java | 2 +- .../jcs3/auxiliary/lateral/LateralCacheNoWait.java | 2 +- .../jcs3/auxiliary/remote/RemoteCacheNoWait.java| 2 +- .../auxiliary/remote/behavior/IRemoteCacheListener.java | 2 +- .../remote/http/client/RemoteHttpCacheAttributes.java | 4 ++-- .../remote/http/client/RemoteHttpCacheClient.java | 2 +- .../commons/jcs3/engine/CacheEventQueueFactory.java | 2 +- .../jcs3/engine/behavior/IShutdownObservable.java | 2 +- .../jcs3/engine/control/CompositeCacheManager.java | 4 +--- .../org/apache/commons/jcs3/utils/access/JCSWorker.java | 6 +++--- .../jcs3/utils/discovery/UDPDiscoveryManager.java | 2 +- .../jcs3/utils/discovery/UDPDiscoverySenderThread.java | 2 +- .../commons/jcs3/utils/struct/AbstractLRUMap.java | 2 +- commons-jcs-dist/pom.xml| 2 +- src/changes/changes.xml | 3 +++ 18 files changed, 42 insertions(+), 23 deletions(-)
[commons-jcs] 05/05: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-jcs.git
This is an automated email from the ASF dual-hosted git repository. tv pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jcs.git commit f657f3eb0ff2ba093ab73dcd52a530b98abe08e4 Merge: 076b8a2 4468297 Author: Thomas Vandahl AuthorDate: Sun Jun 6 13:16:40 2021 +0200 Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-jcs.git commons-jcs-jcache-extras/pom.xml | 2 +- src/changes/changes.xml | 5 - 2 files changed, 5 insertions(+), 2 deletions(-)
[commons-jcs] 03/05: Make note of JCS-222
This is an automated email from the ASF dual-hosted git repository. tv pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jcs.git commit 6c4ce25a70c98deb92e776296f0ea25794f01664 Author: Thomas Vandahl AuthorDate: Sun Jun 6 13:14:11 2021 +0200 Make note of JCS-222 --- .../org/apache/commons/jcs3/engine/memory/behavior/IMemoryCache.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/memory/behavior/IMemoryCache.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/memory/behavior/IMemoryCache.java index fa5b2fe..d41dc68 100644 --- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/memory/behavior/IMemoryCache.java +++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/engine/memory/behavior/IMemoryCache.java @@ -149,7 +149,7 @@ public interface IMemoryCache * @throws IOException *Description of the Exception */ -void waterfal( ICacheElement ce ) +void waterfal( ICacheElement ce ) // FIXME: Correct typo before 4.0, see JCS-222 throws IOException; /**
[commons-jcs] 01/05: Give credit
This is an automated email from the ASF dual-hosted git repository. tv pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jcs.git commit df354d8402381f6f0ef968e7b3fd5cc79d8c9e96 Author: Thomas Vandahl AuthorDate: Sun Apr 18 11:45:53 2021 +0200 Give credit --- src/changes/changes.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 227bc60..fd5c7be 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -26,10 +26,10 @@ IPv6 link-local address for IPv6 multicast, IPv4 site-local address for IPv4 multicast - + Use configured listener address for UDP service broadcast - + Fix UDP service discovery with LateralCache
[commons-pool] branch master updated: Add and fix @deprecated Javadocs.
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-pool.git The following commit(s) were added to refs/heads/master by this push: new b489337 Add and fix @deprecated Javadocs. b489337 is described below commit b4893374ca29104802d2aad76b0696641596e143 Author: Gary Gregory AuthorDate: Sun Jun 6 09:46:44 2021 -0400 Add and fix @deprecated Javadocs. --- src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java b/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java index 44bf442..0416a4b 100644 --- a/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java +++ b/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java @@ -480,6 +480,7 @@ public abstract class BaseObjectPoolConfig extends BaseObject implements Clon * * @see GenericObjectPool#getSoftMinEvictableIdleTime() * @see GenericKeyedObjectPool#getSoftMinEvictableIdleTime() + * @deprecated Use {@link #getSoftMinEvictableIdleTime()}. */ @Deprecated public long getSoftMinEvictableIdleTimeMillis() { @@ -753,7 +754,7 @@ public abstract class BaseObjectPoolConfig extends BaseObject implements Clon * * @see GenericObjectPool#getMinEvictableIdleTimeMillis() * @see GenericKeyedObjectPool#getMinEvictableIdleTimeMillis() - * @deprecated Use {@link #setSoftMinEvictableIdleTime(Duration)}. + * @deprecated Use {@link #setMinEvictableIdleTime(Duration)}. */ @Deprecated public void setMinEvictableIdleTimeMillis(final long minEvictableIdleTimeMillis) {
[commons-pool] branch master updated: Javadoc.
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-pool.git The following commit(s) were added to refs/heads/master by this push: new 79de6c3 Javadoc. 79de6c3 is described below commit 79de6c39c23d8901d5d6423b94a0408d98a545f3 Author: Gary Gregory AuthorDate: Sun Jun 6 09:53:57 2021 -0400 Javadoc. --- .../commons/pool2/impl/GenericKeyedObjectPoolMXBean.java | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolMXBean.java b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolMXBean.java index 40c83bd..c35b65e 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolMXBean.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolMXBean.java @@ -149,8 +149,8 @@ public interface GenericKeyedObjectPoolMXBean { long getMeanIdleTimeMillis(); /** - * See {@link GenericKeyedObjectPool#getMinEvictableIdleTimeMillis()} - * @return See {@link GenericKeyedObjectPool#getMinEvictableIdleTimeMillis()} + * See {@link GenericKeyedObjectPool#getMinEvictableIdleTime()} + * @return See {@link GenericKeyedObjectPool#getMinEvictableIdleTime()} */ long getMinEvictableIdleTimeMillis(); @@ -217,8 +217,8 @@ public interface GenericKeyedObjectPoolMXBean { } /** - * See {@link GenericKeyedObjectPool#getRemoveAbandonedTimeout()} - * @return See {@link GenericKeyedObjectPool#getRemoveAbandonedTimeout()} + * See {@link GenericKeyedObjectPool#getRemoveAbandonedTimeoutDuration()} + * @return See {@link GenericKeyedObjectPool#getRemoveAbandonedTimeoutDuration()} * @since 2.10.0 */ default int getRemoveAbandonedTimeout() { @@ -257,8 +257,8 @@ public interface GenericKeyedObjectPoolMXBean { boolean getTestWhileIdle(); /** - * See {@link GenericKeyedObjectPool#getTimeBetweenEvictionRunsMillis()} - * @return See {@link GenericKeyedObjectPool#getTimeBetweenEvictionRunsMillis()} + * See {@link GenericKeyedObjectPool#getTimeBetweenEvictionRuns()} + * @return See {@link GenericKeyedObjectPool#getTimeBetweenEvictionRuns()} */ long getTimeBetweenEvictionRunsMillis();
[commons-dbcp] branch master updated: Add and reuse CPDSConnectionFactory.setMaxConnLifetime(Duration), deprecate setMaxConnLifetimeMillis(long).
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 c116656 Add and reuse CPDSConnectionFactory.setMaxConnLifetime(Duration), deprecate setMaxConnLifetimeMillis(long). c116656 is described below commit c11665673c39adbd0b836034d9c22809f4b5704c Author: Gary Gregory AuthorDate: Sun Jun 6 10:06:07 2021 -0400 Add and reuse CPDSConnectionFactory.setMaxConnLifetime(Duration), deprecate setMaxConnLifetimeMillis(long). Add and reuse KeyedCPDSConnectionFactory.setMaxConnLifetime(Duration), deprecate setMaxConnLifetimeMillis(long). --- src/changes/changes.xml| 10 - .../dbcp2/datasources/CPDSConnectionFactory.java | 33 - .../dbcp2/datasources/InstanceKeyDataSource.java | 43 -- .../datasources/KeyedCPDSConnectionFactory.java| 31 .../dbcp2/datasources/PerUserPoolDataSource.java | 6 +-- .../dbcp2/datasources/SharedPoolDataSource.java| 6 +-- 6 files changed, 100 insertions(+), 29 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index e89518e..9285023 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -69,10 +69,16 @@ The type attribute can be add,update,fix,remove. Add and reuse DataSourceMXBean. - Add and reuse DriverAdapterCPDS.{get|set}DurationBetweenEvictionRuns(), deprecate {get|set}TimeBetweenEvictionRunsMillis(). + Add and reuse DriverAdapterCPDS.{get|set}DurationBetweenEvictionRuns(), deprecate {get|set}TimeBetweenEvictionRunsMillis(long). - Add and reuse DriverAdapterCPDS.{get|set}MinEvictableIdleDuration(), deprecate {get|set}MinEvictableIdleTimeMillis(). + Add and reuse DriverAdapterCPDS.{get|set}MinEvictableIdleDuration(), deprecate {get|set}MinEvictableIdleTimeMillis(int). + + + Add and reuse CPDSConnectionFactory.setMaxConnLifetime(Duration), deprecate setMaxConnLifetimeMillis(long). + + + Add and reuse KeyedCPDSConnectionFactory.setMaxConnLifetime(Duration), deprecate setMaxConnLifetimeMillis(long). diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/CPDSConnectionFactory.java b/src/main/java/org/apache/commons/dbcp2/datasources/CPDSConnectionFactory.java index 29df4a0..e2fc3e6 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/CPDSConnectionFactory.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/CPDSConnectionFactory.java @@ -20,6 +20,7 @@ import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; +import java.time.Duration; import java.util.Collections; import java.util.Map; import java.util.Set; @@ -53,7 +54,7 @@ class CPDSConnectionFactory private ObjectPool pool; private final String userName; private char[] userPassword; -private long maxConnLifetimeMillis = -1; +private Duration maxConnLifetime = Duration.ofMillis(-1); /** * Map of PooledConnections for which close events are ignored. Connections are muted when they are being validated. @@ -357,11 +358,25 @@ class CPDSConnectionFactory * Sets the maximum lifetime in milliseconds of a connection after which the connection will always fail activation, * passivation and validation. * + * @param maxConnLifetime + *A value of zero or less indicates an infinite lifetime. The default value is -1 milliseconds. + * @since 2.9.0 + */ +public void setMaxConnLifetime(final Duration maxConnLifetime) { +this.maxConnLifetime = maxConnLifetime; +} + +/** + * Sets the maximum lifetime in milliseconds of a connection after which the connection will always fail activation, + * passivation and validation. + * * @param maxConnLifetimeMillis *A value of zero or less indicates an infinite lifetime. The default value is -1. + * @deprecated Use {@link #setMaxConnLifetime(Duration)}. */ +@Deprecated public void setMaxConnLifetimeMillis(final long maxConnLifetimeMillis) { -this.maxConnLifetimeMillis = maxConnLifetimeMillis; +setMaxConnLifetime(Duration.ofMillis(maxConnLifetimeMillis)); } /** @@ -382,12 +397,12 @@ class CPDSConnectionFactory } } -private void validateLifetime(final PooledObject p) throws Exception { -if (maxConnLifetimeMillis > 0) { -final long lifetimeMillis = System.currentTimeMillis() - p.getCreateTime(); -if (lifetimeMillis > maxConnLifetimeMillis) { -throw new Exception(Utils.getMessage("connectionFactory.lifetimeExceeded", lifetimeMillis, -maxConnLi
[commons-pool] branch master updated: Make Duration setters use their respective default values when null.
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-pool.git The following commit(s) were added to refs/heads/master by this push: new 5497850 Make Duration setters use their respective default values when null. 5497850 is described below commit 5497850846281ba51a95741aa36c96e4952c301a Author: Gary Gregory AuthorDate: Sun Jun 6 10:37:51 2021 -0400 Make Duration setters use their respective default values when null. Javadoc updates. --- src/changes/changes.xml| 6 +++ .../java/org/apache/commons/pool2/PoolUtils.java | 24 +-- .../apache/commons/pool2/impl/AbandonedConfig.java | 2 +- .../commons/pool2/impl/BaseGenericObjectPool.java | 25 ++-- .../commons/pool2/impl/BaseObjectPoolConfig.java | 47 +++--- .../apache/commons/pool2/impl/PoolImplUtils.java | 46 +++-- 6 files changed, 88 insertions(+), 62 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index a3e845d..0caa9b1 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -56,10 +56,16 @@ The type attribute can be add,update,fix,remove. - PooledObject.getLastUsedInstant() - TrackedUse#getLastUsedInstant() + + Add BaseObjectPoolConfig.setEvictorShutdownTimeout(Duration), setEvictorShutdownTimeoutMillis(Duration). + Fix [WARNING] Old version of checkstyle detected. Consider updating to >= v8.30. Update Checktyle to 8.43. + + Make Duration setters use their respective default values when null. + diff --git a/src/main/java/org/apache/commons/pool2/PoolUtils.java b/src/main/java/org/apache/commons/pool2/PoolUtils.java index 64c7f2c..db510a8 100644 --- a/src/main/java/org/apache/commons/pool2/PoolUtils.java +++ b/src/main/java/org/apache/commons/pool2/PoolUtils.java @@ -1334,8 +1334,8 @@ public final class PoolUtils { * @param minIdle *if the {@link KeyedObjectPool#getNumIdle(Object)} is less than *this then add an idle object. - * @param period - *the frequency to check the number of idle objects in a + * @param periodMillis + *the frequency in milliseconds to check the number of idle objects in a *keyedPool, see {@link Timer#schedule(TimerTask, long, long)}. * @param the type of the pool key * @param the type of pool entries @@ -1350,7 +1350,7 @@ public final class PoolUtils { */ public static Map checkMinIdle( final KeyedObjectPool keyedPool, final Collection keys, -final int minIdle, final long period) +final int minIdle, final long periodMillis) throws IllegalArgumentException { if (keys == null) { throw new IllegalArgumentException(MSG_NULL_KEYS); @@ -1359,7 +1359,7 @@ public final class PoolUtils { final Iterator iter = keys.iterator(); while (iter.hasNext()) { final K key = iter.next(); -final TimerTask task = checkMinIdle(keyedPool, key, minIdle, period); +final TimerTask task = checkMinIdle(keyedPool, key, minIdle, periodMillis); tasks.put(key, task); } return tasks; @@ -1378,8 +1378,8 @@ public final class PoolUtils { * @param minIdle *if the {@link KeyedObjectPool#getNumIdle(Object)} is less than *this then add an idle object. - * @param period - *the frequency to check the number of idle objects in a + * @param periodMillis + *the frequency in milliseconds to check the number of idle objects in a *keyedPool, see {@link Timer#schedule(TimerTask, long, long)}. * @param the type of the pool key * @param the type of pool entries @@ -1392,7 +1392,7 @@ public final class PoolUtils { */ public static TimerTask checkMinIdle( final KeyedObjectPool keyedPool, final K key, -final int minIdle, final long period) +final int minIdle, final long periodMillis) throws IllegalArgumentException { if (keyedPool == null) { throw new IllegalArgumentException(MSG_NULL_KEYED_POOL); @@ -1405,7 +1405,7 @@ public final class PoolUtils { } final TimerTask task = new KeyedObjectPoolMinIdleTimerTask<>( keyedPool, key, minIdle); -getMinIdleTimer().schedule(task, 0L, period); +getMinIdleTimer().schedule(task, 0L, periodMillis); return task; } @@ -1419,8 +1419,8 @@ public final class PoolUtils { * @param minIdle *if the {@link ObjectPool#getNumIdle()} is less than this then *add an idle object. - * @param period - *the f
[commons-pool] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-pool.git The following commit(s) were added to refs/heads/master by this push: new b93003a Replace Java 15 with Java 16 in Travis CI. b93003a is described below commit b93003a8b62fd42086670fe14c2ab1f9d3be7446 Author: Gary Gregory AuthorDate: Sun Jun 6 10:41:09 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4218f02..c27cf14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ cache: jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 - openjdk-ea matrix:
[commons-bcel] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-bcel.git The following commit(s) were added to refs/heads/master by this push: new 2f728f2 Replace Java 15 with Java 16 in Travis CI. 2f728f2 is described below commit 2f728f24289425f28507e1c68d3d43e7acf60644 Author: Gary Gregory AuthorDate: Sun Jun 6 10:41:53 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 10f1158..2c6aa18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ sudo: false jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 - openjdk-ea script:
[commons-beanutils] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-beanutils.git The following commit(s) were added to refs/heads/master by this push: new fa85b67 Replace Java 15 with Java 16 in Travis CI. fa85b67 is described below commit fa85b67ce044d719c51d12329035704f6ff35789 Author: Gary Gregory AuthorDate: Sun Jun 6 10:42:09 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9efb7d8..03aef98 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ jdk: - oraclejdk11 - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 - openjdk-ea after_success:
[commons-cli] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-cli.git The following commit(s) were added to refs/heads/master by this push: new 3d90d5d Replace Java 15 with Java 16 in Travis CI. 3d90d5d is described below commit 3d90d5d8cb2f6f0e028000de5a11d66dd3890c75 Author: Gary Gregory AuthorDate: Sun Jun 6 10:42:23 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 440cb75..f5f56b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ language: java jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 - openjdk-ea script:
[commons-codec] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-codec.git The following commit(s) were added to refs/heads/master by this push: new 4de60e8 Replace Java 15 with Java 16 in Travis CI. 4de60e8 is described below commit 4de60e8b68fb749e5380ecef018511bed946bee8 Author: Gary Gregory AuthorDate: Sun Jun 6 10:42:37 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4f4f04f..c48065a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ matrix: include: - jdk: openjdk8 - jdk: openjdk11 -- jdk: openjdk15 +- jdk: openjdk16 - jdk: openjdk-ea allow_failures: - jdk: openjdk-ea
[commons-configuration] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-configuration.git The following commit(s) were added to refs/heads/master by this push: new e63eeae Replace Java 15 with Java 16 in Travis CI. e63eeae is described below commit e63eeaecae03c640790b89ff71897bb0dc7d639c Author: Gary Gregory AuthorDate: Sun Jun 6 10:42:50 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2e3f681..15f6d89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ sudo: false jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 - openjdk-ea matrix:
[commons-csv] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-csv.git The following commit(s) were added to refs/heads/master by this push: new dc06860 Replace Java 15 with Java 16 in Travis CI. dc06860 is described below commit dc0686059ae3b133026927a4a28008048667dede Author: Gary Gregory AuthorDate: Sun Jun 6 10:43:03 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bac6fa2..8c82e0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ matrix: include: - jdk: openjdk8 - jdk: openjdk11 -- jdk: openjdk15 +- jdk: openjdk16 - jdk: openjdk-ea allow_failures: - jdk: openjdk-ea
[commons-dbcp] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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 f87032d Replace Java 15 with Java 16 in Travis CI. f87032d is described below commit f87032d819557af8bc06d5ec58b1c25435e853d1 Author: Gary Gregory AuthorDate: Sun Jun 6 10:43:16 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 659a36f..7a0e5d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,5 +21,5 @@ cache: jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 - openjdk-ea
[commons-dbutils] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-dbutils.git The following commit(s) were added to refs/heads/master by this push: new 96d6a12 Replace Java 15 with Java 16 in Travis CI. 96d6a12 is described below commit 96d6a12d3b148e56b585fa397f0f7746d26c426d Author: Gary Gregory AuthorDate: Sun Jun 6 10:43:32 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 51bc4cc..cd7c717 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ jdk: - openjdk7 - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 - openjdk-ea after_success:
[commons-digester] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-digester.git The following commit(s) were added to refs/heads/master by this push: new 831916d Replace Java 15 with Java 16 in Travis CI. 831916d is described below commit 831916db59e1bf22aaf3807bc372db2cad119871 Author: Gary Gregory AuthorDate: Sun Jun 6 10:43:44 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 66fb005..1ebced0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ sudo: false jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 after_success: - mvn -V clean cobertura:cobertura coveralls:report --no-transfer-progress
[commons-email] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-email.git The following commit(s) were added to refs/heads/master by this push: new b8d5918 Replace Java 15 with Java 16 in Travis CI. b8d5918 is described below commit b8d59186451869adbe4acc7cc257c349f23cac87 Author: Gary Gregory AuthorDate: Sun Jun 6 10:43:59 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1999e64..be00075 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ sudo: false jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 after_success: - mvn -V clean cobertura:cobertura coveralls:report --no-transfer-progress
[commons-exec] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-exec.git The following commit(s) were added to refs/heads/master by this push: new c707da2 Replace Java 15 with Java 16 in Travis CI. c707da2 is described below commit c707da2ccb4cc95076af90cc256e5858475631f8 Author: Gary Gregory AuthorDate: Sun Jun 6 10:44:10 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6be9ce7..16387c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ sudo: true jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 script: - mvn -V --no-transfer-progress -Ddoclint=all
[commons-fileupload] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-fileupload.git The following commit(s) were added to refs/heads/master by this push: new 31067dd Replace Java 15 with Java 16 in Travis CI. 31067dd is described below commit 31067dd3da7011222698d56e7804b24099bafc75 Author: Gary Gregory AuthorDate: Sun Jun 6 10:44:29 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f6979f5..d525af2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ matrix: include: - jdk: openjdk8 - jdk: openjdk11 -- jdk: openjdk15 +- jdk: openjdk16 - jdk: openjdk-ea allow_failures: - jdk: openjdk-ea
[commons-imaging] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-imaging.git The following commit(s) were added to refs/heads/master by this push: new f29c9e6 Replace Java 15 with Java 16 in Travis CI. f29c9e6 is described below commit f29c9e6ca5caf51fd1aaecf7a7fc431bfc46dbc6 Author: Gary Gregory AuthorDate: Sun Jun 6 10:44:44 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a5d3f4a..bf0e025 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ cache: jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 - openjdk-ea matrix:
[commons-jexl] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-jexl.git The following commit(s) were added to refs/heads/master by this push: new 1156bc4 Replace Java 15 with Java 16 in Travis CI. 1156bc4 is described below commit 1156bc48258b720cdaf85a4744a386d7e539ad2f Author: Gary Gregory AuthorDate: Sun Jun 6 10:44:57 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b3d70b8..ad4d049 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ cache: jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 - openjdk-ea matrix:
[commons-ognl] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-ognl.git The following commit(s) were added to refs/heads/master by this push: new c1b00e9 Replace Java 15 with Java 16 in Travis CI. new e315ab6 Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-ognl.git c1b00e9 is described below commit c1b00e9d9de0d67bf74de1fadb6bc650c1ad5612 Author: Gary Gregory AuthorDate: Sun Jun 6 10:45:10 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cc26727..cefab1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ cache: jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 - openjdk-ea matrix:
[commons-text] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-text.git The following commit(s) were added to refs/heads/master by this push: new 944907a Replace Java 15 with Java 16 in Travis CI. 944907a is described below commit 944907a7c1763b8da70fdc7b2851b5e7ebf198d5 Author: Gary Gregory AuthorDate: Sun Jun 6 10:45:45 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c15d1d2..75e7b7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ language: java jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 - openjdk-ea matrix:
[commons-validator] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-validator.git The following commit(s) were added to refs/heads/master by this push: new 5ec5e51 Replace Java 15 with Java 16 in Travis CI. 5ec5e51 is described below commit 5ec5e51428e84e50a01de50d03ff180782ad5e0c Author: Gary Gregory AuthorDate: Sun Jun 6 10:45:59 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d21a3d0..e6b69fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ matrix: include: - jdk: openjdk8 - jdk: openjdk11 -- jdk: openjdk15 +- jdk: openjdk16 script: - mvn -V --no-transfer-progress clean test after_success:
[commons-vfs] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-vfs.git The following commit(s) were added to refs/heads/master by this push: new 9d6f24c Replace Java 15 with Java 16 in Travis CI. 9d6f24c is described below commit 9d6f24c4a139e81325c884822b6081c2035f2f07 Author: Gary Gregory AuthorDate: Sun Jun 6 10:46:16 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8cd3061..ff77cac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,10 +19,10 @@ matrix: include: - jdk: openjdk8 - jdk: openjdk11 -- jdk: openjdk15 +- jdk: openjdk16 - jdk: openjdk-ea allow_failures: -- jdk: openjdk15 +- jdk: openjdk16 - jdk: openjdk-ea after_success: - mvn -V --no-transfer-progress -B -e clean cobertura:cobertura coveralls:report
[commons-lang] branch master updated: Replace Java 15 with Java 16 in Travis CI.
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-lang.git The following commit(s) were added to refs/heads/master by this push: new 197d504 Replace Java 15 with Java 16 in Travis CI. 197d504 is described below commit 197d50434748bfb2db935266cfe740fc01a607ee Author: Gary Gregory AuthorDate: Sun Jun 6 10:46:31 2021 -0400 Replace Java 15 with Java 16 in Travis CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5e905d6..09a8886 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ cache: jdk: - openjdk8 - openjdk11 - - openjdk15 + - openjdk16 - openjdk-ea matrix:
[commons-geometry] branch master updated: GEOMETRY-123: replacing DoubleFormat with DoubleFunction
This is an automated email from the ASF dual-hosted git repository. mattjuntunen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-geometry.git The following commit(s) were added to refs/heads/master by this push: new 357ddfe GEOMETRY-123: replacing DoubleFormat with DoubleFunction 357ddfe is described below commit 357ddfed01a2aa8c444b28947e1be95574421831 Author: Matt Juntunen AuthorDate: Sun Jun 6 11:00:45 2021 -0400 GEOMETRY-123: replacing DoubleFormat with DoubleFunction --- .../io/core/utils/AbstractTextFormatWriter.java| 25 +++ .../geometry/io/core/utils/DoubleFormat.java | 33 -- .../geometry/io/core/utils/DoubleFormats.java | 76 -- .../core/utils/AbstractTextFormatWriterTest.java | 3 +- .../geometry/io/core/utils/DoubleFormatsTest.java | 65 +- .../threed/obj/ObjBoundaryWriteHandler3D.java | 21 +++--- .../io/euclidean/threed/obj/ObjWriter.java | 10 +-- .../txt/AbstractTextBoundaryWriteHandler3D.java| 21 +++--- 8 files changed, 114 insertions(+), 140 deletions(-) diff --git a/commons-geometry-io-core/src/main/java/org/apache/commons/geometry/io/core/utils/AbstractTextFormatWriter.java b/commons-geometry-io-core/src/main/java/org/apache/commons/geometry/io/core/utils/AbstractTextFormatWriter.java index 29aa429..fdd94c0 100644 --- a/commons-geometry-io-core/src/main/java/org/apache/commons/geometry/io/core/utils/AbstractTextFormatWriter.java +++ b/commons-geometry-io-core/src/main/java/org/apache/commons/geometry/io/core/utils/AbstractTextFormatWriter.java @@ -19,6 +19,7 @@ package org.apache.commons.geometry.io.core.utils; import java.io.Closeable; import java.io.IOException; import java.io.Writer; +import java.util.function.DoubleFunction; /** Base type for classes that write text-based data formats. This class * provides a number of common configuration options and utility methods. @@ -34,8 +35,8 @@ public abstract class AbstractTextFormatWriter implements Closeable { /** Line separator string. */ private String lineSeparator = DEFAULT_LINE_SEPARATOR; -/** Double format instance. */ -private DoubleFormat doubleFormat; +/** Double format function. */ +private DoubleFunction doubleFormat; /** Construct a new instance that writes content to the given writer. * @param writer writer instance @@ -47,9 +48,9 @@ public abstract class AbstractTextFormatWriter implements Closeable { /** Construct a new instance that writes content to the given writer and uses the * decimal format instance for creating floating-point string representations. * @param writer writer instance - * @param doubleFormat double format instance + * @param doubleFormat double format function */ -protected AbstractTextFormatWriter(final Writer writer, final DoubleFormat doubleFormat) { +protected AbstractTextFormatWriter(final Writer writer, final DoubleFunction doubleFormat) { this.writer = writer; this.doubleFormat = doubleFormat; } @@ -68,17 +69,17 @@ public abstract class AbstractTextFormatWriter implements Closeable { this.lineSeparator = lineSeparator; } -/** Get the {@link DoubleFormat} instance used to format floating point output. - * @return the double format instance +/** Get the function used to format floating point output. + * @return the double format function */ -public DoubleFormat getDoubleFormat() { +public DoubleFunction getDoubleFormat() { return doubleFormat; } -/** Set the {@link DoubleFormat} instance used to format floating point output. - * @param doubleFormat double format instance +/** Set the function used to format floating point output. + * @param doubleFormat double format function */ -public void setDoubleFormat(final DoubleFormat doubleFormat) { +public void setDoubleFormat(final DoubleFunction doubleFormat) { this.doubleFormat = doubleFormat; } @@ -95,12 +96,12 @@ public abstract class AbstractTextFormatWriter implements Closeable { return writer; } -/** Write a double value formatted using the configured decimal format instance. +/** Write a double value formatted using the configured decimal format function. * @param d value to write * @throws IOException if an I/O error occurs */ protected void write(final double d) throws IOException { -write(doubleFormat.format(d)); +write(doubleFormat.apply(d)); } /** Write an integer value. diff --git a/commons-geometry-io-core/src/main/java/org/apache/commons/geometry/io/core/utils/DoubleFormat.java b/commons-geometry-io-core/src/main/java/org/apache/commons/geometry/io/core/utils/DoubleFormat.java deleted file mode 100644 index 39eb15d..000 --- a/commons-geometry-io-core/src/main/java/org/apache/common
[commons-dbcp] branch master updated: Add @SuppressWarnings with comment and make some internals simpler looking.
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 3100156 Add @SuppressWarnings with comment and make some internals simpler looking. 3100156 is described below commit 31001566f826c18b3794256154225eb7c316d2fd Author: Gary Gregory AuthorDate: Sun Jun 6 11:15:26 2021 -0400 Add @SuppressWarnings with comment and make some internals simpler looking. --- .../apache/commons/dbcp2/DelegatingConnection.java | 112 ++--- .../apache/commons/dbcp2/DelegatingStatement.java | 3 + .../commons/dbcp2/PoolableConnectionFactory.java | 26 ++--- 3 files changed, 70 insertions(+), 71 deletions(-) diff --git a/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java b/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java index 2080716..969f250 100644 --- a/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java +++ b/src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java @@ -76,11 +76,10 @@ public class DelegatingConnection extends AbandonedTrace i /** * Creates a wrapper for the Connection which traces this Connection in the AbandonedObjectPool. * - * @param c - *the {@link Connection} to delegate all calls to. + * @param connection the {@link Connection} to delegate all calls to. */ -public DelegatingConnection(final C c) { -connection = c; +public DelegatingConnection(final C connection) { +this.connection = connection; } /** @@ -124,6 +123,11 @@ public class DelegatingConnection extends AbandonedTrace i return getDelegateInternal(); } +/** + * Gets the delegate connection. + * + * @return the delegate connection. + */ protected final C getDelegateInternal() { return connection; } @@ -264,90 +268,91 @@ public class DelegatingConnection extends AbandonedTrace i return e; } -private void initializeStatement(final DelegatingStatement ds) throws SQLException { -if (defaultQueryTimeoutSeconds != null && defaultQueryTimeoutSeconds != ds.getQueryTimeout()) { -ds.setQueryTimeout(defaultQueryTimeoutSeconds); +/** + * Initializes the given statement with this connection's settings. + * + * @param The DelegatingStatement type. + * @param delegatingStatement The DelegatingStatement to initialize. + * @return The given DelegatingStatement. + * @throws SQLException if a database access error occurs, this method is called on a closed Statement. + */ +private T init(final T delegatingStatement) throws SQLException { +if (defaultQueryTimeoutSeconds != null && defaultQueryTimeoutSeconds != delegatingStatement.getQueryTimeout()) { +delegatingStatement.setQueryTimeout(defaultQueryTimeoutSeconds); } +return delegatingStatement; } +@SuppressWarnings("resource") // Caller is responsible for closing the resource. @Override public Statement createStatement() throws SQLException { checkOpen(); try { -final DelegatingStatement ds = new DelegatingStatement(this, connection.createStatement()); -initializeStatement(ds); -return ds; +return init(new DelegatingStatement(this, connection.createStatement())); } catch (final SQLException e) { handleException(e); return null; } } +@SuppressWarnings("resource") // Caller is responsible for closing the resource. @Override public Statement createStatement(final int resultSetType, final int resultSetConcurrency) throws SQLException { checkOpen(); try { -final DelegatingStatement ds = new DelegatingStatement(this, -connection.createStatement(resultSetType, resultSetConcurrency)); -initializeStatement(ds); -return ds; +return init(new DelegatingStatement(this, connection.createStatement(resultSetType, resultSetConcurrency))); } catch (final SQLException e) { handleException(e); return null; } } +@SuppressWarnings("resource") // Caller is responsible for closing the resource. @Override public PreparedStatement prepareStatement(final String sql) throws SQLException { checkOpen(); try { -final DelegatingPreparedStatement dps = new DelegatingPreparedStatement(this, -connection.prepareStatement(sql)); -initializeStatement(dps); -return dps; +return init(new DelegatingPreparedStatement(this, connection.prepareStatement(sql))); } catch (final SQLException e) { handleExc
[commons-dbcp] branch master updated: Drop deprecated package private constructor.
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 d768e13 Drop deprecated package private constructor. d768e13 is described below commit d768e13c8f6007b2c233359763a36f20f1fb84ec Author: Gary Gregory AuthorDate: Sun Jun 6 11:17:54 2021 -0400 Drop deprecated package private constructor. --- .../commons/dbcp2/datasources/PooledConnectionAndInfo.java | 10 -- 1 file changed, 10 deletions(-) diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java b/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java index 04d3d51..6992dd9 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java @@ -46,16 +46,6 @@ final class PooledConnectionAndInfo { } /** - * Constructs a new instance. - * - * @deprecated Since 2.4.0 - */ -@Deprecated -PooledConnectionAndInfo(final PooledConnection pc, final String userName, final String userPassword) { -this(pc, userName, Utils.toCharArray(userPassword)); -} - -/** * Gets the pooled connection. * * @return
[commons-dbcp] branch master updated: Deduplicate internals.
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 33ddd60 Deduplicate internals. 33ddd60 is described below commit 33ddd6066e68aaa71d78d240a058dff24f56844a Author: Gary Gregory AuthorDate: Sun Jun 6 11:32:26 2021 -0400 Deduplicate internals. --- .../dbcp2/datasources/PooledConnectionAndInfo.java | 23 -- .../commons/dbcp2/datasources/UserPassKey.java | 2 +- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java b/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java index 6992dd9..8e16c59 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java @@ -19,8 +19,6 @@ package org.apache.commons.dbcp2.datasources; import javax.sql.PooledConnection; -import org.apache.commons.dbcp2.Utils; - /** * Immutable poolable object holding a {@link PooledConnection} along with the user name and password used to create the * connection. @@ -28,9 +26,8 @@ import org.apache.commons.dbcp2.Utils; * @since 2.0 */ final class PooledConnectionAndInfo { + private final PooledConnection pooledConnection; -private final char[] userPassword; -private final String userName; private final UserPassKey upKey; /** @@ -40,15 +37,13 @@ final class PooledConnectionAndInfo { */ PooledConnectionAndInfo(final PooledConnection pc, final String userName, final char[] userPassword) { this.pooledConnection = pc; -this.userName = userName; -this.userPassword = userPassword; this.upKey = new UserPassKey(userName, userPassword); } /** * Gets the pooled connection. * - * @return + * @return the pooled connection. */ PooledConnection getPooledConnection() { return pooledConnection; @@ -64,17 +59,7 @@ final class PooledConnectionAndInfo { * @return value of password. */ String getPassword() { -return Utils.toString(userPassword); -} - -/** - * Gets the value of password. - * - * @return value of password. - * @since 2.4.0 - */ -char[] getPasswordCharArray() { -return userPassword; +return upKey.getPassword(); } /** @@ -83,6 +68,6 @@ final class PooledConnectionAndInfo { * @return value of userName. */ String getUsername() { -return userName; +return upKey.getUserName(); } } diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/UserPassKey.java b/src/main/java/org/apache/commons/dbcp2/datasources/UserPassKey.java index 0149655..a64f70b 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/UserPassKey.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/UserPassKey.java @@ -95,7 +95,7 @@ class UserPassKey implements Serializable { * @return value of password. */ char[] getPasswordCharArray() { -return userPassword; +return userPassword == null ? userPassword : userPassword.clone(); } /**
[commons-geometry] branch master updated: removing dependabot config; updating build deps
This is an automated email from the ASF dual-hosted git repository. mattjuntunen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-geometry.git The following commit(s) were added to refs/heads/master by this push: new f636fba removing dependabot config; updating build deps f636fba is described below commit f636fba99c6f64045800b7e7c653ad6124336613 Author: Matt Juntunen AuthorDate: Sun Jun 6 11:19:26 2021 -0400 removing dependabot config; updating build deps --- .github/dependabot.yml | 25 - commons-geometry-examples/examples-jmh/pom.xml | 2 +- pom.xml| 4 ++-- 3 files changed, 3 insertions(+), 28 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 5b47509..000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -version: 2 -updates: - - package-ecosystem: "maven" -directory: "/" -schedule: - interval: "daily" - - package-ecosystem: "github-actions" -directory: "/" -schedule: - interval: "daily" diff --git a/commons-geometry-examples/examples-jmh/pom.xml b/commons-geometry-examples/examples-jmh/pom.xml index 4a006f9..0165312 100644 --- a/commons-geometry-examples/examples-jmh/pom.xml +++ b/commons-geometry-examples/examples-jmh/pom.xml @@ -40,7 +40,7 @@ ${basedir}/../.. -1.29 +1.32 examples-jmh org.openjdk.jmh.Main diff --git a/pom.xml b/pom.xml index 21d9ee6..d1d1673 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 1.8 1.8 3.14.0 -6.33.0 +6.35.0 3.1.2 8.41.1 2.7.2 @@ -98,7 +98,7 @@ 1.0-SNAPSHOT 1.3 -5.7.1 +5.8.0-M1
[commons-dbcp] branch master updated: Update PoolKey#toString() to avoid revealing a user name is here.
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 c90720c Update PoolKey#toString() to avoid revealing a user name is here. c90720c is described below commit c90720c766be12960913f05c63c68adc267257b2 Author: Gary Gregory AuthorDate: Sun Jun 6 11:40:26 2021 -0400 Update PoolKey#toString() to avoid revealing a user name is here. Javadoc. --- src/changes/changes.xml| 3 +++ .../org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java| 2 +- src/main/java/org/apache/commons/dbcp2/datasources/PoolKey.java| 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 9285023..33f217e 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -138,6 +138,9 @@ The type attribute can be add,update,fix,remove. Simplify and inline variables #99. + +Update PoolKey#toString() to avoid revealing a user name is here. + Bump mockito-core from 3.5.11 to 3.11.0 #66, #72, #77, #85, #91, #105, #110. 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 1a64425..d56b2b0 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java @@ -922,7 +922,7 @@ public abstract class InstanceKeyDataSource implements DataSource, Referenceable /** * Attempts to retrieve a database connection using {@link #getPooledConnectionAndInfo(String, String)} with the - * provided user name and password. The password on the {@link PooledConnectionAndInfo} instance returned by + * provided user name and password. The password on the {@code PooledConnectionAndInfo} instance returned by * getPooledConnectionAndInfo is compared to the password parameter. If the comparison * fails, a database connection using the supplied user name and password is attempted. If the connection attempt * fails, an SQLException is thrown, indicating that the given password did not match the password used to create diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/PoolKey.java b/src/main/java/org/apache/commons/dbcp2/datasources/PoolKey.java index 0dcaace..89f8c69 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/PoolKey.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/PoolKey.java @@ -61,7 +61,7 @@ class PoolKey implements Serializable { public String toString() { final StringBuilder sb = new StringBuilder(50); sb.append("PoolKey("); -sb.append("UserName").append(", ").append(dataSourceName); +sb.append(dataSourceName); sb.append(')'); return sb.toString(); }
[commons-dbcp] branch master updated: Internal package private UserPassKey class stores its user name as a char[] as it already does the password.
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 20b52b9 Internal package private UserPassKey class stores its user name as a char[] as it already does the password. 20b52b9 is described below commit 20b52b9ade235c599ce7a4aaeccd37a6af687fb2 Author: Gary Gregory AuthorDate: Sun Jun 6 12:20:02 2021 -0400 Internal package private UserPassKey class stores its user name as a char[] as it already does the password. --- src/changes/changes.xml| 3 + .../commons/dbcp2/datasources/CharArray.java | 91 ++ .../dbcp2/datasources/PooledConnectionAndInfo.java | 30 +++ .../commons/dbcp2/datasources/UserPassKey.java | 31 4 files changed, 124 insertions(+), 31 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 33f217e..8f284f1 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -141,6 +141,9 @@ The type attribute can be add,update,fix,remove. Update PoolKey#toString() to avoid revealing a user name is here. + +Internal package private UserPassKey class stores its user name as a char[] as it already does the password. + Bump mockito-core from 3.5.11 to 3.11.0 #66, #72, #77, #85, #91, #105, #110. diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/CharArray.java b/src/main/java/org/apache/commons/dbcp2/datasources/CharArray.java new file mode 100644 index 000..e0334ef --- /dev/null +++ b/src/main/java/org/apache/commons/dbcp2/datasources/CharArray.java @@ -0,0 +1,91 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.dbcp2.datasources; + +import java.util.Arrays; + +import org.apache.commons.dbcp2.Utils; + +/** + * A {@code char} array wrapper that does not reveal its contents inadvertently through toString(). In contrast to, for + * example, AtomicReference which toString()'s its contents. + * + * May contain null. + * + * @since 2.9.0 + */ +final class CharArray { + +static final CharArray NULL = new CharArray((char[]) null); + +private final char[] chars; + +CharArray(final char[] chars) { +this.chars = chars; +} + +CharArray(final String string) { +this(Utils.toCharArray(string)); +} + +@Override +public int hashCode() { +final int prime = 31; +int result = 1; +result = prime * result + Arrays.hashCode(chars); +return result; +} + +@Override +public boolean equals(final Object obj) { +if (this == obj) { +return true; +} +if (!(obj instanceof CharArray)) { +return false; +} +final CharArray other = (CharArray) obj; +return Arrays.equals(chars, other.chars); +} + +/** + * Converts the value of char array as a String. + * + * @return value as a string, may be null. + */ +String asString() { +return Utils.toString(chars); +} + +/** + * Gets the value of char array. + * + * @return value, may be null. + */ +char[] get() { +return chars == null ? null : chars.clone(); +} + +/** + * Calls {@code super.toString()} and does not reveal its contents inadvertently. + */ +@Override +public String toString() { +return super.toString(); +} +} diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java b/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java index 8e16c59..620eedb 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/PooledConnectionAndInfo.java @@ -28,7 +28,7 @@ import javax.sql.PooledConnection; final class PooledConnectionAndInfo { private final PooledConnection pooledConnection; -private final UserPassKey upKey; +private final UserPassKey userPassKey; /*
[commons-dbcp] branch master updated: Internal package private CPDSConnectionFactory class stores its user name as a char[] as it already does the password.
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 7da0703 Internal package private CPDSConnectionFactory class stores its user name as a char[] as it already does the password. 7da0703 is described below commit 7da0703a04e58335638da4a943e56bdec2a4d10a Author: Gary Gregory AuthorDate: Sun Jun 6 12:31:05 2021 -0400 Internal package private CPDSConnectionFactory class stores its user name as a char[] as it already does the password. --- .../commons/dbcp2/datasources/CPDSConnectionFactory.java| 10 +- .../org/apache/commons/dbcp2/datasources/CharArray.java | 2 +- .../dbcp2/datasources/KeyedCPDSConnectionFactory.java | 12 ++-- .../commons/dbcp2/datasources/PooledConnectionAndInfo.java | 13 + .../org/apache/commons/dbcp2/datasources/UserPassKey.java | 4 .../dbcp2/datasources/TestInstanceKeyDataSource.java| 2 +- 6 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/CPDSConnectionFactory.java b/src/main/java/org/apache/commons/dbcp2/datasources/CPDSConnectionFactory.java index e2fc3e6..ddb1eb4 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/CPDSConnectionFactory.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/CPDSConnectionFactory.java @@ -52,7 +52,7 @@ class CPDSConnectionFactory private final int validationQueryTimeoutSeconds; private final boolean rollbackAfterValidation; private ObjectPool pool; -private final String userName; +private char[] userName; private char[] userPassword; private Duration maxConnLifetime = Duration.ofMillis(-1); @@ -91,7 +91,7 @@ class CPDSConnectionFactory this.cpds = cpds; this.validationQuery = validationQuery; this.validationQueryTimeoutSeconds = validationQueryTimeoutSeconds; -this.userName = userName; +this.userName = Utils.toCharArray(userName); this.userPassword = userPassword; this.rollbackAfterValidation = rollbackAfterValidation; } @@ -116,9 +116,9 @@ class CPDSConnectionFactory */ public CPDSConnectionFactory(final ConnectionPoolDataSource cpds, final String validationQuery, final int validationQueryTimeoutSeconds, final boolean rollbackAfterValidation, final String userName, -final String userPassword) { +final String userPassword) { this(cpds, validationQuery, validationQueryTimeoutSeconds, rollbackAfterValidation, userName, -Utils.toCharArray(userPassword)); +Utils.toCharArray(userPassword)); } /** @@ -156,7 +156,7 @@ class CPDSConnectionFactory if (userName == null) { pc = cpds.getPooledConnection(); } else { -pc = cpds.getPooledConnection(userName, Utils.toString(userPassword)); +pc = cpds.getPooledConnection(Utils.toString(userName), Utils.toString(userPassword)); } if (pc == null) { diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/CharArray.java b/src/main/java/org/apache/commons/dbcp2/datasources/CharArray.java index e0334ef..2bea59a 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/CharArray.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/CharArray.java @@ -24,7 +24,7 @@ import org.apache.commons.dbcp2.Utils; /** * A {@code char} array wrapper that does not reveal its contents inadvertently through toString(). In contrast to, for * example, AtomicReference which toString()'s its contents. - * + * * May contain null. * * @since 2.9.0 diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/KeyedCPDSConnectionFactory.java b/src/main/java/org/apache/commons/dbcp2/datasources/KeyedCPDSConnectionFactory.java index f57b82b..e8c9297 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/KeyedCPDSConnectionFactory.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/KeyedCPDSConnectionFactory.java @@ -105,17 +105,17 @@ class KeyedCPDSConnectionFactory implements KeyedPooledObjectFactory makeObject(final UserPassKey upkey) throws Exception { +public synchronized PooledObject makeObject(final UserPassKey userPassKey) throws Exception { PooledConnection pooledConnection = null; -final String userName = upkey.getUserName(); -final String password = upkey.getPassword(); +final String userName = userPassKey.getUserName(); +final String password = userPassKey.getPassword(); if (userName == null) { pooledConnection = cpds.getPooledConnection(); } else { @@ -129,7 +129,7 @@ class KeyedCPDSConnectionFactory implements KeyedPooledObjectFacto
[commons-dbcp] branch master updated: Clone char array before storing it.
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 0fdbfcd Clone char array before storing it. 0fdbfcd is described below commit 0fdbfcda6d3daa51ef79c7428b479be79afbc7c4 Author: Gary Gregory AuthorDate: Sun Jun 6 13:07:31 2021 -0400 Clone char array before storing it. --- .../apache/commons/dbcp2/datasources/CharArray.java| 4 ++-- .../apache/commons/dbcp2/datasources/UserPassKey.java | 18 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/CharArray.java b/src/main/java/org/apache/commons/dbcp2/datasources/CharArray.java index 2bea59a..e6d299a 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/CharArray.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/CharArray.java @@ -36,11 +36,11 @@ final class CharArray { private final char[] chars; CharArray(final char[] chars) { -this.chars = chars; +this.chars = Utils.clone(chars); } CharArray(final String string) { -this(Utils.toCharArray(string)); +this.chars = Utils.toCharArray(string); } @Override diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/UserPassKey.java b/src/main/java/org/apache/commons/dbcp2/datasources/UserPassKey.java index ac06184..da9ec03 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/UserPassKey.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/UserPassKey.java @@ -40,13 +40,13 @@ import org.apache.commons.pool2.KeyedObjectPool; class UserPassKey implements Serializable { private static final long serialVersionUID = 5142970911626584817L; -private final CharArray userName; -private final CharArray userPassword; +private final CharArray name; +private final CharArray password; UserPassKey(CharArray userName, CharArray userPassword) { super(); -this.userName = userName; -this.userPassword = userPassword; +this.name = userName; +this.password = userPassword; } UserPassKey(final String userName) { @@ -80,7 +80,7 @@ class UserPassKey implements Serializable { return false; } final UserPassKey other = (UserPassKey) obj; -return Objects.equals(userName, other.userName); +return Objects.equals(name, other.name); } /** @@ -89,7 +89,7 @@ class UserPassKey implements Serializable { * @return value of password. */ String getPassword() { -return userPassword.asString(); +return password.asString(); } /** @@ -98,7 +98,7 @@ class UserPassKey implements Serializable { * @return value of password. */ char[] getPasswordCharArray() { -return userPassword.get(); +return password.get(); } /** @@ -107,7 +107,7 @@ class UserPassKey implements Serializable { * @return value of user name. */ String getUserName() { -return userName.asString(); +return name.asString(); } /** @@ -115,7 +115,7 @@ class UserPassKey implements Serializable { */ @Override public int hashCode() { -return Objects.hash(userName); +return Objects.hash(name); } }
[commons-dbcp] branch master updated: Bump checkstyle to 8.43.
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 07382a9 Bump checkstyle to 8.43. 07382a9 is described below commit 07382a9521b5b43b324803e3cee3cc8d8f625177 Author: Gary Gregory AuthorDate: Sun Jun 6 13:16:49 2021 -0400 Bump checkstyle to 8.43. --- checkstyle.xml | 2 +- pom.xml | 12 ++-- src/changes/changes.xml | 3 +++ .../commons/dbcp2/datasources/InstanceKeyDataSource.java | 3 +++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/checkstyle.xml b/checkstyle.xml index fbf6c7c..8bafc75 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -78,7 +78,7 @@ - + diff --git a/pom.xml b/pom.xml index 58cf296..58139da 100644 --- a/pom.xml +++ b/pom.xml @@ -321,7 +321,8 @@ DBCP 12310469 -3.1.2 + 3.1.2 +8.43 3.3.0 2.10.0 @@ -362,7 +363,14 @@ org.apache.maven.plugins maven-checkstyle-plugin - ${commons.checkstyle.version} + ${commons.checkstyle-plugin.version} + + + com.puppycrawl.tools + checkstyle + ${commons.checkstyle.version} + + ${basedir}/checkstyle.xml false diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 8f284f1..5721121 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -196,6 +196,9 @@ The type attribute can be add,update,fix,remove. Bump commons-pool2 from 2.9.0 to 2.10.0. + +Bump checkstyle to 8.43. + 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 d56b2b0..e6d3893 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java @@ -1010,6 +1010,9 @@ public abstract class InstanceKeyDataSource implements DataSource, Referenceable } } +/** + * This method is protected but can only be implemented in this package because PooledConnectionAndInfo is a package private type. + */ protected abstract PooledConnectionAndInfo getPooledConnectionAndInfo(String userName, String userPassword) throws SQLException;
[commons-dbcp] branch master updated: Test CharArray.
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 d569ec5 Test CharArray. d569ec5 is described below commit d569ec515ccc94747b66bcbf08c84775f8073ce1 Author: Gary Gregory AuthorDate: Sun Jun 6 13:27:36 2021 -0400 Test CharArray. --- .../commons/dbcp2/datasources/CharArrayTest.java | 57 ++ 1 file changed, 57 insertions(+) diff --git a/src/test/java/org/apache/commons/dbcp2/datasources/CharArrayTest.java b/src/test/java/org/apache/commons/dbcp2/datasources/CharArrayTest.java new file mode 100644 index 000..7b81678 --- /dev/null +++ b/src/test/java/org/apache/commons/dbcp2/datasources/CharArrayTest.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.dbcp2.datasources; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import org.junit.jupiter.api.Test; + +/** + * Tests {@link CharArray}. + */ +public class CharArrayTest { + +@Test +public void testAsString() { +assertEquals("foo", new CharArray("foo").asString()); +} + +@Test +public void testEquals() { +assertEquals(new CharArray("foo"), new CharArray("foo")); +assertNotEquals(new CharArray("foo"), new CharArray("bar")); +} + +@Test +public void testGet() { +assertArrayEquals("foo".toCharArray(), new CharArray("foo").get()); +} + +@Test +public void testHashCode() { +assertEquals(new CharArray("foo").hashCode(), new CharArray("foo").hashCode()); +assertNotEquals(new CharArray("foo").hashCode(), new CharArray("bar").hashCode()); +} + +@Test +public void testToString() { +assertFalse(new CharArray("foo").toString().contains("foo")); +} +}
[commons-dbcp] branch master updated: Use UserPassKey internally.
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 982e9ca Use UserPassKey internally. 982e9ca is described below commit 982e9caf8b691993b78d32f0495742d021d95a47 Author: Gary Gregory AuthorDate: Sun Jun 6 13:37:59 2021 -0400 Use UserPassKey internally. --- .../dbcp2/datasources/CPDSConnectionFactory.java | 22 ++ .../dbcp2/datasources/SharedPoolDataSource.java| 11 +++ 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/CPDSConnectionFactory.java b/src/main/java/org/apache/commons/dbcp2/datasources/CPDSConnectionFactory.java index ddb1eb4..2323348 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/CPDSConnectionFactory.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/CPDSConnectionFactory.java @@ -52,8 +52,7 @@ class CPDSConnectionFactory private final int validationQueryTimeoutSeconds; private final boolean rollbackAfterValidation; private ObjectPool pool; -private char[] userName; -private char[] userPassword; +private UserPassKey userPassKey; private Duration maxConnLifetime = Duration.ofMillis(-1); /** @@ -87,12 +86,11 @@ class CPDSConnectionFactory */ public CPDSConnectionFactory(final ConnectionPoolDataSource cpds, final String validationQuery, final int validationQueryTimeoutSeconds, final boolean rollbackAfterValidation, final String userName, -final char[] userPassword) { +final char[] userPassword) { this.cpds = cpds; this.validationQuery = validationQuery; this.validationQueryTimeoutSeconds = validationQueryTimeoutSeconds; -this.userName = Utils.toCharArray(userName); -this.userPassword = userPassword; +this.userPassKey = new UserPassKey(userName, userPassword); this.rollbackAfterValidation = rollbackAfterValidation; } @@ -127,7 +125,7 @@ class CPDSConnectionFactory * @return value of password. */ char[] getPasswordCharArray() { -return userPassword; +return userPassKey.getPasswordCharArray(); } /** @@ -153,10 +151,10 @@ class CPDSConnectionFactory final PooledConnectionAndInfo pci; try { PooledConnection pc = null; -if (userName == null) { +if (userPassKey.getUserName() == null) { pc = cpds.getPooledConnection(); } else { -pc = cpds.getPooledConnection(Utils.toString(userName), Utils.toString(userPassword)); +pc = cpds.getPooledConnection(userPassKey.getUserName(), userPassKey.getPassword()); } if (pc == null) { @@ -166,7 +164,7 @@ class CPDSConnectionFactory // should we add this object as a listener or the pool. // consider the validateObject method in decision pc.addConnectionEventListener(this); -pci = new PooledConnectionAndInfo(pc, userName, userPassword); +pci = new PooledConnectionAndInfo(pc, userPassKey); pcMap.put(pc, pci); } catch (final SQLException e) { throw new RuntimeException(e.getMessage()); @@ -340,7 +338,7 @@ class CPDSConnectionFactory *new password */ public synchronized void setPassword(final char[] userPassword) { -this.userPassword = Utils.clone(userPassword); +this.userPassKey = new UserPassKey(userPassKey.getUserName(), userPassword); } /** @@ -351,7 +349,7 @@ class CPDSConnectionFactory */ @Override public synchronized void setPassword(final String userPassword) { -this.userPassword = Utils.toCharArray(userPassword); +this.userPassKey = new UserPassKey(userPassKey.getUserName(), userPassword); } /** @@ -386,7 +384,7 @@ class CPDSConnectionFactory @Override public void closePool(final String userName) throws SQLException { synchronized (this) { -if (userName == null || !userName.equals(this.userName)) { +if (userName == null || !userName.equals(this.userPassKey.getUserName())) { return; } } diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java b/src/main/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java index 96f831c..e735c98 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java @@ -126,25 +126,20 @@ public class SharedPoolDataSource extends InstanceKeyDataSource { try { registerPool(userName, userPas
[commons-dbcp] branch master updated (982e9ca -> c512dca)
This is an automated email from the ASF dual-hosted git repository. ggregory pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/commons-dbcp.git. from 982e9ca Use UserPassKey internally. new 6272dd6 Sort members. new c512dca Add and reuse InstanceKeyDataSource.{get|set}DefaultMaxWait(Duration), deprecate .{get|set}DefaultMaxWaitMillis(long). The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/changes/changes.xml| 18 +- .../dbcp2/datasources/InstanceKeyDataSource.java | 45 +- .../dbcp2/datasources/PerUserPoolDataSource.java | 12 +- .../dbcp2/datasources/SharedPoolDataSource.java|2 +- .../datasources/TestPerUserPoolDataSource.java | 1258 ++-- 5 files changed, 683 insertions(+), 652 deletions(-)
[commons-dbcp] 02/02: Add and reuse InstanceKeyDataSource.{get|set}DefaultMaxWait(Duration), deprecate .{get|set}DefaultMaxWaitMillis(long).
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 commit c512dca8cebf05643a6905868f884cd909cc34ee Author: Gary Gregory AuthorDate: Sun Jun 6 19:21:57 2021 -0400 Add and reuse InstanceKeyDataSource.{get|set}DefaultMaxWait(Duration), deprecate .{get|set}DefaultMaxWaitMillis(long). Javadoc. --- src/changes/changes.xml| 18 ++--- .../dbcp2/datasources/InstanceKeyDataSource.java | 45 +- .../dbcp2/datasources/PerUserPoolDataSource.java | 12 +++--- .../dbcp2/datasources/SharedPoolDataSource.java| 2 +- 4 files changed, 54 insertions(+), 23 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 5721121..6bb24e1 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -63,22 +63,28 @@ The type attribute can be add,update,fix,remove. - Add and reuse Constants.KEY_USER and Constants.KEY_PASSWORD. +Add and reuse Constants.KEY_USER and Constants.KEY_PASSWORD. - Add and reuse DataSourceMXBean. +Add and reuse DataSourceMXBean. - Add and reuse DriverAdapterCPDS.{get|set}DurationBetweenEvictionRuns(), deprecate {get|set}TimeBetweenEvictionRunsMillis(long). +Add and reuse DriverAdapterCPDS.{get|set}DurationBetweenEvictionRuns(), deprecate {get|set}TimeBetweenEvictionRunsMillis(long). - Add and reuse DriverAdapterCPDS.{get|set}MinEvictableIdleDuration(), deprecate {get|set}MinEvictableIdleTimeMillis(int). +Add and reuse DriverAdapterCPDS.{get|set}MinEvictableIdleDuration(), deprecate {get|set}MinEvictableIdleTimeMillis(int). - Add and reuse CPDSConnectionFactory.setMaxConnLifetime(Duration), deprecate setMaxConnLifetimeMillis(long). +Add and reuse CPDSConnectionFactory.setMaxConnLifetime(Duration), deprecate setMaxConnLifetimeMillis(long). - Add and reuse KeyedCPDSConnectionFactory.setMaxConnLifetime(Duration), deprecate setMaxConnLifetimeMillis(long). +Add and reuse KeyedCPDSConnectionFactory.setMaxConnLifetime(Duration), deprecate setMaxConnLifetimeMillis(long). + + +Add and reuse KeyedCPDSConnectionFactory.setMaxConnLifetime(Duration), deprecate setMaxConnLifetimeMillis(long). + + +Add and reuse InstanceKeyDataSource.{get|set}DefaultMaxWait(Duration), deprecate {get|set}DefaultMaxWaitMillis(long). 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 e6d3893..9d2aa60 100644 --- a/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java +++ b/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java @@ -116,7 +116,7 @@ public abstract class InstanceKeyDataSource implements DataSource, Referenceable private boolean defaultLifo = BaseObjectPoolConfig.DEFAULT_LIFO; private int defaultMaxIdle = GenericKeyedObjectPoolConfig.DEFAULT_MAX_IDLE_PER_KEY; private int defaultMaxTotal = GenericKeyedObjectPoolConfig.DEFAULT_MAX_TOTAL; -private long defaultMaxWaitMillis = BaseObjectPoolConfig.DEFAULT_MAX_WAIT_MILLIS; +private Duration defaultMaxWaitDuration = BaseObjectPoolConfig.DEFAULT_MAX_WAIT; private long defaultMinEvictableIdleTimeMillis = BaseObjectPoolConfig.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS; private int defaultMinIdle = GenericKeyedObjectPoolConfig.DEFAULT_MIN_IDLE_PER_KEY; private int defaultNumTestsPerEvictionRun = BaseObjectPoolConfig.DEFAULT_NUM_TESTS_PER_EVICTION_RUN; @@ -293,9 +293,21 @@ public abstract class InstanceKeyDataSource implements DataSource, Referenceable * Gets the default value for {@link GenericKeyedObjectPoolConfig#getMaxWaitMillis()} for each per user pool. * * @return The default value for {@link GenericKeyedObjectPoolConfig#getMaxWaitMillis()} for each per user pool. + * @since 2.9.0 */ +public Duration getDefaultMaxWait() { +return this.defaultMaxWaitDuration; +} + +/** + * Gets the default value for {@link GenericKeyedObjectPoolConfig#getMaxWaitMillis()} for each per user pool. + * + * @return The default value for {@link GenericKeyedObjectPoolConfig#getMaxWaitMillis()} for each per user pool. + * @deprecated Use {@link #getDefaultMaxWait()}. + */ +@Deprecated public long getDefaultMaxWaitMillis() { -return this.defaultMaxWaitMillis; +return getDefaultMaxWait().toMillis(); } /** @@ -303,17 +315,30 @@ public abstract class InstanceKeyDataSource implements DataSource, Referenceable * * @param maxWaitMillis *The default value for {@l
[commons-dbcp] 01/02: Sort members.
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 commit 6272dd6204a8b5cb6be07c92cece94bf540d6172 Author: Gary Gregory AuthorDate: Sun Jun 6 13:48:15 2021 -0400 Sort members. --- .../datasources/TestPerUserPoolDataSource.java | 1258 ++-- 1 file changed, 629 insertions(+), 629 deletions(-) diff --git a/src/test/java/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java b/src/test/java/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java index a261ce9..8acb85f 100644 --- a/src/test/java/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java +++ b/src/test/java/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java @@ -51,13 +51,13 @@ public class TestPerUserPoolDataSource extends TestConnectionPool { private String user; +private DataSource ds; + @Override protected Connection getConnection() throws SQLException { return ds.getConnection(user,"bar"); } -private DataSource ds; - @BeforeEach public void setUp() throws Exception { user = "foo"; @@ -87,76 +87,65 @@ public class TestPerUserPoolDataSource extends TestConnectionPool { ((PerUserPoolDataSource) ds).close(); } -/** - * Switching 'u1 to 'u2' and 'p1' to 'p2' will - * exhibit the bug detailed in - * https://issues.apache.org/bugzilla/show_bug.cgi?id=18905 - */ +// See DBCP-8 @Test -public void testIncorrectPassword() throws Exception { -// Use bad password -try (Connection c = ds.getConnection("u1", "zlsafjk")){ -fail("Able to retrieve connection with incorrect password"); -} catch (final SQLException e1) { -// should fail - -} - -// Use good password -ds.getConnection("u1", "p1").close(); -try (Connection c = ds.getConnection("u1", "x")){ -fail("Able to retrieve connection with incorrect password"); -} catch (final SQLException e) { -if (!e.getMessage().startsWith("Given password did not match")) { -throw e; -} -// else the exception was expected -} - -// Make sure we can still use our good password. -ds.getConnection("u1", "p1").close(); - -// Try related users and passwords -ds.getConnection(user, "bar").close(); -try (Connection c = ds.getConnection("foob", "ar")) { -fail("Should have caused an SQLException"); -} catch (final SQLException expected) { -} -try (Connection c = ds.getConnection(user, "baz")){ +public void testChangePassword() throws Exception { +try (Connection c = ds.getConnection(user, "bay")){ fail("Should have generated SQLException"); } catch (final SQLException expected) { } +final Connection con1 = ds.getConnection(user, "bar"); +final Connection con2 = ds.getConnection(user, "bar"); +final Connection con3 = ds.getConnection(user, "bar"); +con1.close(); +con2.close(); +TesterDriver.addUser(user,"bay"); // change the user/password setting +try { +final Connection con4 = ds.getConnection(user, "bay"); // new password +// Idle instances with old password should have been cleared +assertEquals(0, ((PerUserPoolDataSource) ds).getNumIdle(user), +"Should be no idle connections in the pool"); +con4.close(); +// Should be one idle instance with new pwd +assertEquals(1, ((PerUserPoolDataSource) ds).getNumIdle(user), +"Should be one idle connection in the pool"); +try (Connection c = ds.getConnection(user, "bar")) { // old password +fail("Should have generated SQLException"); +} catch (final SQLException expected) { +} +final Connection con5 = ds.getConnection(user, "bay"); // take the idle one +con3.close(); // Return a connection with the old password +ds.getConnection(user, "bay").close(); // will try bad returned connection and destroy it +assertEquals(1, ((PerUserPoolDataSource) ds).getNumIdle(user), +"Should be one idle connection in the pool"); +con5.close(); +} finally { +TesterDriver.addUser(user,"bar"); +} } @Override @Test -public void testSimple() throws Exception +public void testClosing() +throws Exception { -final Connection conn = ds.getConnection(); -assertNotNull(conn); -final PreparedStatement stmt = conn.prepareStatement("select * from dual"); -assertNotNull(stmt); -final ResultSet rset = stmt.executeQuery(); -
[commons-pool] branch master updated: Add BaseGenericObjectPool.{get|set}MaxWaitDuration(Duration) and deprecate {get|set}MaxWaitMillis(long).
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-pool.git The following commit(s) were added to refs/heads/master by this push: new e405182 Add BaseGenericObjectPool.{get|set}MaxWaitDuration(Duration) and deprecate {get|set}MaxWaitMillis(long). e405182 is described below commit e405182e6eaabc7422dfd6f65511b7883443b1e9 Author: Gary Gregory AuthorDate: Sun Jun 6 19:41:18 2021 -0400 Add BaseGenericObjectPool.{get|set}MaxWaitDuration(Duration) and deprecate {get|set}MaxWaitMillis(long). Add BaseObjectPoolConfig.{get|set}MaxWaitDuration(Duration) and deprecate {get|set}MaxWaitMillis(long). --- src/changes/changes.xml| 8 ++- .../commons/pool2/impl/BaseGenericObjectPool.java | 64 ++ .../commons/pool2/impl/BaseObjectPoolConfig.java | 50 + .../commons/pool2/impl/GenericKeyedObjectPool.java | 4 +- .../commons/pool2/impl/TestGenericObjectPool.java | 3 +- 5 files changed, 103 insertions(+), 26 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 0caa9b1..073cd4c 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -57,7 +57,13 @@ The type attribute can be add,update,fix,remove. - TrackedUse#getLastUsedInstant() - Add BaseObjectPoolConfig.setEvictorShutdownTimeout(Duration), setEvictorShutdownTimeoutMillis(Duration). + Add BaseObjectPoolConfig.{get|set}EvictorShutdownTimeout(Duration), {get|set}EvictorShutdownTimeoutMillis(Duration). + + + Add BaseGenericObjectPool.{get|set}MaxWaitDuration(Duration) and deprecate {get|set}MaxWaitMillis(long). + + + Add BaseObjectPoolConfig.{get|set}MaxWaitDuration(Duration) and deprecate {get|set}MaxWaitMillis(long). diff --git a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java index 3eb5f6f..025c041 100644 --- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java @@ -316,7 +316,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { // Configuration attributes private volatile int maxTotal = GenericKeyedObjectPoolConfig.DEFAULT_MAX_TOTAL; private volatile boolean blockWhenExhausted = BaseObjectPoolConfig.DEFAULT_BLOCK_WHEN_EXHAUSTED; -private volatile Duration maxWait = BaseObjectPoolConfig.DEFAULT_MAX_WAIT; +private volatile Duration maxWaitDuration = BaseObjectPoolConfig.DEFAULT_MAX_WAIT; private volatile boolean lifo = BaseObjectPoolConfig.DEFAULT_LIFO; private final boolean fairness; private volatile boolean testOnCreate = BaseObjectPoolConfig.DEFAULT_TEST_ON_CREATE; @@ -592,7 +592,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { } /** - * The maximum time a thread has waited to borrow objects from the pool. + * Gets the maximum time a thread has waited to borrow objects from the pool. * @return maximum wait time in milliseconds since the pool was created */ public final long getMaxBorrowWaitTimeMillis() { @@ -615,6 +615,24 @@ public abstract class BaseGenericObjectPool extends BaseObject { } /** + * Gets the maximum duration the + * {@code borrowObject()} method should block before throwing an + * exception when the pool is exhausted and + * {@link #getBlockWhenExhausted} is true. When less than 0, the + * {@code borrowObject()} method may block indefinitely. + * + * @return the maximum number of milliseconds {@code borrowObject()} + * will block. + * + * @see #setMaxWaitDuration + * @see #setBlockWhenExhausted + * @since 2.11.0 + */ +public final Duration getMaxWaitDuration() { +return maxWaitDuration; +} + +/** * Gets the maximum amount of time (in milliseconds) the * {@code borrowObject()} method should block before throwing an * exception when the pool is exhausted and @@ -624,11 +642,12 @@ public abstract class BaseGenericObjectPool extends BaseObject { * @return the maximum number of milliseconds {@code borrowObject()} * will block. * - * @see #setMaxWaitMillis + * @see #setMaxWaitDuration * @see #setBlockWhenExhausted + * @deprecated Use {@link #getMaxWaitDuration()}. */ public final long getMaxWaitMillis() { -return maxWait.toMillis(); +return maxWaitDuration.toMillis(); } /** @@ -1009,7 +1028,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { */ protected void setConfig(final BaseObjectPoolConfig config) { setLifo(config.getLifo()); -setMaxWaitMillis(config.getMaxWaitMillis()); +
[commons-compress] branch dependabot/maven/com.github.luben-zstd-jni-1.5.0-1 created (now d42c693)
This is an automated email from the ASF dual-hosted git repository. github-bot pushed a change to branch dependabot/maven/com.github.luben-zstd-jni-1.5.0-1 in repository https://gitbox.apache.org/repos/asf/commons-compress.git. at d42c693 Bump zstd-jni from 1.4.9-1 to 1.5.0-1 No new revisions were added by this update.