[2/2] commons-pool git commit: Add self to pom
Add self to pom Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/868b9fd6 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/868b9fd6 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/868b9fd6 Branch: refs/heads/master Commit: 868b9fd6cec388d24f99d5840ea0c42c2d6a0baf Parents: 88c6bed Author: Matt Sicker Authored: Sun Mar 12 14:52:37 2017 -0500 Committer: Matt Sicker Committed: Sun Mar 12 14:52:37 2017 -0500 -- pom.xml | 5 + 1 file changed, 5 insertions(+) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/868b9fd6/pom.xml -- diff --git a/pom.xml b/pom.xml index 42130c0..42fadd2 100644 --- a/pom.xml +++ b/pom.xml @@ -104,6 +104,11 @@ ggregory The Apache Software Foundation + + Matt Sicker + mattsicker + The Apache Software Foundation +
[1/2] commons-pool git commit: Update scm config to git
Repository: commons-pool Updated Branches: refs/heads/master 3994baf0f -> 868b9fd6c Update scm config to git Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/88c6bedf Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/88c6bedf Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/88c6bedf Branch: refs/heads/master Commit: 88c6bedf050657e1d168e0649364d2566dabf9ca Parents: 3994baf Author: Matt Sicker Authored: Sun Mar 12 14:51:46 2017 -0500 Committer: Matt Sicker Committed: Sun Mar 12 14:51:46 2017 -0500 -- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/88c6bedf/pom.xml -- diff --git a/pom.xml b/pom.xml index e54fd08..42130c0 100644 --- a/pom.xml +++ b/pom.xml @@ -40,9 +40,9 @@ - scm:svn:http://svn.apache.org/repos/asf/commons/proper/pool/trunk - scm:svn:https://svn.apache.org/repos/asf/commons/proper/pool/trunk -http://svn.apache.org/viewvc/commons/proper/pool/trunk + scm:git:https://git-wip-us.apache.org/repos/asf/commons-pool.git + https://git-wip-us.apache.org/repos/asf/commons-pool.git +https://git-wip-us.apache.org/repos/asf?p=commons-pool.git
[06/50] [abbrv] commons-pool git commit: commons-parent 34 -> 39.
commons-parent 34 -> 39. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1724895 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/1d288b3f Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/1d288b3f Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/1d288b3f Branch: refs/heads/master Commit: 1d288b3f0803964666b117082fdfd519cd93191f Parents: 2cf21c4 Author: Gary D. Gregory Authored: Fri Jan 15 23:52:32 2016 + Committer: Gary D. Gregory Committed: Fri Jan 15 23:52:32 2016 + -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/1d288b3f/pom.xml -- diff --git a/pom.xml b/pom.xml index d99624c..08693ad 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ org.apache.commons commons-parent -34 +39 4.0.0 commons-pool2
[05/50] [abbrv] commons-pool git commit: Obsolete DOAP
Obsolete DOAP git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/branches/performance-ideas@1719171 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/ae5838a2 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/ae5838a2 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/ae5838a2 Branch: refs/heads/performance-ideas Commit: ae5838a2d9a1bfec10c7c63f17c4d34fc72826ce Parents: 97261a2 Author: Sebastian Bazley Authored: Thu Dec 10 18:17:08 2015 + Committer: Sebastian Bazley Committed: Thu Dec 10 18:17:08 2015 + -- doap_pool.rdf | 50 -- 1 file changed, 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/ae5838a2/doap_pool.rdf -- diff --git a/doap_pool.rdf b/doap_pool.rdf deleted file mode 100644 index dc3fc84..000 --- a/doap_pool.rdf +++ /dev/null @@ -1,50 +0,0 @@ - -http://usefulinc.com/ns/doap#"; xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:asfext="http://projects.apache.org/ns/asfext#"; xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"; xmlns:doap="http://usefulinc.com/ns/doap#"; xml:lang="en"> - http://jakarta.apache.org/commons/pool/";> -Apache Jakarta Commons Pool -http://jakarta.apache.org/commons/pool/"/> -Java -http://projects.apache.org/category/library"/> -http://usefulinc.com/doap/licenses/asl20"/> -http://issues.apache.org/bugzilla/buglist.cgi?product=Commons&component=pool"/> -http://jakarta.apache.org/site/downloads/downloads_commons-pool.cgi"/> -http://jakarta.apache.org/"/> -Commons Object Pooling Library -Commons Object Pooling Library - - -http://svn.apache.org/repos/asf/jakarta/commons/proper/pool/trunk"/> -http://svn.apache.org/repos/asf/jakarta/commons/proper/pool"/> - - - - -commons-pool -2004-06-07 -1.2 - - - - -commons-pool -2004-10-20 -1.1 - - - - -commons-pool -2002-08-12 -1.0.1 - - - - -commons-pool -2002-05-04 -1.0 - - -http://jakarta.apache.org/site/mail2.html#Commons"/> - -
[commons-pool] Git Push Summary
Repository: commons-pool Updated Tags: refs/tags/POOL_1_0 [created] af75ff68f refs/tags/POOL_1_0@139620 [created] 30f9edd77 refs/tags/POOL_1_0@560656 [created] 089a24a66 refs/tags/POOL_1_0@560657 [created] 92f12 refs/tags/POOL_1_0@560659 [created] a09fb7c8c refs/tags/POOL_1_0_1 [created] 8351007af refs/tags/POOL_1_0_1@139636 [created] 7b6fffd25 refs/tags/POOL_1_0_1@560656 [created] ce2709606 refs/tags/POOL_1_0_1@560657 [created] 08da461e4 refs/tags/POOL_1_0_1@560659 [created] 1cd219366 refs/tags/POOL_1_1 [created] 8f19d7015 refs/tags/POOL_1_1@139740 [created] d77cbfadc refs/tags/POOL_1_1@560656 [created] da2992911 refs/tags/POOL_1_1@560657 [created] 1891af53b refs/tags/POOL_1_1@560659 [created] 5f5dde104 refs/tags/POOL_1_1_RC1 [created] 005f76c99 refs/tags/POOL_1_1_RC1@139723 [created] 19cbefe5e refs/tags/POOL_1_1_RC1@560656 [created] 4f065ffba refs/tags/POOL_1_1_RC1@560657 [created] 9c0fc7fac refs/tags/POOL_1_1_RC1@560659 [created] ffd214018 refs/tags/POOL_1_1_RC2 [created] 258e8ac38 refs/tags/POOL_1_1_RC2@139738 [created] 34f8ba6ca refs/tags/POOL_1_1_RC2@560656 [created] 89d2665b8 refs/tags/POOL_1_1_RC2@560657 [created] 46655e9ae refs/tags/POOL_1_1_RC2@560659 [created] d2338f9c4 refs/tags/POOL_1_2 [created] e3035f842 refs/tags/POOL_1_2@139778 [created] 231ceeefd refs/tags/POOL_1_2@560656 [created] 8a5c17b47 refs/tags/POOL_1_2@560657 [created] 470c93cc1 refs/tags/POOL_1_2@560659 [created] 76754c949 refs/tags/POOL_1_2_RC1 [created] 6a33a3371 refs/tags/POOL_1_2_RC1@139775 [created] 72c4b4603 refs/tags/POOL_1_2_RC1@560656 [created] 9484420bb refs/tags/POOL_1_2_RC1@560657 [created] b756d181c refs/tags/POOL_1_2_RC1@560659 [created] 0ff7c80f4 refs/tags/POOL_1_3 [created] 222aab3a9 refs/tags/POOL_1_3@329376 [created] b70c8c948 refs/tags/POOL_1_3@390933 [created] 1c58fb424 refs/tags/POOL_1_3@560656 [created] 66c2e7e2a refs/tags/POOL_1_3@560657 [created] 2236ea38e refs/tags/POOL_1_3@560659 [created] 211e5e501 refs/tags/POOL_1_3_RC1 [created] 56d2d4b00 refs/tags/POOL_1_3_RC1@329376 [created] b70c8c948 refs/tags/POOL_1_3_RC1@387392 [created] 1000d91c3 refs/tags/POOL_1_3_RC1@560656 [created] 1fc490c42 refs/tags/POOL_1_3_RC1@560657 [created] a39b9fc4f refs/tags/POOL_1_3_RC1@560659 [created] d22a9f6ca refs/tags/POOL_1_3_RC3 [created] 99d2d4806 refs/tags/POOL_1_3_RC3@329376 [created] b70c8c948 refs/tags/POOL_1_3_RC3@388728 [created] e107e947a refs/tags/POOL_1_3_RC3@560656 [created] 9192121a6 refs/tags/POOL_1_3_RC3@560657 [created] 6be337565 refs/tags/POOL_1_3_RC3@560659 [created] 475927fb6 refs/tags/POOL_1_3_RC4 [created] fb7f6cf30 refs/tags/POOL_1_3_RC4@329376 [created] b70c8c948 refs/tags/POOL_1_3_RC4@388984 [created] e459d5fa5 refs/tags/POOL_1_3_RC4@560656 [created] ebca8f092 refs/tags/POOL_1_3_RC4@560657 [created] f032c3164 refs/tags/POOL_1_3_RC4@560659 [created] 8c17405f0 refs/tags/POOL_1_4 [created] 343dc92b4 refs/tags/POOL_1_4_RC1 [created] ae901d52c refs/tags/POOL_1_4_RC2 [created] b7aac082a refs/tags/POOL_1_4_RC3 [created] 50179ccf0 refs/tags/POOL_1_5 [created] 64989df7d refs/tags/POOL_1_5_1 [created] 6fefeb0a3 refs/tags/POOL_1_5_1_RC1 [created] bbe625445 refs/tags/POOL_1_5_2 [created] 93bfcc005 refs/tags/POOL_1_5_2_RC1 [created] 9cb8cfc10 refs/tags/POOL_1_5_2_RC2 [created] c8ef3861f refs/tags/POOL_1_5_3 [created] 4f0c069aa refs/tags/POOL_1_5_3_RC1 [created] adb2cc4e2 refs/tags/POOL_1_5_4 [created] be2f91441 refs/tags/POOL_1_5_4_RC1 [created] 4b10b3a89 refs/tags/POOL_1_5_5 [created] 4bd78f908 refs/tags/POOL_1_5_5_RC1 [created] c46ef07e1 refs/tags/POOL_1_5_5_RC2 [created] 236d3472d refs/tags/POOL_1_5_6 [created] 956104701 refs/tags/POOL_1_5_6_RC1 [created] 24cb4dcc6 refs/tags/POOL_1_5_6_RC2 [created] f73c2dd14 refs/tags/POOL_1_5_7 [created] 1c486e415 refs/tags/POOL_1_5_7_RC1 [created] 1dde94e25 refs/tags/POOL_1_5_7_RC2 [created] 2db51e187 refs/tags/POOL_1_5_7_RC3 [created] a9b847597 refs/tags/POOL_1_5_RC1 [created] db0f95399 refs/tags/POOL_1_5_RC2 [created] e0a1b6bc3 refs/tags/POOL_1_5_RC3 [created] 8ccc4d4b2 refs/tags/POOL_1_6 [created] 0e348d9c5 refs/tags/POOL_1_6_RC1 [created] 5013576a0 refs/tags/POOL_1_6_RC2 [created] d3aea95d7 refs/tags/POOL_1_6_RC3 [created] 189f62029 refs/tags/POOL_1_6_RC4 [created] f10060aca refs/tags/POOL_2_0 [created] b0e4868e4 refs/tags/POOL_2_0_RC1 [created] adeb72a5f refs/tags/POOL_2_0_RC2 [created] 4e59a828f refs/tags/POOL_2_0_RC3 [created] a1ddbfcea refs/tags/POOL_2_0_RC4 [created] 748538bd6 refs/tags/POOL_2_1 [created] a28d908dd refs/tags/POOL_2_1_RC1 [created] 25ab11e93 refs/tags/POOL_2_1_RC2 [created] 56dcc8e9b refs/tags/POOL_2_2 [created] f50e3a0e0 refs/tags/POOL_2_2_RC1 [created] ccf543b0e refs/tags/POOL_2_2_RC2 [created] adfb10e8e refs/tags/POOL_2_3 [created] 7ecfff80b refs/tags/POOL_2_3_RC1 [created] 002a42c03 refs/tags/POOL_2_3_RC2 [created] 18a7da481 refs/tags/
[35/50] [abbrv] commons-pool git commit: Standard Maven location for assemblies
Standard Maven location for assemblies git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1739829 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/a04dac67 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/a04dac67 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/a04dac67 Branch: refs/heads/master Commit: a04dac67589279279c5308b99aca121ec0d61850 Parents: 7d8069f Author: Sebastian Bazley Authored: Mon Apr 18 23:26:51 2016 + Committer: Sebastian Bazley Committed: Mon Apr 18 23:26:51 2016 + -- pom.xml | 6 +-- src/assembly/bin.xml | 44 + src/assembly/src-tar-gz.xml | 74 +++ src/assembly/src-zip.xml | 73 ++ src/main/assembly/bin.xml| 44 - src/main/assembly/src-tar-gz.xml | 74 --- src/main/assembly/src-zip.xml| 73 -- 7 files changed, 194 insertions(+), 194 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/a04dac67/pom.xml -- diff --git a/pom.xml b/pom.xml index 10d9803..7aca347 100644 --- a/pom.xml +++ b/pom.xml @@ -186,9 +186,9 @@ maven-assembly-plugin - src/main/assembly/bin.xml - src/main/assembly/src-tar-gz.xml - src/main/assembly/src-zip.xml + src/assembly/bin.xml + src/assembly/src-tar-gz.xml + src/assembly/src-zip.xml gnu http://git-wip-us.apache.org/repos/asf/commons-pool/blob/a04dac67/src/assembly/bin.xml -- diff --git a/src/assembly/bin.xml b/src/assembly/bin.xml new file mode 100644 index 000..5762291 --- /dev/null +++ b/src/assembly/bin.xml @@ -0,0 +1,44 @@ + + +bin + +tar.gz +zip + +false + + + +LICENSE.txt +NOTICE.txt +RELEASE-NOTES.txt + + + +target + + +*.jar + + + +target/site/apidocs +apidocs + + + http://git-wip-us.apache.org/repos/asf/commons-pool/blob/a04dac67/src/assembly/src-tar-gz.xml -- diff --git a/src/assembly/src-tar-gz.xml b/src/assembly/src-tar-gz.xml new file mode 100644 index 000..b2b9bfc --- /dev/null +++ b/src/assembly/src-tar-gz.xml @@ -0,0 +1,74 @@ + + +src + +tar.gz + +${project.artifactId}-${project.version}-src + + + +build.xml +checkstyle.xml +LICENSE.txt +license-header.txt +NOTICE.txt +pom.xml +README.txt +RELEASE-NOTES.txt +findbugs-exclude-filter.xml +build.properties.sample + +lf + + +doc +lf + + +src/site/resources + + +src/site/xdoc +lf + + +src/site + + site.xml + +lf + + +src/changes +lf + + +src/main +lf + + +src/test/java +lf + + +src/test/resources + + + + http://git-wip-us.apache.org/repos/asf/commons-pool/blob/a04dac67/src/assembly/src-zip.xml -- diff --git a/src/assembly/src-zip.xml b/src/assembly/src-zip.xml new file mode 100644 index 000..5fafe18 --- /dev/null +++ b/src/assembly/src-zip.xml @@ -0,0 +1,73 @@ + + +src + +zip + +${project.artifactId}-${project.version}-src + + + +build.xml +checkstyle.xml +LICENSE.txt +license-header.txt +NOTICE.txt +pom.xml +README.txt +RELEASE-NOTES.txt +findbugs-exclude-filter.xml +build.properties.sample + +crlf + + +doc +crlf + + +src/site/resources + + +src/site/xdoc +cr
[17/50] [abbrv] commons-pool git commit: Add final modifier to method parameters.
http://git-wip-us.apache.org/repos/asf/commons-pool/blob/844cbd26/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java b/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java index 26536b0..b837300 100644 --- a/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java @@ -44,8 +44,8 @@ public class ProxiedKeyedObjectPool implements KeyedObjectPool { * @param pool The object pool to wrap * @param proxySource The source of the proxy objects */ -public ProxiedKeyedObjectPool(KeyedObjectPool pool, -ProxySource proxySource) { +public ProxiedKeyedObjectPool(final KeyedObjectPool pool, +final ProxySource proxySource) { this.pool = pool; this.proxySource = proxySource; } @@ -53,7 +53,7 @@ public class ProxiedKeyedObjectPool implements KeyedObjectPool { @SuppressWarnings("unchecked") @Override -public V borrowObject(K key) throws Exception, NoSuchElementException, +public V borrowObject(final K key) throws Exception, NoSuchElementException, IllegalStateException { UsageTracking usageTracking = null; if (pool instanceof UsageTracking) { @@ -65,30 +65,30 @@ public class ProxiedKeyedObjectPool implements KeyedObjectPool { } @Override -public void returnObject(K key, V proxy) throws Exception { +public void returnObject(final K key, final V proxy) throws Exception { final V pooledObject = proxySource.resolveProxy(proxy); pool.returnObject(key, pooledObject); } @Override -public void invalidateObject(K key, V proxy) throws Exception { +public void invalidateObject(final K key, final V proxy) throws Exception { final V pooledObject = proxySource.resolveProxy(proxy); pool.invalidateObject(key, pooledObject); } @Override -public void addObject(K key) throws Exception, IllegalStateException, +public void addObject(final K key) throws Exception, IllegalStateException, UnsupportedOperationException { pool.addObject(key); } @Override -public int getNumIdle(K key) { +public int getNumIdle(final K key) { return pool.getNumIdle(key); } @Override -public int getNumActive(K key) { +public int getNumActive(final K key) { return pool.getNumActive(key); } @@ -108,7 +108,7 @@ public class ProxiedKeyedObjectPool implements KeyedObjectPool { } @Override -public void clear(K key) throws Exception, UnsupportedOperationException { +public void clear(final K key) throws Exception, UnsupportedOperationException { pool.clear(key); } http://git-wip-us.apache.org/repos/asf/commons-pool/blob/844cbd26/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java b/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java index 59c5402..5496342 100644 --- a/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java @@ -43,7 +43,7 @@ public class ProxiedObjectPool implements ObjectPool { * @param pool The object pool to wrap * @param proxySource The source of the proxy objects */ -public ProxiedObjectPool(ObjectPool pool, ProxySource proxySource) { +public ProxiedObjectPool(final ObjectPool pool, final ProxySource proxySource) { this.pool = pool; this.proxySource = proxySource; } @@ -66,14 +66,14 @@ public class ProxiedObjectPool implements ObjectPool { @Override -public void returnObject(T proxy) throws Exception { +public void returnObject(final T proxy) throws Exception { final T pooledObject = proxySource.resolveProxy(proxy); pool.returnObject(pooledObject); } @Override -public void invalidateObject(T proxy) throws Exception { +public void invalidateObject(final T proxy) throws Exception { final T pooledObject = proxySource.resolveProxy(proxy); pool.invalidateObject(pooledObject); } http://git-wip-us.apache.org/repos/asf/commons-pool/blob/844cbd26/src/test/java/org/apache/commons/pool2/MethodCall.java -- diff --git a/src/test/java/org/apache/commons/pool2/MethodCall.java b/src/test/java/org/apache/commons/pool2/MethodCall.java index bb8fe02..7b56c79 100644 --- a/src/test/java/org/apache/commons/pool2/MethodCall.java +++ b/src/test/java/org/apache/commons/pool2/MethodCal
[13/50] [abbrv] commons-pool git commit: Add final modifier to local variables.
http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java -- diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java index da7e14d..0ede9b0 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java @@ -61,7 +61,7 @@ public class TestGenericObjectPool extends TestBaseObjectPool { @Override protected ObjectPool makeEmptyPool(int mincap) { - GenericObjectPool mtPool = + final GenericObjectPool mtPool = new GenericObjectPool(new SimpleFactory()); mtPool.setMaxTotal(mincap); mtPool.setMaxIdle(mincap); @@ -87,21 +87,21 @@ public class TestGenericObjectPool extends TestBaseObjectPool { @After public void tearDown() throws Exception { -String poolName = pool.getJmxName().toString(); +final String poolName = pool.getJmxName().toString(); pool.clear(); pool.close(); pool = null; factory = null; -MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); -Set result = mbs.queryNames(new ObjectName( +final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); +final Set result = mbs.queryNames(new ObjectName( "org.apache.commoms.pool2:type=GenericObjectPool,*"), null); // There should be no registered pools at this point -int registeredPoolCount = result.size(); -StringBuilder msg = new StringBuilder("Current pool is: "); +final int registeredPoolCount = result.size(); +final StringBuilder msg = new StringBuilder("Current pool is: "); msg.append(poolName); msg.append(" Still open pools are: "); -for (ObjectName name : result) { +for (final ObjectName name : result) { // Clean these up ready for the next test msg.append(name.toString()); msg.append(" created via\n"); @@ -124,19 +124,19 @@ public class TestGenericObjectPool extends TestBaseObjectPool { public void testConstructors() throws Exception { // Make constructor arguments all different from defaults -int minIdle = 2; -long maxWait = 3; -int maxIdle = 4; -int maxTotal = 5; -long minEvictableIdleTimeMillis = 6; -int numTestsPerEvictionRun = 7; -boolean testOnBorrow = true; -boolean testOnReturn = true; -boolean testWhileIdle = true; -long timeBetweenEvictionRunsMillis = 8; -boolean blockWhenExhausted = false; -boolean lifo = false; -PooledObjectFactory dummyFactory = new DummyFactory(); +final int minIdle = 2; +final long maxWait = 3; +final int maxIdle = 4; +final int maxTotal = 5; +final long minEvictableIdleTimeMillis = 6; +final int numTestsPerEvictionRun = 7; +final boolean testOnBorrow = true; +final boolean testOnReturn = true; +final boolean testWhileIdle = true; +final long timeBetweenEvictionRunsMillis = 8; +final boolean blockWhenExhausted = false; +final boolean lifo = false; +final PooledObjectFactory dummyFactory = new DummyFactory(); GenericObjectPool dummyPool = new GenericObjectPool(dummyFactory); assertEquals(GenericObjectPoolConfig.DEFAULT_MAX_IDLE, dummyPool.getMaxIdle()); @@ -161,7 +161,7 @@ public class TestGenericObjectPool extends TestBaseObjectPool { Boolean.valueOf(dummyPool.getLifo())); dummyPool.close(); -GenericObjectPoolConfig config = +final GenericObjectPoolConfig config = new GenericObjectPoolConfig(); config.setLifo(lifo); config.setMaxIdle(maxIdle); @@ -201,12 +201,12 @@ public class TestGenericObjectPool extends TestBaseObjectPool { public void testWhenExhaustedFail() throws Exception { pool.setMaxTotal(1); pool.setBlockWhenExhausted(false); -String obj1 = pool.borrowObject(); +final String obj1 = pool.borrowObject(); assertNotNull(obj1); try { pool.borrowObject(); fail("Expected NoSuchElementException"); -} catch(NoSuchElementException e) { +} catch(final NoSuchElementException e) { // expected } pool.returnObject(obj1); @@ -219,12 +219,12 @@ public class TestGenericObjectPool extends TestBaseObjectPool { pool.setMaxTotal(1); pool.setBlockWhenExhausted(true); pool.setMaxWaitMillis(10L); -String obj1 = pool.borrowObject(); +final String obj1 = pool.borrowObject(); assertNot
[30/50] [abbrv] commons-pool git commit: Re-working of fix for POOL-303
Re-working of fix for POOL-303 git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1735269 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/a4c544a2 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/a4c544a2 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/a4c544a2 Branch: refs/heads/master Commit: a4c544a24242701673073d32d2ddbf037fac0099 Parents: 170a509 Author: Mark Thomas Authored: Wed Mar 16 17:20:41 2016 + Committer: Mark Thomas Committed: Wed Mar 16 17:20:41 2016 + -- .../pool2/impl/GenericKeyedObjectPool.java | 53 .../commons/pool2/impl/GenericObjectPool.java | 51 --- .../pool2/impl/TestGenericObjectPool.java | 6 ++- 3 files changed, 93 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/a4c544a2/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java index dcfe448..d477cfa 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java @@ -1017,26 +1017,58 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool } } -final long newCreateCount = objectDeque.getCreateCount().incrementAndGet(); +// Flag that indicates if create should: +// - TRUE: call the factory to create an object +// - FALSE: return null +// - null: loop and re-test the condition that determines whether to +// call the factory +Boolean create = null; +while (create == null) { +synchronized (objectDeque.makeObjectCountLock) { +final long newCreateCount = objectDeque.getCreateCount().incrementAndGet(); +// Check against the per key limit +if (newCreateCount > maxTotalPerKeySave) { +// The key is currently at capacity or in the process of +// making enough new objects to take it to capacity. +numTotal.decrementAndGet(); +objectDeque.getCreateCount().decrementAndGet(); +if (objectDeque.makeObjectCount == 0) { +// There are no makeObject() calls in progress for this +// key so the key is at capacity. Do not attempt to +// create a new object. Return and wait for an object to +// be returned. +create = Boolean.FALSE; +} else { +// There are makeObject() calls in progress that might +// bring the pool to capacity. Those calls might also +// fail so wait until they complete and then re-test if +// the pool is at capacity or not. +objectDeque.makeObjectCountLock.wait(); +} +} else { +// The pool is not at capacity. Create a new object. +objectDeque.makeObjectCount++; +create = Boolean.TRUE; +} +} +} -// Check against the per key limit -if (newCreateCount > maxTotalPerKeySave) { -numTotal.decrementAndGet(); -objectDeque.getCreateCount().decrementAndGet(); +if (!create.booleanValue()) { return null; } - PooledObject p = null; try { p = factory.makeObject(key); } catch (final Exception e) { numTotal.decrementAndGet(); objectDeque.getCreateCount().decrementAndGet(); -// POOL-303. There may be threads waiting on an object return that -// isn't going to happen. Unblock them. -objectDeque.idleObjects.interuptTakeWaiters(); throw e; +} finally { +synchronized (objectDeque.makeObjectCountLock) { +objectDeque.makeObjectCount--; +objectDeque.makeObjectCountLock.notifyAll(); +} } createdCount.incrementAndGet(); @@ -1431,6 +1463,9 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool */ private final AtomicInteger createCount = new AtomicInteger(0); +private long makeObjectCount = 0; +private final Object makeObjectCountLock = new
[16/50] [abbrv] commons-pool git commit: Add final modifier to local variables.
Add final modifier to local variables. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1729267 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/5fe7dc02 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/5fe7dc02 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/5fe7dc02 Branch: refs/heads/master Commit: 5fe7dc020d070e165823f84ba9b34731f143412f Parents: 4a7f18b Author: Gary D. Gregory Authored: Mon Feb 8 21:45:12 2016 + Committer: Gary D. Gregory Committed: Mon Feb 8 21:45:12 2016 + -- .../org/apache/commons/pool2/BaseObject.java| 2 +- .../org/apache/commons/pool2/PoolUtils.java | 66 +-- .../commons/pool2/impl/AbandonedConfig.java | 2 +- .../pool2/impl/BaseGenericObjectPool.java | 55 +-- .../commons/pool2/impl/DefaultPooledObject.java | 10 +- .../pool2/impl/DefaultPooledObjectInfo.java | 10 +- .../commons/pool2/impl/EvictionConfig.java | 2 +- .../commons/pool2/impl/EvictionTimer.java | 6 +- .../pool2/impl/GenericKeyedObjectPool.java | 178 .../impl/GenericKeyedObjectPoolConfig.java | 2 +- .../commons/pool2/impl/GenericObjectPool.java | 104 ++--- .../pool2/impl/GenericObjectPoolConfig.java | 2 +- .../pool2/impl/InterruptibleReentrantLock.java | 4 +- .../commons/pool2/impl/LinkedBlockingDeque.java | 47 +-- .../commons/pool2/impl/PoolImplUtils.java | 13 +- .../commons/pool2/impl/PooledSoftReference.java | 2 +- .../pool2/impl/SoftReferenceObjectPool.java | 24 +- .../commons/pool2/proxy/BaseProxyHandler.java | 6 +- .../commons/pool2/proxy/CglibProxySource.java | 10 +- .../commons/pool2/proxy/JdkProxySource.java | 6 +- .../pool2/proxy/ProxiedKeyedObjectPool.java | 10 +- .../commons/pool2/proxy/ProxiedObjectPool.java | 10 +- .../pool2/MethodCallPoolableObjectFactory.java | 2 +- .../TestBaseKeyedPoolableObjectFactory.java | 2 +- .../commons/pool2/TestBaseObjectPool.java | 44 +- .../pool2/TestBasePoolableObjectFactory.java| 2 +- .../commons/pool2/TestKeyedObjectPool.java | 100 ++--- .../apache/commons/pool2/TestObjectPool.java| 42 +- .../org/apache/commons/pool2/TestPoolUtils.java | 94 +++-- .../java/org/apache/commons/pool2/Waiter.java | 4 +- .../org/apache/commons/pool2/WaiterFactory.java | 8 +- .../pool2/impl/TestAbandonedObjectPool.java | 43 +- .../pool2/impl/TestBaseGenericObjectPool.java | 4 +- .../pool2/impl/TestDefaultPooledObject.java | 14 +- .../pool2/impl/TestDefaultPooledObjectInfo.java | 44 +- .../pool2/impl/TestGenericKeyedObjectPool.java | 412 +-- .../pool2/impl/TestGenericObjectPool.java | 378 - .../impl/TestGenericObjectPoolClassLoaders.java | 16 +- .../pool2/impl/TestLinkedBlockingDeque.java | 60 +-- .../commons/pool2/impl/TestPoolImplUtils.java | 4 +- .../pool2/impl/TestPooledSoftReference.java | 4 +- .../pool2/impl/TestSoftRefOutOfMemory.java | 14 +- .../pool2/performance/PerformanceTest.java | 36 +- .../performance/SleepingObjectFactory.java | 6 +- .../proxy/BaseTestProxiedKeyedObjectPool.java | 12 +- .../pool2/proxy/BaseTestProxiedObjectPool.java | 20 +- 46 files changed, 975 insertions(+), 961 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/BaseObject.java -- diff --git a/src/main/java/org/apache/commons/pool2/BaseObject.java b/src/main/java/org/apache/commons/pool2/BaseObject.java index 019b678..948dd3f 100644 --- a/src/main/java/org/apache/commons/pool2/BaseObject.java +++ b/src/main/java/org/apache/commons/pool2/BaseObject.java @@ -25,7 +25,7 @@ public abstract class BaseObject { @Override public String toString() { -StringBuilder builder = new StringBuilder(); +final StringBuilder builder = new StringBuilder(); builder.append(getClass().getSimpleName()); builder.append(" ["); toStringAppendFields(builder); http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/PoolUtils.java -- diff --git a/src/main/java/org/apache/commons/pool2/PoolUtils.java b/src/main/java/org/apache/commons/pool2/PoolUtils.java index 3b00a2f..a945702 100644 --- a/src/main/java/org/apache/commons/pool2/PoolUtils.java +++ b/src/main/java/org/apache/commons/pool2/PoolUtils.java @@ -605,7 +605,7 @@ public final class PoolUtils { } success = true; -} catch (Excep
[20/50] [abbrv] commons-pool git commit: [POOL-309] Fix misspellings from "destory" to "destroy".
[POOL-309] Fix misspellings from "destory" to "destroy". git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1733560 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/5ec116ad Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/5ec116ad Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/5ec116ad Branch: refs/heads/master Commit: 5ec116ad0b261b3143c24ff9a37c27bfc8182040 Parents: 14d8291 Author: Gary D. Gregory Authored: Fri Mar 4 06:38:45 2016 + Committer: Gary D. Gregory Committed: Fri Mar 4 06:38:45 2016 + -- src/changes/changes.xml | 3 +++ .../apache/commons/pool2/impl/GenericObjectPool.java| 12 ++-- .../org/apache/commons/pool2/TestKeyedObjectPool.java | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5ec116ad/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 2260289..2503b03 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -44,6 +44,9 @@ The type attribute can be add,update,fix,remove. + + Fix misspellings from "destory" to "destroy". + http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5ec116ad/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java index 2e7f047..6c8dc71 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java @@ -880,17 +880,17 @@ public class GenericObjectPool extends BaseGenericObjectPool /** * Destroys a wrapped pooled object. * - * @param toDestory The wrapped pooled object to destroy + * @param toDestroy The wrapped pooled object to destroy * * @throws Exception If the factory fails to destroy the pooled object * cleanly */ -private void destroy(final PooledObject toDestory) throws Exception { -toDestory.invalidate(); -idleObjects.remove(toDestory); -allObjects.remove(new IdentityWrapper(toDestory.getObject())); +private void destroy(final PooledObject toDestroy) throws Exception { +toDestroy.invalidate(); +idleObjects.remove(toDestroy); +allObjects.remove(new IdentityWrapper(toDestroy.getObject())); try { -factory.destroyObject(toDestory); +factory.destroyObject(toDestroy); } finally { destroyedCount.incrementAndGet(); createCount.decrementAndGet(); http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5ec116ad/src/test/java/org/apache/commons/pool2/TestKeyedObjectPool.java -- diff --git a/src/test/java/org/apache/commons/pool2/TestKeyedObjectPool.java b/src/test/java/org/apache/commons/pool2/TestKeyedObjectPool.java index 4c646cc..75653f2 100644 --- a/src/test/java/org/apache/commons/pool2/TestKeyedObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/TestKeyedObjectPool.java @@ -379,7 +379,7 @@ public abstract class TestKeyedObjectPool { PoolUtils.prefill(pool, KEY, 5); pool.clear(); - Test exception handling clear should swallow destory object failures + Test exception handling clear should swallow destroy object failures reset(pool, factory, expectedMethods); factory.setDestroyObjectFail(true); PoolUtils.prefill(pool, KEY, 5);
[24/50] [abbrv] commons-pool git commit: Fix POOL-306 Ensure BaseGenericObjectPool.IdentityWrapper#equals() follows the expected contract for equals().
Fix POOL-306 Ensure BaseGenericObjectPool.IdentityWrapper#equals() follows the expected contract for equals(). git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1735080 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/a898de84 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/a898de84 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/a898de84 Branch: refs/heads/master Commit: a898de843abe44f5f0910b271a89b60e884852a5 Parents: 2566fd6 Author: Mark Thomas Authored: Tue Mar 15 14:29:11 2016 + Committer: Mark Thomas Committed: Tue Mar 15 14:29:11 2016 + -- src/changes/changes.xml | 4 .../org/apache/commons/pool2/impl/BaseGenericObjectPool.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/a898de84/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index f5d27d4..f515689 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -47,6 +47,10 @@ The type attribute can be add,update,fix,remove. Fix misspellings from "destory" to "destroy". + + Ensure BaseGenericObjectPool.IdentityWrapper#equals() follows the expected + contract for equals(). + http://git-wip-us.apache.org/repos/asf/commons-pool/blob/a898de84/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java -- 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 6e197c9..8d5efbd 100644 --- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java @@ -1207,7 +1207,8 @@ public abstract class BaseGenericObjectPool extends BaseObject { @Override @SuppressWarnings("rawtypes") public boolean equals(final Object other) { -return ((IdentityWrapper) other).instance == instance; +return other instanceof IdentityWrapper && +((IdentityWrapper) other).instance == instance; } /**
[19/50] [abbrv] commons-pool git commit: Always use statement blocks.
Always use statement blocks. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1729271 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/14d82910 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/14d82910 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/14d82910 Branch: refs/heads/master Commit: 14d829107a8a4d5ea443042b96f69318ad5d55c5 Parents: 844cbd2 Author: Gary D. Gregory Authored: Mon Feb 8 21:49:46 2016 + Committer: Gary D. Gregory Committed: Mon Feb 8 21:49:46 2016 + -- .../org/apache/commons/pool2/impl/LinkedBlockingDeque.java | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/14d82910/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java b/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java index a0091cf..6cf9f4e 100644 --- a/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java +++ b/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java @@ -1250,14 +1250,15 @@ class LinkedBlockingDeque extends AbstractQueue // are possible if multiple interior nodes are removed. for (;;) { final Node s = nextNode(n); -if (s == null) +if (s == null) { return null; -else if (s.item != null) +} else if (s.item != null) { return s; -else if (s == n) +} else if (s == n) { return firstNode(); -else +} else { n = s; +} } }
[39/50] [abbrv] commons-pool git commit: Check class used for evictionPolicyClassName implements EvictionPolicy
Check class used for evictionPolicyClassName implements EvictionPolicy git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1767714 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/108f44a4 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/108f44a4 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/108f44a4 Branch: refs/heads/master Commit: 108f44a45f1e95dd6bbb6db3934fc0a2cc7019ab Parents: dcf4d6d Author: Mark Thomas Authored: Wed Nov 2 15:53:08 2016 + Committer: Mark Thomas Committed: Wed Nov 2 15:53:08 2016 + -- src/changes/changes.xml | 4 +++ .../pool2/impl/BaseGenericObjectPool.java | 3 ++ .../pool2/impl/TestGenericObjectPool.java | 38 3 files changed, 30 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/108f44a4/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 65ca2b8..5cca806 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -67,6 +67,10 @@ The type attribute can be add,update,fix,remove. maxTotal threads try to borrow objects with different keys at the same time and the factory destroys objects on return. + + Ensure that any class name used for evictionPolicyClassName represents a + class that implements EvictionPolicy. + http://git-wip-us.apache.org/repos/asf/commons-pool/blob/108f44a4/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java -- 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 8d5efbd..8afa8f1 100644 --- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java @@ -613,6 +613,9 @@ public abstract class BaseGenericObjectPool extends BaseObject { final EvictionPolicy evicPolicy = (EvictionPolicy) policy; this.evictionPolicy = evicPolicy; +} else { +throw new IllegalArgumentException("[" + evictionPolicyClassName + +"] does not implement EvictionPolicy"); } } catch (final ClassNotFoundException e) { throw new IllegalArgumentException( http://git-wip-us.apache.org/repos/asf/commons-pool/blob/108f44a4/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java -- diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java index 75b9438..c9014ac 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java @@ -1080,6 +1080,14 @@ public class TestGenericObjectPool extends TestBaseObjectPool { // expected } +try { +pool.setEvictionPolicyClassName(java.lang.String.class.getName()); +fail("setEvictionPolicyClassName must throw an error if a class that does not " ++ "implement EvictionPolicy is specified."); +} catch (final IllegalArgumentException e) { +// expected +} + pool.setEvictionPolicyClassName(TestEvictionPolicy.class.getName()); assertEquals(TestEvictionPolicy.class.getName(), pool.getEvictionPolicyClassName()); @@ -1704,49 +1712,49 @@ public class TestGenericObjectPool extends TestBaseObjectPool { public SimpleFactory() { this(true); } - + public SimpleFactory(final boolean valid) { this(valid,valid); } - + public SimpleFactory(final boolean evalid, final boolean ovalid) { evenValid = evalid; oddValid = ovalid; } - + public synchronized void setValid(final boolean valid) { setEvenValid(valid); setOddValid(valid); } - + public synchronized void setEvenValid(final boolean valid) { evenValid = valid; } - + public synchronized void setOddValid(final boolean valid) { oddValid = valid; } - + public synchronized void setThrowExceptionOnPassivate(final boolean bool) { exceptionOnPassivate = bool;
[32/50] [abbrv] commons-pool git commit: Correct location of decrement
Correct location of decrement git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1735292 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/f7a0d26b Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/f7a0d26b Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/f7a0d26b Branch: refs/heads/master Commit: f7a0d26b803e48ce272a5bcc96c7ff1319b00f71 Parents: 55c10ec Author: Mark Thomas Authored: Wed Mar 16 20:20:11 2016 + Committer: Mark Thomas Committed: Wed Mar 16 20:20:11 2016 + -- .../java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/f7a0d26b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java index d477cfa..200c424 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java @@ -1030,7 +1030,6 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool if (newCreateCount > maxTotalPerKeySave) { // The key is currently at capacity or in the process of // making enough new objects to take it to capacity. -numTotal.decrementAndGet(); objectDeque.getCreateCount().decrementAndGet(); if (objectDeque.makeObjectCount == 0) { // There are no makeObject() calls in progress for this @@ -1054,6 +1053,7 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool } if (!create.booleanValue()) { +numTotal.decrementAndGet(); return null; }
[42/50] [abbrv] commons-pool git commit: Fix transposed digits
Fix transposed digits git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1767783 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/ed91f491 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/ed91f491 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/ed91f491 Branch: refs/heads/master Commit: ed91f491249950ba19b9d81e9590ded25ca14ec0 Parents: 4a20cdc Author: Mark Thomas Authored: Wed Nov 2 20:54:06 2016 + Committer: Mark Thomas Committed: Wed Nov 2 20:54:06 2016 + -- src/changes/changes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/ed91f491/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index dca51b3..ae14e69 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -71,7 +71,7 @@ The type attribute can be add,update,fix,remove. Ensure that any class name used for evictionPolicyClassName represents a class that implements EvictionPolicy. - + Add a configurable delay (default 10 seconds) to wait when shutting down an Evictor to allow the associated thread time to complete and current evictions and to terminate.
[33/50] [abbrv] commons-pool git commit: Fix POOL-310 Ensure that threads using GKOP do not block indefinitely if more than maxTotal threads try to borrow objects with different keys at the same time
Fix POOL-310 Ensure that threads using GKOP do not block indefinitely if more than maxTotal threads try to borrow objects with different keys at the same time and the factory destroys objects on return. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1735563 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/9257fb9e Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/9257fb9e Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/9257fb9e Branch: refs/heads/master Commit: 9257fb9e40526f7ad33ac83f0b7f152607510ccd Parents: f7a0d26 Author: Mark Thomas Authored: Fri Mar 18 09:53:38 2016 + Committer: Mark Thomas Committed: Fri Mar 18 09:53:38 2016 + -- src/changes/changes.xml | 5 + .../pool2/impl/GenericKeyedObjectPool.java | 97 ++-- 2 files changed, 53 insertions(+), 49 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/9257fb9e/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 6b48a1f..65ca2b8 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -62,6 +62,11 @@ The type attribute can be add,update,fix,remove. Replace inefficient use of keySet with entrySet in GKOP. + + Ensure that threads using GKOP do not block indefinitely if more than + maxTotal threads try to borrow objects with different keys at the same + time and the factory destroys objects on return. + http://git-wip-us.apache.org/repos/asf/commons-pool/blob/9257fb9e/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java index 200c424..6976f2a 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java @@ -478,8 +478,29 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool final long activeTime = p.getActiveTimeMillis(); -if (getTestOnReturn()) { -if (!factory.validateObject(key, p)) { +try { +if (getTestOnReturn()) { +if (!factory.validateObject(key, p)) { +try { +destroy(key, p, true); +} catch (final Exception e) { +swallowException(e); +} +if (objectDeque.idleObjects.hasTakeWaiters()) { +try { +addObject(key); +} catch (final Exception e) { +swallowException(e); +} +} +return; +} +} + +try { +factory.passivateObject(key, p); +} catch (final Exception e1) { +swallowException(e1); try { destroy(key, p, true); } catch (final Exception e) { @@ -492,65 +513,43 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool swallowException(e); } } -updateStatsReturn(activeTime); return; } -} -try { -factory.passivateObject(key, p); -} catch (final Exception e1) { -swallowException(e1); -try { -destroy(key, p, true); -} catch (final Exception e) { -swallowException(e); +if (!p.deallocate()) { +throw new IllegalStateException( +"Object has already been returned to this pool"); } -if (objectDeque.idleObjects.hasTakeWaiters()) { + +final int maxIdle = getMaxIdlePerKey(); +final LinkedBlockingDeque> idleObjects = +objectDeque.getIdleObjects(); + +if (isClosed() || maxIdle > -1 && maxIdle <= idleObjects.size()) { try { -addObject(key); +destroy(key, p, true); } catch (final Exception e) { swallowException(e); } -} -updateStatsReturn(activeTime); -return; -} - -if (!p.deallocate()) { -throw new IllegalStateException( -
[34/50] [abbrv] commons-pool git commit: Static fields should be accessed directly.
Static fields should be accessed directly. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1739389 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/7d8069f3 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/7d8069f3 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/7d8069f3 Branch: refs/heads/master Commit: 7d8069f324a523e4d29021fc4c40ab3a51d497b6 Parents: 9257fb9 Author: Gary D. Gregory Authored: Sat Apr 16 00:04:10 2016 + Committer: Gary D. Gregory Committed: Sat Apr 16 00:04:10 2016 + -- .../commons/pool2/impl/TestGenericObjectPool.java | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/7d8069f3/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java -- diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java index 5890146..97e07cd 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java @@ -142,24 +142,24 @@ public class TestGenericObjectPool extends TestBaseObjectPool { GenericObjectPool dummyPool = new GenericObjectPool(dummyFactory); assertEquals(GenericObjectPoolConfig.DEFAULT_MAX_IDLE, dummyPool.getMaxIdle()); -assertEquals(GenericObjectPoolConfig.DEFAULT_MAX_WAIT_MILLIS, dummyPool.getMaxWaitMillis()); +assertEquals(BaseObjectPoolConfig.DEFAULT_MAX_WAIT_MILLIS, dummyPool.getMaxWaitMillis()); assertEquals(GenericObjectPoolConfig.DEFAULT_MIN_IDLE, dummyPool.getMinIdle()); assertEquals(GenericObjectPoolConfig.DEFAULT_MAX_TOTAL, dummyPool.getMaxTotal()); - assertEquals(GenericObjectPoolConfig.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, + assertEquals(BaseObjectPoolConfig.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, dummyPool.getMinEvictableIdleTimeMillis()); - assertEquals(GenericObjectPoolConfig.DEFAULT_NUM_TESTS_PER_EVICTION_RUN, +assertEquals(BaseObjectPoolConfig.DEFAULT_NUM_TESTS_PER_EVICTION_RUN, dummyPool.getNumTestsPerEvictionRun()); - assertEquals(Boolean.valueOf(GenericObjectPoolConfig.DEFAULT_TEST_ON_BORROW), + assertEquals(Boolean.valueOf(BaseObjectPoolConfig.DEFAULT_TEST_ON_BORROW), Boolean.valueOf(dummyPool.getTestOnBorrow())); - assertEquals(Boolean.valueOf(GenericObjectPoolConfig.DEFAULT_TEST_ON_RETURN), + assertEquals(Boolean.valueOf(BaseObjectPoolConfig.DEFAULT_TEST_ON_RETURN), Boolean.valueOf(dummyPool.getTestOnReturn())); - assertEquals(Boolean.valueOf(GenericObjectPoolConfig.DEFAULT_TEST_WHILE_IDLE), + assertEquals(Boolean.valueOf(BaseObjectPoolConfig.DEFAULT_TEST_WHILE_IDLE), Boolean.valueOf(dummyPool.getTestWhileIdle())); - assertEquals(GenericObjectPoolConfig.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, + assertEquals(BaseObjectPoolConfig.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, dummyPool.getTimeBetweenEvictionRunsMillis()); - assertEquals(Boolean.valueOf(GenericObjectPoolConfig.DEFAULT_BLOCK_WHEN_EXHAUSTED), + assertEquals(Boolean.valueOf(BaseObjectPoolConfig.DEFAULT_BLOCK_WHEN_EXHAUSTED), Boolean.valueOf(dummyPool.getBlockWhenExhausted())); -assertEquals(Boolean.valueOf(GenericObjectPoolConfig.DEFAULT_LIFO), +assertEquals(Boolean.valueOf(BaseObjectPoolConfig.DEFAULT_LIFO), Boolean.valueOf(dummyPool.getLifo())); dummyPool.close();
[49/50] [abbrv] commons-pool git commit: Fix issue reported on users list. Ensure that a call to GKOP preparePool() takes account of other threads that might create objects concurrently, particularly
Fix issue reported on users list. Ensure that a call to GKOP preparePool() takes account of other threads that might create objects concurrently, particularly the Evictor. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1782329 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/d00d176f Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/d00d176f Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/d00d176f Branch: refs/heads/master Commit: d00d176fc04d730f63b47dde9bc334b5c3a67f3c Parents: 6a088d1 Author: Mark Thomas Authored: Thu Feb 9 13:41:09 2017 + Committer: Mark Thomas Committed: Thu Feb 9 13:41:09 2017 + -- src/changes/changes.xml | 4 .../pool2/impl/GenericKeyedObjectPool.java | 22 +--- 2 files changed, 18 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/d00d176f/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index fb3a878..7409dc3 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -79,6 +79,10 @@ The type attribute can be add,update,fix,remove. an Evictor to allow the associated thread time to complete and current evictions and to terminate. + + Ensure that a call to GKOP preparePool() takes account of other threads + that might create objects concurrently, particularly the Evictor. + http://git-wip-us.apache.org/repos/asf/commons-pool/blob/d00d176f/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java index 7fa21b5..396aaf9 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java @@ -76,7 +76,7 @@ import org.apache.commons.pool2.SwallowedExceptionListener; * @since 2.0 */ public class GenericKeyedObjectPool extends BaseGenericObjectPool -implements KeyedObjectPool, GenericKeyedObjectPoolMXBean { +implements KeyedObjectPool, GenericKeyedObjectPoolMXBean { /** * Create a new GenericKeyedObjectPool using defaults from @@ -524,7 +524,7 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool final int maxIdle = getMaxIdlePerKey(); final LinkedBlockingDeque> idleObjects = -objectDeque.getIdleObjects(); +objectDeque.getIdleObjects(); if (isClosed() || maxIdle > -1 && maxIdle <= idleObjects.size()) { try { @@ -758,7 +758,7 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool // for zero int itemsToRemove = ((int) (map.size() * 0.15)) + 1; final Iterator, K>> iter = -map.entrySet().iterator(); +map.entrySet().iterator(); while (iter.hasNext() && itemsToRemove > 0) { final Map.Entry, K> entry = iter.next(); @@ -843,7 +843,7 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool final ObjectDeque deque = entry.getValue(); if (deque != null) { final LinkedBlockingDeque> pool = -deque.getIdleObjects(); +deque.getIdleObjects(); if(pool.hasTakeWaiters()) { return true; } @@ -1210,7 +1210,7 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool */ private void ensureMinIdle(final K key) throws Exception { // Calculate current pool objects -final ObjectDeque objectDeque = poolMap.get(key); +ObjectDeque objectDeque = poolMap.get(key); // objectDeque == null is OK here. It is handled correctly by both // methods called below. @@ -1224,6 +1224,12 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool for (int i = 0; i < deficit && calculateDeficit(objectDeque) > 0; i++) { addObject(key); +// If objectDeque was null, it won't be any more. Obtain a reference +// to it so the deficit can be correctly calculated. It needs to +// take account of objects created in other threads. +if (objectDeque == null) { +objectDeque = poolMap.get(key); +} } } @@ -1548,9 +1554,9 @@ public class GenericKeyedObjectPool extends
[38/50] [abbrv] commons-pool git commit: Format: add a blank line between methods.
Format: add a blank line between methods. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1765926 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/dcf4d6de Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/dcf4d6de Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/dcf4d6de Branch: refs/heads/master Commit: dcf4d6de4875f7e35da266bcb3ec6096c0bdc6b7 Parents: 8cc1fa0 Author: Gary D. Gregory Authored: Fri Oct 21 06:14:06 2016 + Committer: Gary D. Gregory Committed: Fri Oct 21 06:14:06 2016 + -- .../commons/pool2/impl/TestGenericObjectPool.java| 15 +++ 1 file changed, 15 insertions(+) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/dcf4d6de/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java -- diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java index 97e07cd..75b9438 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java @@ -1704,38 +1704,49 @@ public class TestGenericObjectPool extends TestBaseObjectPool { public SimpleFactory() { this(true); } + public SimpleFactory(final boolean valid) { this(valid,valid); } + public SimpleFactory(final boolean evalid, final boolean ovalid) { evenValid = evalid; oddValid = ovalid; } + public synchronized void setValid(final boolean valid) { setEvenValid(valid); setOddValid(valid); } + public synchronized void setEvenValid(final boolean valid) { evenValid = valid; } + public synchronized void setOddValid(final boolean valid) { oddValid = valid; } + public synchronized void setThrowExceptionOnPassivate(final boolean bool) { exceptionOnPassivate = bool; } + public synchronized void setMaxTotal(final int maxTotal) { this.maxTotal = maxTotal; } + public synchronized void setDestroyLatency(final long destroyLatency) { this.destroyLatency = destroyLatency; } + public synchronized void setMakeLatency(final long makeLatency) { this.makeLatency = makeLatency; } + public synchronized void setValidateLatency(final long validateLatency) { this.validateLatency = validateLatency; } + @Override public PooledObject makeObject() { final long waitLatency; @@ -1756,6 +1767,7 @@ public class TestGenericObjectPool extends TestBaseObjectPool { } return new DefaultPooledObject(String.valueOf(counter)); } + @Override public void destroyObject(final PooledObject obj) throws Exception { final long waitLatency; @@ -1774,6 +1786,7 @@ public class TestGenericObjectPool extends TestBaseObjectPool { throw new Exception(); } } + @Override public boolean validateObject(final PooledObject obj) { final boolean validate; @@ -1796,6 +1809,7 @@ public class TestGenericObjectPool extends TestBaseObjectPool { } return true; } + @Override public void activateObject(final PooledObject obj) throws Exception { final boolean hurl; @@ -1814,6 +1828,7 @@ public class TestGenericObjectPool extends TestBaseObjectPool { } } } + @Override public void passivateObject(final PooledObject obj) throws Exception { final boolean hurl;
[23/50] [abbrv] commons-pool git commit: Fix various IDE warnings
Fix various IDE warnings git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1735057 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/2566fd6c Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/2566fd6c Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/2566fd6c Branch: refs/heads/master Commit: 2566fd6c479f86f46a0f0a65c4587572100b5cfc Parents: cd3f495 Author: Mark Thomas Authored: Tue Mar 15 11:16:13 2016 + Committer: Mark Thomas Committed: Tue Mar 15 11:16:13 2016 + -- src/main/java/org/apache/commons/pool2/BaseObject.java | 9 +++-- src/main/java/org/apache/commons/pool2/BaseObjectPool.java | 1 + .../apache/commons/pool2/impl/BaseGenericObjectPool.java| 7 --- .../org/apache/commons/pool2/impl/BaseObjectPoolConfig.java | 1 + .../commons/pool2/impl/GenericKeyedObjectPoolConfig.java| 1 + .../apache/commons/pool2/impl/TestDefaultPooledObject.java | 4 +++- .../org/apache/commons/pool2/impl/TestPoolImplUtils.java| 2 ++ 7 files changed, 19 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/2566fd6c/src/main/java/org/apache/commons/pool2/BaseObject.java -- diff --git a/src/main/java/org/apache/commons/pool2/BaseObject.java b/src/main/java/org/apache/commons/pool2/BaseObject.java index 6a69abd..cc7f376 100644 --- a/src/main/java/org/apache/commons/pool2/BaseObject.java +++ b/src/main/java/org/apache/commons/pool2/BaseObject.java @@ -18,7 +18,7 @@ package org.apache.commons.pool2; /** * A base class for common functionality. - * + * * @since 2.4.3 */ public abstract class BaseObject { @@ -33,8 +33,13 @@ public abstract class BaseObject { return builder.toString(); } +/** + * Used by sub-classes to include the fields defined by the sub-class in the + * {@link #toString()} output. + * + * @param builder Field names and values are appended to this object + */ protected void toStringAppendFields(final StringBuilder builder) { // do nothing by default, needed for b/w compatibility. } - } http://git-wip-us.apache.org/repos/asf/commons-pool/blob/2566fd6c/src/main/java/org/apache/commons/pool2/BaseObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/BaseObjectPool.java b/src/main/java/org/apache/commons/pool2/BaseObjectPool.java index 2349622..7ef7187 100644 --- a/src/main/java/org/apache/commons/pool2/BaseObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/BaseObjectPool.java @@ -119,6 +119,7 @@ public abstract class BaseObjectPool extends BaseObject implements ObjectPool private volatile boolean closed = false; +@Override protected void toStringAppendFields(final StringBuilder builder) { builder.append("closed="); builder.append(closed); http://git-wip-us.apache.org/repos/asf/commons-pool/blob/2566fd6c/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java -- 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 6eafcd1..6e197c9 100644 --- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java @@ -1176,7 +1176,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { } } - + /** * Wrapper for objects under management by the pool. * @@ -1189,7 +1189,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { static class IdentityWrapper { /** Wrapped object */ private final T instance; - + /** * Create a wrapper for an instance. * @@ -1209,7 +1209,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { public boolean equals(final Object other) { return ((IdentityWrapper) other).instance == instance; } - + /** * @return the wrapped object */ @@ -1227,6 +1227,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { } } +@Override protected void toStringAppendFields(final StringBuilder builder) { builder.append("maxTotal="); builder.append(maxTotal); http://git-wip-us.apache.org/repos/asf/commons-pool/blob/2566fd6c/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java
[45/50] [abbrv] commons-pool git commit: Follow-up to r1769582 Use the correct units. Thanks to kfujino.
Follow-up to r1769582 Use the correct units. Thanks to kfujino. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1769740 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/505842e0 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/505842e0 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/505842e0 Branch: refs/heads/master Commit: 505842e08d42af70f0c957b78197b90a74c1c6af Parents: b48c9f5 Author: Mark Thomas Authored: Tue Nov 15 07:18:19 2016 + Committer: Mark Thomas Committed: Tue Nov 15 07:18:19 2016 + -- .../java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/505842e0/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java -- 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 816e0d6..e9aa04e 100644 --- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java @@ -720,7 +720,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { final void startEvictor(final long delay) { synchronized (evictionLock) { if (null != evictor) { -EvictionTimer.cancel(evictor, evictorShutdownTimeoutMillis, TimeUnit.SECONDS); +EvictionTimer.cancel(evictor, evictorShutdownTimeoutMillis, TimeUnit.MILLISECONDS); evictor = null; evictionIterator = null; }
[41/50] [abbrv] commons-pool git commit: Fix POOL-351 Add a configurable delay (default 10 seconds) to wait when shutting down an Evictor to allow the associated thread time to complete and current ev
Fix POOL-351 Add a configurable delay (default 10 seconds) to wait when shutting down an Evictor to allow the associated thread time to complete and current evictions and to terminate. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1767782 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/4a20cdca Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/4a20cdca Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/4a20cdca Branch: refs/heads/master Commit: 4a20cdca923bd342360f821d7020538e985d9ec2 Parents: b15bc63 Author: Mark Thomas Authored: Wed Nov 2 20:53:11 2016 + Committer: Mark Thomas Committed: Wed Nov 2 20:53:11 2016 + -- src/changes/changes.xml | 5 + .../pool2/impl/BaseGenericObjectPool.java | 30 +++- .../pool2/impl/BaseObjectPoolConfig.java| 48 ++- .../commons/pool2/impl/EvictionTimer.java | 144 +++ .../pool2/impl/GenericKeyedObjectPool.java | 1 + .../commons/pool2/impl/GenericObjectPool.java | 1 + .../pool2/impl/TestGenericObjectPool.java | 1 + 7 files changed, 132 insertions(+), 98 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/4a20cdca/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 5cca806..dca51b3 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -71,6 +71,11 @@ The type attribute can be add,update,fix,remove. Ensure that any class name used for evictionPolicyClassName represents a class that implements EvictionPolicy. + + Add a configurable delay (default 10 seconds) to wait when shutting down + an Evictor to allow the associated thread time to complete and current + evictions and to terminate. + http://git-wip-us.apache.org/repos/asf/commons-pool/blob/4a20cdca/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java -- 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 8afa8f1..1f46811 100644 --- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java @@ -25,6 +25,7 @@ import java.util.Arrays; import java.util.Deque; import java.util.Iterator; import java.util.TimerTask; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import javax.management.InstanceAlreadyExistsException; @@ -87,6 +88,8 @@ public abstract class BaseGenericObjectPool extends BaseObject { private volatile long softMinEvictableIdleTimeMillis = BaseObjectPoolConfig.DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS; private volatile EvictionPolicy evictionPolicy; +private long evictorShutdownTimeoutMillis = +BaseObjectPoolConfig.DEFAULT_EVICTOR_SHUTDOWN_TIMEOUT_MILLIS; // Internal (primarily state) attributes @@ -632,6 +635,31 @@ public abstract class BaseGenericObjectPool extends BaseObject { } } +/** + * Gets the timeout that will be used when waiting for the Evictor to + * shutdown if this pool is closed and it is the only pool still using the + * the value for the Evictor. + * + * @return The timeout in milliseconds that will be used while waiting for + * the Evictor to shut down. + */ +public long getEvictorShutdownTimeoutMillis() { +return evictorShutdownTimeoutMillis; +} + +/** + * Sets the timeout that will be used when waiting for the Evictor to + * shutdown if this pool is closed and it is the only pool still using the + * the value for the Evictor. + * + * @param evictorShutdownTimeoutMillis the timeout in milliseconds that + * will be used while waiting for the + * Evictor to shut down. + */ +public void setEvictorShutdownTimeoutMillis( +final long evictorShutdownTimeoutMillis) { +this.evictorShutdownTimeoutMillis = evictorShutdownTimeoutMillis; +} /** * Closes the pool, destroys the remaining idle objects and, if registered @@ -692,7 +720,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { final void startEvictor(final long delay) { synchronized (evictionLock) { if (null != evictor) { -EvictionTimer.cancel(evictor); +EvictionTimer
[40/50] [abbrv] commons-pool git commit: Keep static classes at the end of the file.
Keep static classes at the end of the file. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1767756 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/b15bc636 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/b15bc636 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/b15bc636 Branch: refs/heads/master Commit: b15bc636bfd12e7f8ea19ebb5fcfae57ab4f1f16 Parents: 108f44a Author: Mark Thomas Authored: Wed Nov 2 18:29:39 2016 + Committer: Mark Thomas Committed: Wed Nov 2 18:29:39 2016 + -- .../commons/pool2/impl/EvictionTimer.java | 22 +++- 1 file changed, 12 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/b15bc636/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java b/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java index 0d74406..191dc86 100644 --- a/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java +++ b/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java @@ -49,6 +49,18 @@ class EvictionTimer { // Hide the default constructor } + +/** + * @since 2.4.3 + */ +@Override +public String toString() { +final StringBuilder builder = new StringBuilder(); +builder.append("EvictionTimer []"); +return builder.toString(); +} + + /** * Add the specified eviction task to the timer. Tasks that are added with a * call to this method *must* call {@link #cancel(TimerTask)} to cancel the @@ -156,14 +168,4 @@ class EvictionTimer { return new Timer("commons-pool-EvictionTimer", true); } } - -/** - * @since 2.4.3 - */ -@Override -public String toString() { -final StringBuilder builder = new StringBuilder(); -builder.append("EvictionTimer []"); -return builder.toString(); -} }
[26/50] [abbrv] commons-pool git commit: Small refactoring of borrowObject() to reduce code duplication.
Small refactoring of borrowObject() to reduce code duplication. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1735162 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/564334a3 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/564334a3 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/564334a3 Branch: refs/heads/master Commit: 564334a3b2a0c9716c7ada87b9bd790fb44f747e Parents: fa819eb Author: Mark Thomas Authored: Tue Mar 15 20:27:16 2016 + Committer: Mark Thomas Committed: Tue Mar 15 20:27:16 2016 + -- src/changes/changes.xml | 3 ++ .../pool2/impl/GenericKeyedObjectPool.java | 30 +++- .../commons/pool2/impl/GenericObjectPool.java | 30 +++- 3 files changed, 23 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/564334a3/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index a1293f7..30573e4 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -56,6 +56,9 @@ The type attribute can be add,update,fix,remove. threads try to borrow an object at the same time and the factory fails to create any objects. + + Small refactoring of borrowObject() to reduce code duplication. + http://git-wip-us.apache.org/repos/asf/commons-pool/blob/564334a3/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java index 697ae05..8e1f88f 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java @@ -350,14 +350,14 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool try { while (p == null) { create = false; -if (blockWhenExhausted) { -p = objectDeque.getIdleObjects().pollFirst(); -if (p == null) { -p = create(key); -if (p != null) { -create = true; -} +p = objectDeque.getIdleObjects().pollFirst(); +if (p == null) { +p = create(key); +if (p != null) { +create = true; } +} +if (blockWhenExhausted) { if (p == null) { if (borrowMaxWaitMillis < 0) { p = objectDeque.getIdleObjects().takeFirst(); @@ -370,23 +370,13 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool throw new NoSuchElementException( "Timeout waiting for idle object"); } -if (!p.allocate()) { -p = null; -} } else { -p = objectDeque.getIdleObjects().pollFirst(); -if (p == null) { -p = create(key); -if (p != null) { -create = true; -} -} if (p == null) { throw new NoSuchElementException("Pool exhausted"); } -if (!p.allocate()) { -p = null; -} +} +if (!p.allocate()) { +p = null; } if (p != null) { http://git-wip-us.apache.org/repos/asf/commons-pool/blob/564334a3/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java index b5ef9bd..7a3ee80 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java @@ -428,14 +428,14 @@ public class GenericObjectPool extends BaseGenericObjectPool while (p == null) { create = false; -if (blockWhenExhausted) { -p = idleObjects.pollFirst(); -if (p == nul
[27/50] [abbrv] commons-pool git commit: Fix POOL-307 Replace inefficient use of keySet with entrySet in GKOP.
Fix POOL-307 Replace inefficient use of keySet with entrySet in GKOP. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1735165 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/db15a295 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/db15a295 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/db15a295 Branch: refs/heads/master Commit: db15a295e120fcd5d5ad74207d03edf09b24bb19 Parents: 564334a Author: Mark Thomas Authored: Tue Mar 15 20:37:58 2016 + Committer: Mark Thomas Committed: Tue Mar 15 20:37:58 2016 + -- src/changes/changes.xml | 5 ++- .../pool2/impl/GenericKeyedObjectPool.java | 42 +++- 2 files changed, 27 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/db15a295/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 30573e4..6b48a1f 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -56,9 +56,12 @@ The type attribute can be add,update,fix,remove. threads try to borrow an object at the same time and the factory fails to create any objects. - + Small refactoring of borrowObject() to reduce code duplication. + + Replace inefficient use of keySet with entrySet in GKOP. + http://git-wip-us.apache.org/repos/asf/commons-pool/blob/db15a295/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java index 8e1f88f..20281ee 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java @@ -738,13 +738,14 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool // build sorted map of idle objects final Map, K> map = new TreeMap, K>(); -for (final K k : poolMap.keySet()) { -final ObjectDeque queue = poolMap.get(k); +for (Map.Entry> entry : poolMap.entrySet()) { +final K k = entry.getKey(); +final ObjectDeque deque = entry.getValue(); // Protect against possible NPE if key has been removed in another // thread. Not worth locking the keys while this loop completes. -if (queue != null) { +if (deque != null) { final LinkedBlockingDeque> idleObjects = -queue.getIdleObjects(); +deque.getIdleObjects(); for (final PooledObject p : idleObjects) { // each item into the map using the PooledObject object as the // key. It then gets sorted based on the idle time @@ -800,8 +801,9 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool int maxQueueLength = 0; LinkedBlockingDeque> mostLoaded = null; K loadedKey = null; -for (final K k : poolMap.keySet()) { -final ObjectDeque deque = poolMap.get(k); +for (Map.Entry> entry : poolMap.entrySet()) { +final K k = entry.getKey(); +final ObjectDeque deque = entry.getValue(); if (deque != null) { final LinkedBlockingDeque> pool = deque.getIdleObjects(); final int queueLength = pool.getTakeQueueLength(); @@ -837,8 +839,8 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool * {@code false} */ private boolean hasBorrowWaiters() { -for (final K k : poolMap.keySet()) { -final ObjectDeque deque = poolMap.get(k); +for (Map.Entry> entry : poolMap.entrySet()) { +final ObjectDeque deque = entry.getValue(); if (deque != null) { final LinkedBlockingDeque> pool = deque.getIdleObjects(); @@ -1371,14 +1373,15 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool public Map getNumWaitersByKey() { final Map result = new HashMap(); -for (final K key : poolMap.keySet()) { -final ObjectDeque queue = poolMap.get(key); -if (queue != null) { +for (Map.Entry> entry : poolMap.entrySet()) { +final K k = entry.getKey(); +final ObjectDeque deque = entry.getValue(); +if (deque != null) { if (getBlockWhenExhausted()) { -
[50/50] [abbrv] commons-pool git commit: [POOL-320]: Use more efficient stack walking mechanisms for usage tracking
[POOL-320]: Use more efficient stack walking mechanisms for usage tracking git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1785520 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/3994baf0 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/3994baf0 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/3994baf0 Branch: refs/heads/master Commit: 3994baf0f3ce59b73bd36e869320275d757d1884 Parents: d00d176 Author: Matt Sicker Authored: Sat Mar 4 20:18:19 2017 + Committer: Matt Sicker Committed: Sat Mar 4 20:18:19 2017 + -- src/changes/changes.xml | 3 + .../apache/commons/pool2/impl/CallStack.java| 54 ++ .../commons/pool2/impl/CallStackUtils.java | 62 +++ .../commons/pool2/impl/DefaultPooledObject.java | 71 +++- .../pool2/impl/SecurityManagerCallStack.java| 107 +++ .../commons/pool2/impl/ThrowableCallStack.java | 76 + .../commons/pool2/impl/CallStackTest.java | 63 +++ .../pool2/impl/TestDefaultPooledObjectInfo.java | 17 ++- 8 files changed, 383 insertions(+), 70 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/3994baf0/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 7409dc3..c710cd5 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -83,6 +83,9 @@ The type attribute can be add,update,fix,remove. Ensure that a call to GKOP preparePool() takes account of other threads that might create objects concurrently, particularly the Evictor. + + Use more efficient stack walking mechanisms for usage tracking when possible. + http://git-wip-us.apache.org/repos/asf/commons-pool/blob/3994baf0/src/main/java/org/apache/commons/pool2/impl/CallStack.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/CallStack.java b/src/main/java/org/apache/commons/pool2/impl/CallStack.java new file mode 100644 index 000..9986553 --- /dev/null +++ b/src/main/java/org/apache/commons/pool2/impl/CallStack.java @@ -0,0 +1,54 @@ +/* + * 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.pool2.impl; + +import org.apache.commons.pool2.PooledObject; +import org.apache.commons.pool2.UsageTracking; + +import java.io.PrintWriter; + +/** + * Strategy for obtaining and printing the current call stack. This is primarily useful for + * {@linkplain UsageTracking usage tracking} so that different JVMs and configurations can use more efficient strategies + * for obtaining the current call stack. + * + * @see CallStackUtils + * @since 2.4.3 + */ +public interface CallStack { + +/** + * Prints the current stack trace if available to a PrintWriter. The format is undefined and is primarily useful + * for debugging issues with {@link PooledObject} usage in user code. + * + * @param writer a PrintWriter to write the curren stack trace to if available + * @return true if a stack trace was available to print or false if nothing was printed + */ +boolean printStackTrace(final PrintWriter writer); + +/** + * Takes a snapshot of the current call stack. Subsequent calls to {@link #printStackTrace(PrintWriter)} will print + * out that stack trace until it is {@linkplain #clear() cleared}. + */ +void fillInStackTrace(); + +/** + * Clears the current stack trace snapshot. Subsequent calls to {@link #printStackTrace(PrintWriter)} will be + * no-ops until another call to {@link #fillInStackTrace()}. + */ +void clear(); +} http://git-wip-us.apache.org/repos/asf/commons-pool/blob/3994baf0/src/main/java/org/apache/commons/pool2/impl/CallStackUtils.java -
[36/50] [abbrv] commons-pool git commit: commons-parent 39 -> 40.
commons-parent 39 -> 40. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1743106 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/bdab334c Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/bdab334c Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/bdab334c Branch: refs/heads/master Commit: bdab334cada9918eccc0a1ce4771338ae51a9f69 Parents: a04dac6 Author: Gary D. Gregory Authored: Tue May 10 07:07:54 2016 + Committer: Gary D. Gregory Committed: Tue May 10 07:07:54 2016 + -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/bdab334c/pom.xml -- diff --git a/pom.xml b/pom.xml index 7aca347..a7e0b45 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ org.apache.commons commons-parent -39 +40 4.0.0 commons-pool2
[22/50] [abbrv] commons-pool git commit: [POOL-309] Fix misspellings from "destory" to "destroy". interupt -> interrupt
[POOL-309] Fix misspellings from "destory" to "destroy". interupt -> interrupt git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1733562 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/cd3f495f Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/cd3f495f Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/cd3f495f Branch: refs/heads/master Commit: cd3f495f13f535c2e5b413d8988e34d53f617dff Parents: 29cc202 Author: Gary D. Gregory Authored: Fri Mar 4 06:42:32 2016 + Committer: Gary D. Gregory Committed: Fri Mar 4 06:42:32 2016 + -- src/changes/changes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/cd3f495f/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 2503b03..f5d27d4 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -44,7 +44,7 @@ The type attribute can be add,update,fix,remove. - + Fix misspellings from "destory" to "destroy".
[48/50] [abbrv] commons-pool git commit: Update commons-parent from 40 to 42.
Update commons-parent from 40 to 42. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1778232 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/6a088d1b Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/6a088d1b Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/6a088d1b Branch: refs/heads/master Commit: 6a088d1b8a4aa343362cdf4e749b7c5fca38971b Parents: 2561938 Author: Gary D. Gregory Authored: Wed Jan 11 04:04:54 2017 + Committer: Gary D. Gregory Committed: Wed Jan 11 04:04:54 2017 + -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/6a088d1b/pom.xml -- diff --git a/pom.xml b/pom.xml index a7e0b45..e54fd08 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ org.apache.commons commons-parent -40 +42 4.0.0 commons-pool2
[28/50] [abbrv] commons-pool git commit: Simplify code a little
Simplify code a little git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1735259 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/9c75d18b Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/9c75d18b Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/9c75d18b Branch: refs/heads/master Commit: 9c75d18b8ca0c34d9a193e93b6ec435bb788c326 Parents: db15a29 Author: Mark Thomas Authored: Wed Mar 16 16:35:26 2016 + Committer: Mark Thomas Committed: Wed Mar 16 16:35:26 2016 + -- .../apache/commons/pool2/impl/GenericKeyedObjectPool.java| 8 +--- .../org/apache/commons/pool2/impl/GenericObjectPool.java | 8 +--- 2 files changed, 10 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/9c75d18b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java index 20281ee..82987da 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java @@ -993,7 +993,10 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool * @throws Exception If the objection creation fails */ private PooledObject create(final K key) throws Exception { -final int maxTotalPerKeySave = getMaxTotalPerKey(); // Per key +int maxTotalPerKeySave = getMaxTotalPerKey(); // Per key +if (maxTotalPerKeySave < 0) { +maxTotalPerKeySave = Integer.MAX_VALUE; +} final int maxTotal = getMaxTotal(); // All keys final ObjectDeque objectDeque = poolMap.get(key); @@ -1020,8 +1023,7 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool final long newCreateCount = objectDeque.getCreateCount().incrementAndGet(); // Check against the per key limit -if (maxTotalPerKeySave > -1 && newCreateCount > maxTotalPerKeySave || -newCreateCount > Integer.MAX_VALUE) { +if (newCreateCount > maxTotalPerKeySave) { numTotal.decrementAndGet(); objectDeque.getCreateCount().decrementAndGet(); // POOL-303. There may be threads waiting on an object return that http://git-wip-us.apache.org/repos/asf/commons-pool/blob/9c75d18b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java index 7a3ee80..2aadb43 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java @@ -841,10 +841,12 @@ public class GenericObjectPool extends BaseGenericObjectPool * @throws Exception if the object factory's {@code makeObject} fails */ private PooledObject create() throws Exception { -final int localMaxTotal = getMaxTotal(); +int localMaxTotal = getMaxTotal(); +if (localMaxTotal < 0) { +localMaxTotal = Integer.MAX_VALUE; +} final long newCreateCount = createCount.incrementAndGet(); -if (localMaxTotal > -1 && newCreateCount > localMaxTotal || -newCreateCount > Integer.MAX_VALUE) { +if (newCreateCount > localMaxTotal) { createCount.decrementAndGet(); // POOL-303. There may be threads waiting on an object return that // isn't going to happen. Unblock them.
[47/50] [abbrv] commons-pool git commit: [POOL-317] Correction of default value of softMinEvictableIdleTimeMillis in BaseObjectPoolConfig.
[POOL-317] Correction of default value of softMinEvictableIdleTimeMillis in BaseObjectPoolConfig. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1771859 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/25619386 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/25619386 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/25619386 Branch: refs/heads/master Commit: 2561938620ae49ad7911d7fbaf0df3f151bdaca6 Parents: fe49453 Author: Gary D. Gregory Authored: Tue Nov 29 08:47:07 2016 + Committer: Gary D. Gregory Committed: Tue Nov 29 08:47:07 2016 + -- src/changes/changes.xml | 3 +++ .../java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/25619386/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 545e1b7..fb3a878 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -44,6 +44,9 @@ The type attribute can be add,update,fix,remove. + + Correction of default value of softMinEvictableIdleTimeMillis in BaseObjectPoolConfig. + Fix misspellings from "destory" to "destroy". http://git-wip-us.apache.org/repos/asf/commons-pool/blob/25619386/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java -- 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 d635227..dc82784 100644 --- a/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java +++ b/src/main/java/org/apache/commons/pool2/impl/BaseObjectPoolConfig.java @@ -178,7 +178,7 @@ public abstract class BaseObjectPoolConfig extends BaseObject implements Cloneab DEFAULT_EVICTOR_SHUTDOWN_TIMEOUT_MILLIS; private long softMinEvictableIdleTimeMillis = -DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS; +DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS; private int numTestsPerEvictionRun = DEFAULT_NUM_TESTS_PER_EVICTION_RUN;
[18/50] [abbrv] commons-pool git commit: Add final modifier to method parameters.
Add final modifier to method parameters. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1729268 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/844cbd26 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/844cbd26 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/844cbd26 Branch: refs/heads/master Commit: 844cbd2620b44f6264d39aa46e456add495d71d7 Parents: 5fe7dc0 Author: Gary D. Gregory Authored: Mon Feb 8 21:47:12 2016 + Committer: Gary D. Gregory Committed: Mon Feb 8 21:47:12 2016 + -- .../pool2/BaseKeyedPooledObjectFactory.java | 10 +- .../org/apache/commons/pool2/BaseObject.java| 2 +- .../apache/commons/pool2/BaseObjectPool.java| 2 +- .../commons/pool2/BasePooledObjectFactory.java | 8 +- .../org/apache/commons/pool2/PoolUtils.java | 2 +- .../commons/pool2/impl/AbandonedConfig.java | 12 +- .../pool2/impl/BaseGenericObjectPool.java | 56 - .../pool2/impl/BaseObjectPoolConfig.java| 34 +++--- .../pool2/impl/DefaultEvictionPolicy.java | 4 +- .../commons/pool2/impl/DefaultPooledObject.java | 10 +- .../pool2/impl/DefaultPooledObjectInfo.java | 2 +- .../commons/pool2/impl/EvictionConfig.java | 4 +- .../commons/pool2/impl/EvictionTimer.java | 6 +- .../pool2/impl/GenericKeyedObjectPool.java | 50 .../impl/GenericKeyedObjectPoolConfig.java | 10 +- .../commons/pool2/impl/GenericObjectPool.java | 36 +++--- .../pool2/impl/GenericObjectPoolConfig.java | 8 +- .../pool2/impl/InterruptibleReentrantLock.java | 4 +- .../commons/pool2/impl/LinkedBlockingDeque.java | 68 +-- .../commons/pool2/impl/PoolImplUtils.java | 8 +- .../commons/pool2/impl/PooledSoftReference.java | 4 +- .../pool2/impl/SoftReferenceObjectPool.java | 14 +-- .../commons/pool2/proxy/BaseProxyHandler.java | 4 +- .../commons/pool2/proxy/CglibProxyHandler.java | 6 +- .../commons/pool2/proxy/CglibProxySource.java | 6 +- .../commons/pool2/proxy/JdkProxyHandler.java| 4 +- .../commons/pool2/proxy/JdkProxySource.java | 6 +- .../pool2/proxy/ProxiedKeyedObjectPool.java | 18 +-- .../commons/pool2/proxy/ProxiedObjectPool.java | 6 +- .../org/apache/commons/pool2/MethodCall.java| 2 +- .../TestBaseKeyedPoolableObjectFactory.java | 4 +- .../commons/pool2/TestBaseObjectPool.java | 6 +- .../pool2/TestBasePoolableObjectFactory.java| 2 +- .../commons/pool2/TestKeyedObjectPool.java | 12 +- .../apache/commons/pool2/TestObjectPool.java| 2 +- .../org/apache/commons/pool2/TestPoolUtils.java | 12 +- .../org/apache/commons/pool2/VisitTracker.java | 6 +- .../commons/pool2/VisitTrackerFactory.java | 18 +-- .../java/org/apache/commons/pool2/Waiter.java | 10 +- .../org/apache/commons/pool2/WaiterFactory.java | 40 +++ .../pool2/impl/TestAbandonedObjectPool.java | 20 ++-- .../pool2/impl/TestGenericKeyedObjectPool.java | 88 +++--- .../pool2/impl/TestGenericObjectPool.java | 116 +-- .../impl/TestGenericObjectPoolClassLoaders.java | 8 +- .../commons/pool2/impl/TestPoolImplUtils.java | 4 +- .../pool2/impl/TestSoftRefOutOfMemory.java | 14 +-- .../pool2/impl/TestSoftReferenceObjectPool.java | 6 +- .../pool2/performance/PerformanceTest.java | 6 +- .../performance/SleepingObjectFactory.java | 14 +-- .../proxy/BaseTestProxiedKeyedObjectPool.java | 6 +- .../pool2/proxy/BaseTestProxiedObjectPool.java | 4 +- 51 files changed, 402 insertions(+), 402 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/844cbd26/src/main/java/org/apache/commons/pool2/BaseKeyedPooledObjectFactory.java -- diff --git a/src/main/java/org/apache/commons/pool2/BaseKeyedPooledObjectFactory.java b/src/main/java/org/apache/commons/pool2/BaseKeyedPooledObjectFactory.java index 850a219..2f9edf9 100644 --- a/src/main/java/org/apache/commons/pool2/BaseKeyedPooledObjectFactory.java +++ b/src/main/java/org/apache/commons/pool2/BaseKeyedPooledObjectFactory.java @@ -58,7 +58,7 @@ public abstract class BaseKeyedPooledObjectFactory extends BaseObject public abstract PooledObject wrap(V value); @Override -public PooledObject makeObject(K key) throws Exception { +public PooledObject makeObject(final K key) throws Exception { return wrap(create(key)); } @@ -71,7 +71,7 @@ public abstract class BaseKeyedPooledObjectFactory extends BaseObject * @param p a {@code PooledObject} wrapping the the instance to be destroyed */ @Override -publi
[15/50] [abbrv] commons-pool git commit: Add final modifier to local variables.
http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/impl/PoolImplUtils.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/PoolImplUtils.java b/src/main/java/org/apache/commons/pool2/impl/PoolImplUtils.java index dc14e07..06a3984 100644 --- a/src/main/java/org/apache/commons/pool2/impl/PoolImplUtils.java +++ b/src/main/java/org/apache/commons/pool2/impl/PoolImplUtils.java @@ -58,11 +58,11 @@ class PoolImplUtils { // Look to see if this class implements the generic interface // Get all the interfaces -Type[] interfaces = clazz.getGenericInterfaces(); -for (Type iface : interfaces) { +final Type[] interfaces = clazz.getGenericInterfaces(); +for (final Type iface : interfaces) { // Only need to check interfaces that use generics if (iface instanceof ParameterizedType) { -ParameterizedType pi = (ParameterizedType) iface; +final ParameterizedType pi = (ParameterizedType) iface; // Look for the generic interface if (pi.getRawType() instanceof Class) { if (type.isAssignableFrom((Class) pi.getRawType())) { @@ -75,10 +75,11 @@ class PoolImplUtils { // Interface not found on this class. Look at the superclass. @SuppressWarnings("unchecked") +final Class superClazz = (Class) clazz.getSuperclass(); -Object result = getGenericType(type, superClazz); +final Object result = getGenericType(type, superClazz); if (result instanceof Class) { // Superclass implements interface and defines explicit type for // generic @@ -87,7 +88,7 @@ class PoolImplUtils { // Superclass implements interface and defines unknown type for // generic // Map that unknown type to the generic types defined in this class -ParameterizedType superClassType = +final ParameterizedType superClassType = (ParameterizedType) clazz.getGenericSuperclass(); return getTypeParameter(clazz, superClassType.getActualTypeArguments()[ @@ -114,7 +115,7 @@ class PoolImplUtils { if (argType instanceof Class) { return argType; } -TypeVariable[] tvs = clazz.getTypeParameters(); +final TypeVariable[] tvs = clazz.getTypeParameters(); for (int i = 0; i < tvs.length; i++) { if (tvs[i].equals(argType)) { return Integer.valueOf(i); http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/impl/PooledSoftReference.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/PooledSoftReference.java b/src/main/java/org/apache/commons/pool2/impl/PooledSoftReference.java index 104bc56..15d385f 100644 --- a/src/main/java/org/apache/commons/pool2/impl/PooledSoftReference.java +++ b/src/main/java/org/apache/commons/pool2/impl/PooledSoftReference.java @@ -63,7 +63,7 @@ public class PooledSoftReference extends DefaultPooledObject { */ @Override public String toString() { -StringBuilder result = new StringBuilder(); +final StringBuilder result = new StringBuilder(); result.append("Referenced Object: "); result.append(getObject().toString()); result.append(", State: "); http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java index 3c1c54a..fd4f38a 100644 --- a/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java @@ -146,11 +146,11 @@ public class SoftReferenceObjectPool extends BaseObjectPool { if (!factory.validateObject(ref)) { throw new Exception("ValidateObject failed"); } -} catch (Throwable t) { +} catch (final Throwable t) { PoolUtils.checkRethrow(t); try { destroy(ref); -} catch (Throwable t2) { +} catch (final Throwable t2) { PoolUtils.checkRethrow(t2); // Swallowed } finally { @@ -202,13 +202,13 @@ public class SoftReferenceObjectPool extends BaseObjectPool { } else { try {
[43/50] [abbrv] commons-pool git commit: Simplify
Simplify git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1767832 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/741d1f5c Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/741d1f5c Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/741d1f5c Branch: refs/heads/master Commit: 741d1f5c6d3cbfbf232d604d7c8fb9809b5449e7 Parents: ed91f49 Author: Mark Thomas Authored: Thu Nov 3 08:09:38 2016 + Committer: Mark Thomas Committed: Thu Nov 3 08:09:38 2016 + -- src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/741d1f5c/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java b/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java index b448141..4b20a45 100644 --- a/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java +++ b/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java @@ -110,8 +110,7 @@ class EvictionTimer { @Override public Thread newThread(final Runnable r) { -final Thread t = new Thread(null, r, "commons-pool-evictor-thrreads"); -t.setName("commons-pool-evictor"); +final Thread t = new Thread(null, r, "commons-pool-evictor-thread"); AccessController.doPrivileged(new PrivilegedAction() { @Override
[29/50] [abbrv] commons-pool git commit: Partial fix for regression in fix for POOL-303. Remove interrupt calls where they can't help.
Partial fix for regression in fix for POOL-303. Remove interrupt calls where they can't help. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1735260 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/170a5097 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/170a5097 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/170a5097 Branch: refs/heads/master Commit: 170a5097d7840299a1564b82f4a47c613d94663b Parents: 9c75d18 Author: Mark Thomas Authored: Wed Mar 16 16:37:02 2016 + Committer: Mark Thomas Committed: Wed Mar 16 16:37:02 2016 + -- .../org/apache/commons/pool2/impl/GenericKeyedObjectPool.java | 6 -- .../java/org/apache/commons/pool2/impl/GenericObjectPool.java | 3 --- 2 files changed, 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/170a5097/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java index 82987da..dcfe448 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java @@ -1009,9 +1009,6 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool if (maxTotal > -1 && newNumTotal > maxTotal) { numTotal.decrementAndGet(); if (getNumIdle() == 0) { -// POOL-303. There may be threads waiting on an object -// return that isn't going to happen. Unblock them. -objectDeque.idleObjects.interuptTakeWaiters(); return null; } clearOldest(); @@ -1026,9 +1023,6 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool if (newCreateCount > maxTotalPerKeySave) { numTotal.decrementAndGet(); objectDeque.getCreateCount().decrementAndGet(); -// POOL-303. There may be threads waiting on an object return that -// isn't going to happen. Unblock them. -objectDeque.idleObjects.interuptTakeWaiters(); return null; } http://git-wip-us.apache.org/repos/asf/commons-pool/blob/170a5097/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java index 2aadb43..0e0c9bd 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java @@ -848,9 +848,6 @@ public class GenericObjectPool extends BaseGenericObjectPool final long newCreateCount = createCount.incrementAndGet(); if (newCreateCount > localMaxTotal) { createCount.decrementAndGet(); -// POOL-303. There may be threads waiting on an object return that -// isn't going to happen. Unblock them. -idleObjects.interuptTakeWaiters(); return null; }
[44/50] [abbrv] commons-pool git commit: Additional fix for POOL-315. Thanks to Keiichi Fujino Also review previous fix.
Additional fix for POOL-315. Thanks to Keiichi Fujino Also review previous fix. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1769582 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/b48c9f52 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/b48c9f52 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/b48c9f52 Branch: refs/heads/master Commit: b48c9f52be991f280bff592dd49c1fd0de2b080a Parents: 741d1f5 Author: Mark Thomas Authored: Mon Nov 14 09:44:18 2016 + Committer: Mark Thomas Committed: Mon Nov 14 09:44:18 2016 + -- src/changes/changes.xml | 2 +- .../org/apache/commons/pool2/impl/BaseGenericObjectPool.java | 8 2 files changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/b48c9f52/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index ae14e69..545e1b7 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -71,7 +71,7 @@ The type attribute can be add,update,fix,remove. Ensure that any class name used for evictionPolicyClassName represents a class that implements EvictionPolicy. - + Add a configurable delay (default 10 seconds) to wait when shutting down an Evictor to allow the associated thread time to complete and current evictions and to terminate. http://git-wip-us.apache.org/repos/asf/commons-pool/blob/b48c9f52/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java -- 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 1f46811..816e0d6 100644 --- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java @@ -88,7 +88,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { private volatile long softMinEvictableIdleTimeMillis = BaseObjectPoolConfig.DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS; private volatile EvictionPolicy evictionPolicy; -private long evictorShutdownTimeoutMillis = +private volatile long evictorShutdownTimeoutMillis = BaseObjectPoolConfig.DEFAULT_EVICTOR_SHUTDOWN_TIMEOUT_MILLIS; @@ -643,7 +643,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { * @return The timeout in milliseconds that will be used while waiting for * the Evictor to shut down. */ -public long getEvictorShutdownTimeoutMillis() { +public final long getEvictorShutdownTimeoutMillis() { return evictorShutdownTimeoutMillis; } @@ -656,7 +656,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { * will be used while waiting for the * Evictor to shut down. */ -public void setEvictorShutdownTimeoutMillis( +public final void setEvictorShutdownTimeoutMillis( final long evictorShutdownTimeoutMillis) { this.evictorShutdownTimeoutMillis = evictorShutdownTimeoutMillis; } @@ -720,7 +720,7 @@ public abstract class BaseGenericObjectPool extends BaseObject { final void startEvictor(final long delay) { synchronized (evictionLock) { if (null != evictor) { -EvictionTimer.cancel(evictor, 10, TimeUnit.SECONDS); +EvictionTimer.cancel(evictor, evictorShutdownTimeoutMillis, TimeUnit.SECONDS); evictor = null; evictionIterator = null; }
[46/50] [abbrv] commons-pool git commit: Add starter TravisCI configuration. Will pick up Travis profile from new parent module when released.
Add starter TravisCI configuration. Will pick up Travis profile from new parent module when released. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1770094 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/fe494538 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/fe494538 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/fe494538 Branch: refs/heads/master Commit: fe4945387e2fbc9ba2a9ac4eb7c1fa1d50f40310 Parents: 505842e Author: Gary D. Gregory Authored: Thu Nov 17 00:02:16 2016 + Committer: Gary D. Gregory Committed: Thu Nov 17 00:02:16 2016 + -- .travis.yml | 24 ++ .../java/org/apache/commons/pool2/PoolTest.java | 80 2 files changed, 104 insertions(+) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/fe494538/.travis.yml -- diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000..fc2a03a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +# 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. + +language: java +sudo: false + +jdk: + - openjdk7 + - oraclejdk8 + +after_success: + - mvn clean cobertura:cobertura coveralls:report http://git-wip-us.apache.org/repos/asf/commons-pool/blob/fe494538/src/test/java/org/apache/commons/pool2/PoolTest.java -- diff --git a/src/test/java/org/apache/commons/pool2/PoolTest.java b/src/test/java/org/apache/commons/pool2/PoolTest.java new file mode 100644 index 000..e22e70b --- /dev/null +++ b/src/test/java/org/apache/commons/pool2/PoolTest.java @@ -0,0 +1,80 @@ +package org.apache.commons.pool2; + +import static org.junit.Assert.assertFalse; + +import org.apache.commons.pool2.impl.DefaultPooledObject; +import org.apache.commons.pool2.impl.GenericObjectPool; +import org.apache.commons.pool2.impl.GenericObjectPoolConfig; +import org.junit.Ignore; +import org.junit.Test; + +@Ignore +public class PoolTest { +private static final CharSequence COMMONS_POOL_EVICTIONS_TIMER_THREAD_NAME = "commons-pool-EvictionTimer"; +private static final long EVICTION_PERIOD_IN_MILLIS = 100; + +private static class Foo { +} + +private static class PooledFooFactory implements PooledObjectFactory { +private static final long VALIDATION_WAIT_IN_MILLIS = 1000; + +@Override +public PooledObject makeObject() throws Exception { +return new DefaultPooledObject(new Foo()); +} + +@Override +public void destroyObject(PooledObject pooledObject) throws Exception { +} + +@Override +public boolean validateObject(PooledObject pooledObject) { +try { +Thread.sleep(VALIDATION_WAIT_IN_MILLIS); +} catch (final InterruptedException e) { +Thread.interrupted(); +} +return false; +} + +@Override +public void activateObject(PooledObject pooledObject) throws Exception { +} + +@Override +public void passivateObject(PooledObject pooledObject) throws Exception { +} +} + +@Test +public void testPool() throws Exception { +final GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig(); +poolConfig.setTestWhileIdle(true /* testWhileIdle */); +final PooledFooFactory pooledFooFactory = new PooledFooFactory(); +GenericObjectPool pool = null; +try { +pool = new GenericObjectPool(pooledFooFactory, poolConfig); +pool.setTimeBetweenEvictionRunsMillis(EVICTION_PERIOD_IN_MILLIS); +pool.addObject(); +try { +Thread.sleep(EVICTION_PERIOD_IN_MILLIS); +} catch (final InterruptedException e) { +Thread.interrupted(); +} +} finally { +if (pool != nul
[37/50] [abbrv] commons-pool git commit: Format: add a blank line between methods.
Format: add a blank line between methods. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1765924 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/8cc1fa06 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/8cc1fa06 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/8cc1fa06 Branch: refs/heads/master Commit: 8cc1fa06c74e9262e5b1e676abcede026559677b Parents: bdab334 Author: Gary D. Gregory Authored: Fri Oct 21 06:12:33 2016 + Committer: Gary D. Gregory Committed: Fri Oct 21 06:12:33 2016 + -- .../commons/pool2/VisitTrackerFactory.java | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/8cc1fa06/src/test/java/org/apache/commons/pool2/VisitTrackerFactory.java -- diff --git a/src/test/java/org/apache/commons/pool2/VisitTrackerFactory.java b/src/test/java/org/apache/commons/pool2/VisitTrackerFactory.java index f341dea..155613c 100644 --- a/src/test/java/org/apache/commons/pool2/VisitTrackerFactory.java +++ b/src/test/java/org/apache/commons/pool2/VisitTrackerFactory.java @@ -22,56 +22,67 @@ import org.apache.commons.pool2.PooledObjectFactory; import org.apache.commons.pool2.impl.DefaultPooledObject; /** - * Factory that creates VisitTracker instances. Used to - * test Evictor runs. + * Factory that creates VisitTracker instances. Used to test Evictor runs. * */ -public class VisitTrackerFactory implements PooledObjectFactory>, -KeyedPooledObjectFactory> { +public class VisitTrackerFactory +implements PooledObjectFactory>, KeyedPooledObjectFactory> { private int nextId = 0; + public VisitTrackerFactory() { super(); } + @Override public PooledObject> makeObject() { return new DefaultPooledObject>(new VisitTracker(nextId++)); } + @Override public PooledObject> makeObject(final K key) { return new DefaultPooledObject>(new VisitTracker(nextId++, key)); } + @Override public void destroyObject(final PooledObject> ref) { ref.getObject().destroy(); } + @Override public void destroyObject(final K key, final PooledObject> ref) { ref.getObject().destroy(); } + @Override public boolean validateObject(final PooledObject> ref) { return ref.getObject().validate(); } + @Override public boolean validateObject(final K key, final PooledObject> ref) { return ref.getObject().validate(); } + @Override public void activateObject(final PooledObject> ref) throws Exception { ref.getObject().activate(); } + @Override public void activateObject(final K key, final PooledObject> ref) throws Exception { ref.getObject().activate(); } + @Override public void passivateObject(final PooledObject> ref) throws Exception { ref.getObject().passivate(); } + @Override public void passivateObject(final K key, final PooledObject> ref) throws Exception { ref.getObject().passivate(); } + public void resetId() { nextId = 0; }
[31/50] [abbrv] commons-pool git commit: Confirm that POOL-310 is invalid.
Confirm that POOL-310 is invalid. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1735291 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/55c10ec2 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/55c10ec2 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/55c10ec2 Branch: refs/heads/master Commit: 55c10ec248933da2e2e8dd3dc8e9bad0811810c0 Parents: a4c544a Author: Mark Thomas Authored: Wed Mar 16 20:19:53 2016 + Committer: Mark Thomas Committed: Wed Mar 16 20:19:53 2016 + -- .../pool2/impl/TestGenericKeyedObjectPool.java | 80 +++- 1 file changed, 61 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/55c10ec2/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java -- diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java index 4777e55..5e8ea4a 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java @@ -416,8 +416,8 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { assertFalse(pool.getBlockWhenExhausted()); } } - -/** + +/** * JIRA: POOL-270 - make sure constructor correctly sets run * frequency of evictor timer. */ @@ -437,7 +437,7 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { assertEquals(0, p.getNumIdle("one")); p.close(); } - + @Test(timeout=6) public void testEviction() throws Exception { @@ -2141,13 +2141,13 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { factory.exceptionOnCreate = false; pool.borrowObject("One"); } - + /** * JIRA: POOL-287 - * + * * Verify that when an attempt is made to borrow an instance from the pool * while the evictor is visiting it, there is no capacity leak. - * + * * Test creates the scenario described in POOL-287. */ @Test @@ -2161,15 +2161,15 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { pool.setMaxTotalPerKey(2); pool.setNumTestsPerEvictionRun(1); pool.setTimeBetweenEvictionRunsMillis(500); - + // Load pool with two objects pool.addObject("one"); // call this o1 pool.addObject("one"); // call this o2 // Default is LIFO, so "one" pool is now [o2, o1] in offer order. // Evictor will visit in oldest-to-youngest order, so o1 then o2 - + Thread.sleep(800); // Wait for first eviction run to complete - + // At this point, one eviction run should have completed, visiting o1 // and eviction cursor should be pointed at o2, which is the next offered instance Thread.sleep(250); // Wait for evictor to start @@ -2179,11 +2179,11 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { pool.returnObject("one", o2); pool.close(); } - + /** * Verifies that when a factory's makeObject produces instances that are not - * discernible by equals, the pool can handle them. - * + * discernible by equals, the pool can handle them. + * * JIRA: POOL-283 */ @Test @@ -2198,11 +2198,11 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { pool.returnObject("a", s2); pool.close(); } - + /** * Verifies that when a borrowed object is mutated in a way that does not * preserve equality and hashcode, the pool can recognized it on return. - * + * * JIRA: POOL-284 */ @Test @@ -2219,11 +2219,11 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { pool.returnObject("a", s2); pool.close(); } - + /** * Verifies that returning an object twice (without borrow in between) causes ISE * but does not re-validate or re-passivate the instance. - * + * * JIRA: POOL-285 */ @Test @@ -2246,6 +2246,48 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { } } +/** + * Verifies that if a borrow of a new key is blocked because maxTotal has + * been reached, that that borrow continues once another object is returned. + * + * JIRA: POOL-310 + */ +@Test +public void testMaxTotalWit
[11/50] [abbrv] commons-pool git commit: Set svn:eol-style = native on Java files. No functional change.
Set svn:eol-style = native on Java files. No functional change. Noted when running checks on the copy of Apache Commons Pool in Apache Tomcat. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1725959 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/458f5e52 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/458f5e52 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/458f5e52 Branch: refs/heads/master Commit: 458f5e5231366ba94beeefa5030a153ec6590bf1 Parents: 3737d6e Author: Konstantin Kolinko Authored: Thu Jan 21 14:22:28 2016 + Committer: Konstantin Kolinko Committed: Thu Jan 21 14:22:28 2016 + -- .../org/apache/commons/pool2/BaseObject.java| 80 ++-- 1 file changed, 40 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/458f5e52/src/main/java/org/apache/commons/pool2/BaseObject.java -- diff --git a/src/main/java/org/apache/commons/pool2/BaseObject.java b/src/main/java/org/apache/commons/pool2/BaseObject.java index 1215430..019b678 100644 --- a/src/main/java/org/apache/commons/pool2/BaseObject.java +++ b/src/main/java/org/apache/commons/pool2/BaseObject.java @@ -1,40 +1,40 @@ -/* - * 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.pool2; - -/** - * A base class for common functionality. - * - * @since 2.4.3 - */ -public abstract class BaseObject { - -@Override -public String toString() { -StringBuilder builder = new StringBuilder(); -builder.append(getClass().getSimpleName()); -builder.append(" ["); -toStringAppendFields(builder); -builder.append("]"); -return builder.toString(); -} - -protected void toStringAppendFields(StringBuilder builder) { -// do nothing by default, needed for b/w compatibility. -} - -} +/* + * 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.pool2; + +/** + * A base class for common functionality. + * + * @since 2.4.3 + */ +public abstract class BaseObject { + +@Override +public String toString() { +StringBuilder builder = new StringBuilder(); +builder.append(getClass().getSimpleName()); +builder.append(" ["); +toStringAppendFields(builder); +builder.append("]"); +return builder.toString(); +} + +protected void toStringAppendFields(StringBuilder builder) { +// do nothing by default, needed for b/w compatibility. +} + +}
[08/50] [abbrv] commons-pool git commit: Update copyright for 2016 in NOTICE.txt
Update copyright for 2016 in NOTICE.txt git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1725441 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/ccbbb32e Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/ccbbb32e Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/ccbbb32e Branch: refs/heads/master Commit: ccbbb32edfa9ed6c8af4eee3f041ab3111d22742 Parents: 6425322 Author: Gary D. Gregory Authored: Tue Jan 19 06:21:14 2016 + Committer: Gary D. Gregory Committed: Tue Jan 19 06:21:14 2016 + -- NOTICE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/ccbbb32e/NOTICE.txt -- diff --git a/NOTICE.txt b/NOTICE.txt index db24c60..9db1cca 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,5 +1,5 @@ Apache Commons Pool -Copyright 2001-2015 The Apache Software Foundation +Copyright 2001-2016 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/).
[25/50] [abbrv] commons-pool git commit: POOL-303 Ensure that threads do not block indefinitely if more than maxTotal threads try to borrow an object at the same time and the factory fails to create a
POOL-303 Ensure that threads do not block indefinitely if more than maxTotal threads try to borrow an object at the same time and the factory fails to create any objects. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1735161 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/fa819eb4 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/fa819eb4 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/fa819eb4 Branch: refs/heads/master Commit: fa819eb4be47b7078ef973cbc37df38e7df6eb1f Parents: a898de8 Author: Mark Thomas Authored: Tue Mar 15 20:17:51 2016 + Committer: Mark Thomas Committed: Tue Mar 15 20:17:51 2016 + -- src/changes/changes.xml | 5 ++ .../pool2/impl/GenericKeyedObjectPool.java | 18 +++- .../commons/pool2/impl/GenericObjectPool.java | 6 ++ .../pool2/impl/TestGenericObjectPool.java | 93 +--- 4 files changed, 107 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/fa819eb4/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index f515689..a1293f7 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -51,6 +51,11 @@ The type attribute can be add,update,fix,remove. Ensure BaseGenericObjectPool.IdentityWrapper#equals() follows the expected contract for equals(). + + Ensure that threads do not block indefinitely if more than maxTotal + threads try to borrow an object at the same time and the factory fails to + create any objects. + http://git-wip-us.apache.org/repos/asf/commons-pool/blob/fa819eb4/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java index eb335d6..697ae05 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java @@ -476,7 +476,7 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool throw new IllegalStateException( "Returned object not currently part of this pool"); } - + synchronized(p) { final PooledObjectState state = p.getState(); if (state != PooledObjectState.ALLOCATED) { @@ -907,7 +907,7 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool if (objectDeque == null) { continue; } - + final Deque> idleObjects = objectDeque.getIdleObjects(); evictionIterator = new EvictionIterator(idleObjects); if (evictionIterator.hasNext()) { @@ -1004,6 +1004,8 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool final int maxTotalPerKeySave = getMaxTotalPerKey(); // Per key final int maxTotal = getMaxTotal(); // All keys +final ObjectDeque objectDeque = poolMap.get(key); + // Check against the overall limit boolean loop = true; @@ -1012,6 +1014,9 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool if (maxTotal > -1 && newNumTotal > maxTotal) { numTotal.decrementAndGet(); if (getNumIdle() == 0) { +// POOL-303. There may be threads waiting on an object +// return that isn't going to happen. Unblock them. +objectDeque.idleObjects.interuptTakeWaiters(); return null; } clearOldest(); @@ -1020,7 +1025,6 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool } } -final ObjectDeque objectDeque = poolMap.get(key); final long newCreateCount = objectDeque.getCreateCount().incrementAndGet(); // Check against the per key limit @@ -1028,6 +1032,9 @@ public class GenericKeyedObjectPool extends BaseGenericObjectPool newCreateCount > Integer.MAX_VALUE) { numTotal.decrementAndGet(); objectDeque.getCreateCount().decrementAndGet(); +// POOL-303. There may be threads waiting on an object return that +// isn't going to happen. Unblock them. +objectDeque.idleObjects.interuptTakeWaiters(); retu
[07/50] [abbrv] commons-pool git commit: findbugs-maven-plugin 3.0.1 -> 3.0.3.
findbugs-maven-plugin 3.0.1 -> 3.0.3. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1724896 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/64253220 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/64253220 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/64253220 Branch: refs/heads/master Commit: 64253220a8c597663efffa9f716904efe54117ab Parents: 1d288b3 Author: Gary D. Gregory Authored: Fri Jan 15 23:53:17 2016 + Committer: Gary D. Gregory Committed: Fri Jan 15 23:53:17 2016 + -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/64253220/pom.xml -- diff --git a/pom.xml b/pom.xml index 08693ad..72de719 100644 --- a/pom.xml +++ b/pom.xml @@ -243,7 +243,7 @@ org.codehaus.mojo findbugs-maven-plugin - 3.0.1 + 3.0.3 Normal Default
[04/50] [abbrv] commons-pool git commit: Obsolete DOAP
Obsolete DOAP git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/branches/performance-concurrent@1719170 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/05c3d6f1 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/05c3d6f1 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/05c3d6f1 Branch: refs/heads/performance-concurrent Commit: 05c3d6f1d57c76a2628cd845c542c5119defaff6 Parents: f8b3268 Author: Sebastian Bazley Authored: Thu Dec 10 18:16:55 2015 + Committer: Sebastian Bazley Committed: Thu Dec 10 18:16:55 2015 + -- doap_pool.rdf | 50 -- 1 file changed, 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/05c3d6f1/doap_pool.rdf -- diff --git a/doap_pool.rdf b/doap_pool.rdf deleted file mode 100644 index dc3fc84..000 --- a/doap_pool.rdf +++ /dev/null @@ -1,50 +0,0 @@ - -http://usefulinc.com/ns/doap#"; xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:asfext="http://projects.apache.org/ns/asfext#"; xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"; xmlns:doap="http://usefulinc.com/ns/doap#"; xml:lang="en"> - http://jakarta.apache.org/commons/pool/";> -Apache Jakarta Commons Pool -http://jakarta.apache.org/commons/pool/"/> -Java -http://projects.apache.org/category/library"/> -http://usefulinc.com/doap/licenses/asl20"/> -http://issues.apache.org/bugzilla/buglist.cgi?product=Commons&component=pool"/> -http://jakarta.apache.org/site/downloads/downloads_commons-pool.cgi"/> -http://jakarta.apache.org/"/> -Commons Object Pooling Library -Commons Object Pooling Library - - -http://svn.apache.org/repos/asf/jakarta/commons/proper/pool/trunk"/> -http://svn.apache.org/repos/asf/jakarta/commons/proper/pool"/> - - - - -commons-pool -2004-06-07 -1.2 - - - - -commons-pool -2004-10-20 -1.1 - - - - -commons-pool -2002-08-12 -1.0.1 - - - - -commons-pool -2002-05-04 -1.0 - - -http://jakarta.apache.org/site/mail2.html#Commons"/> - -
[01/50] [abbrv] commons-pool git commit: Obsolete DOAP
Repository: commons-pool Updated Branches: refs/heads/1_3_RELEASE_BRANCH [created] 69e8dabed refs/heads/1_4_RELEASE_BRANCH [created] 7c1298675 refs/heads/1_5_RELEASE [created] 1ad1ea8b8 refs/heads/2_0_DEV [created] ec8305a96 refs/heads/POOL_1_5 [created] 6d76be52d refs/heads/POOL_1_X [created] 3f9714fca refs/heads/POOL_FUTURE [created] 28a07d414 refs/heads/master [created] 3994baf0f refs/heads/performance-concurrent [created] 05c3d6f1d refs/heads/performance-ideas [created] ae5838a2d refs/heads/pool [created] 34bfbae4a Obsolete DOAP git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/branches/2_0_DEV@1719167 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/ec8305a9 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/ec8305a9 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/ec8305a9 Branch: refs/heads/2_0_DEV Commit: ec8305a96c2cbe76cda2f55c8b6b300a8b3c8f0f Parents: 6b7635d Author: Sebastian Bazley Authored: Thu Dec 10 18:16:24 2015 + Committer: Sebastian Bazley Committed: Thu Dec 10 18:16:24 2015 + -- doap_pool.rdf | 50 -- 1 file changed, 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/ec8305a9/doap_pool.rdf -- diff --git a/doap_pool.rdf b/doap_pool.rdf deleted file mode 100644 index b8dcc66..000 --- a/doap_pool.rdf +++ /dev/null @@ -1,50 +0,0 @@ - -http://usefulinc.com/ns/doap#"; xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:asfext="http://projects.apache.org/ns/asfext#"; xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"; xmlns:doap="http://usefulinc.com/ns/doap#"; xml:lang="en"> - http://commons.apache.org/pool/";> -Apache Commons Pool -http://commons.apache.org/pool/"/> -Java -http://projects.apache.org/category/library"/> -http://usefulinc.com/doap/licenses/asl20"/> -http://issues.apache.org/jira/browse/POOL"/> -http://jakarta.apache.org/site/downloads/downloads_commons-pool.cgi"/> -http://commons.apache.org/"/> -Commons Object Pooling Library -Commons Object Pooling Library - - -http://svn.apache.org/repos/asf/commons/proper/pool/trunk"/> -http://svn.apache.org/repos/asf/commons/proper/pool"/> - - - - -commons-pool -2004-06-07 -1.2 - - - - -commons-pool -2004-10-20 -1.1 - - - - -commons-pool -2002-08-12 -1.0.1 - - - - -commons-pool -2002-05-04 -1.0 - - -http://commons.apache.org/mail-lists.html"/> - -
[10/50] [abbrv] commons-pool git commit: Fill some Javadoc gaps
Fill some Javadoc gaps git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1725738 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/3737d6e6 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/3737d6e6 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/3737d6e6 Branch: refs/heads/master Commit: 3737d6e67cd4c2b141c1db6125a996c198e51909 Parents: d404937 Author: Mark Thomas Authored: Wed Jan 20 15:20:09 2016 + Committer: Mark Thomas Committed: Wed Jan 20 15:20:09 2016 + -- .../commons/pool2/impl/LinkedBlockingDeque.java | 52 1 file changed, 32 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/3737d6e6/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java b/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java index 8ace792..dcbcc18 100644 --- a/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java +++ b/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java @@ -418,8 +418,9 @@ class LinkedBlockingDeque extends AbstractQueue * * @param e element to link * - * @throws NullPointerException - * @throws InterruptedException + * @throws NullPointerException if e is null + * @throws InterruptedException if the thread is interrupted whilst waiting + * for space */ public void putFirst(E e) throws InterruptedException { if (e == null) { @@ -441,8 +442,9 @@ class LinkedBlockingDeque extends AbstractQueue * * @param e element to link * - * @throws NullPointerException - * @throws InterruptedException + * @throws NullPointerException if e is null + * @throws InterruptedException if the thread is interrupted whilst waiting + * for space */ public void putLast(E e) throws InterruptedException { if (e == null) { @@ -468,8 +470,9 @@ class LinkedBlockingDeque extends AbstractQueue * * @return {@code true} if successful, otherwise {@code false} * - * @throws NullPointerException - * @throws InterruptedException + * @throws NullPointerException if e is null + * @throws InterruptedException if the thread is interrupted whilst waiting + * for space */ public boolean offerFirst(E e, long timeout, TimeUnit unit) throws InterruptedException { @@ -501,8 +504,9 @@ class LinkedBlockingDeque extends AbstractQueue * * @return {@code true} if successful, otherwise {@code false} * - * @throws NullPointerException - * @throws InterruptedException + * @throws NullPointerException if e is null + * @throws InterruptedException if the thread is interrupted whist waiting + * for space */ public boolean offerLast(E e, long timeout, TimeUnit unit) throws InterruptedException { @@ -773,8 +777,9 @@ class LinkedBlockingDeque extends AbstractQueue * * @param e element to link * - * @throws NullPointerException - * @throws InterruptedException + * @throws NullPointerException if e is null + * @throws InterruptedException if the thread is interrupted whilst waiting + * for space */ public void put(E e) throws InterruptedException { putLast(e); @@ -792,8 +797,9 @@ class LinkedBlockingDeque extends AbstractQueue * * @return {@code true} if successful, otherwise {@code false} * - * @throws NullPointerException - * @throws InterruptedException + * @throws NullPointerException if e is null + * @throws InterruptedException if the thread is interrupted whilst waiting + * for space */ public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException { @@ -898,10 +904,13 @@ class LinkedBlockingDeque extends AbstractQueue * * @return number of elements added to the collection * - * @throws UnsupportedOperationException - * @throws ClassCastException - * @throws NullPointerException - * @throws IllegalArgumentException + * @throws UnsupportedOperationException if the add operation is not + * supported by the specified collection + * @throws ClassCastException if the class of the elements held by this + * collection prevents them from being added to the specified + * collection + * @throws NullPointerException if c is null + * @throws IllegalArgumentException if c is this instance */
[12/50] [abbrv] commons-pool git commit: Removed self from developers.
Removed self from developers. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1728845 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/4a7f18bc Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/4a7f18bc Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/4a7f18bc Branch: refs/heads/master Commit: 4a7f18bc2b7733bdbd65d570d3631a414291770a Parents: 458f5e5 Author: Phil Steitz Authored: Sat Feb 6 15:04:31 2016 + Committer: Phil Steitz Committed: Sat Feb 6 15:04:31 2016 + -- pom.xml | 6 -- 1 file changed, 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/4a7f18bc/pom.xml -- diff --git a/pom.xml b/pom.xml index 72de719..10d9803 100644 --- a/pom.xml +++ b/pom.xml @@ -95,12 +95,6 @@ The Apache Software Foundation - Phil Steitz - psteitz - - The Apache Software Foundation - - Simone Tripodi simonetripodi The Apache Software Foundation
[14/50] [abbrv] commons-pool git commit: Add final modifier to local variables.
http://git-wip-us.apache.org/repos/asf/commons-pool/blob/5fe7dc02/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java -- diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java index de7cfc7..9305783 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java @@ -69,9 +69,9 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { @Override protected KeyedObjectPool makeEmptyPool(int mincapacity) { -KeyedPooledObjectFactory perKeyFactory = +final KeyedPooledObjectFactory perKeyFactory = new SimplePerKeyFactory(); -GenericKeyedObjectPool perKeyPool = +final GenericKeyedObjectPool perKeyPool = new GenericKeyedObjectPool(perKeyFactory); perKeyPool.setMaxTotalPerKey(mincapacity); perKeyPool.setMaxIdlePerKey(mincapacity); @@ -111,22 +111,22 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { @After public void tearDown() throws Exception { super.tearDown(); -String poolName = pool.getJmxName().toString(); +final String poolName = pool.getJmxName().toString(); pool.clear(); pool.close(); pool = null; factory = null; -MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); -Set result = mbs.queryNames(new ObjectName( +final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); +final Set result = mbs.queryNames(new ObjectName( "org.apache.commoms.pool2:type=GenericKeyedObjectPool,*"), null); // There should be no registered pools at this point -int registeredPoolCount = result.size(); -StringBuilder msg = new StringBuilder("Current pool is: "); +final int registeredPoolCount = result.size(); +final StringBuilder msg = new StringBuilder("Current pool is: "); msg.append(poolName); msg.append(" Still open pools are: "); -for (ObjectName name : result) { +for (final ObjectName name : result) { // Clean these up ready for the next test msg.append(name.toString()); msg.append(" created via\n"); @@ -141,7 +141,7 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { public void testNegativeMaxTotalPerKey() throws Exception { pool.setMaxTotalPerKey(-1); pool.setBlockWhenExhausted(false); -String obj = pool.borrowObject(""); +final String obj = pool.borrowObject(""); assertEquals("0",obj); pool.returnObject("",obj); } @@ -155,8 +155,8 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { assertEquals(0,pool.getNumActive("B")); assertEquals(0,pool.getNumIdle("B")); -String objA0 = pool.borrowObject("A"); -String objB0 = pool.borrowObject("B"); +final String objA0 = pool.borrowObject("A"); +final String objB0 = pool.borrowObject("B"); assertEquals(2,pool.getNumActive()); assertEquals(0,pool.getNumIdle()); @@ -165,8 +165,8 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { assertEquals(1,pool.getNumActive("B")); assertEquals(0,pool.getNumIdle("B")); -String objA1 = pool.borrowObject("A"); -String objB1 = pool.borrowObject("B"); +final String objA1 = pool.borrowObject("A"); +final String objB1 = pool.borrowObject("B"); assertEquals(4,pool.getNumActive()); assertEquals(0,pool.getNumIdle()); @@ -200,7 +200,7 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { public void testMaxIdle() throws Exception { pool.setMaxTotalPerKey(100); pool.setMaxIdlePerKey(8); -String[] active = new String[100]; +final String[] active = new String[100]; for(int i=0;i<100;i++) { active[i] = pool.borrowObject(""); } @@ -242,7 +242,7 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { try { pool.borrowObject(""); fail("Expected NoSuchElementException"); -} catch(NoSuchElementException e) { +} catch(final NoSuchElementException e) { // expected } } @@ -255,7 +255,7 @@ public class TestGenericKeyedObjectPool extends TestKeyedObjectPool { try { pool.borrowObject("a"); fail("Expected NoSuchElementException"); -} catch(NoSuchElementException e) { +} catch(final NoSuchElementException e) { // expected } } @@ -266,16 +266,16 @
[02/50] [abbrv] commons-pool git commit: Obsolete DOAP
Obsolete DOAP git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/branches/POOL_1_X@1719168 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/3f9714fc Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/3f9714fc Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/3f9714fc Branch: refs/heads/POOL_1_X Commit: 3f9714fca2c5509fb4e41e35984f1de210c5c360 Parents: 8153d2e Author: Sebastian Bazley Authored: Thu Dec 10 18:16:34 2015 + Committer: Sebastian Bazley Committed: Thu Dec 10 18:16:34 2015 + -- doap_pool.rdf | 128 - 1 file changed, 128 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/3f9714fc/doap_pool.rdf -- diff --git a/doap_pool.rdf b/doap_pool.rdf deleted file mode 100644 index de8920b..000 --- a/doap_pool.rdf +++ /dev/null @@ -1,128 +0,0 @@ - - - -http://usefulinc.com/ns/doap#"; xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:asfext="http://projects.apache.org/ns/asfext#"; xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"; xmlns:doap="http://usefulinc.com/ns/doap#"; xml:lang="en"> - http://commons.apache.org/pool/";> -Apache Commons Pool -http://commons.apache.org/pool/"/> -Java -http://projects.apache.org/category/library"/> -http://usefulinc.com/doap/licenses/asl20"/> -http://issues.apache.org/jira/browse/POOL"/> -http://commons.apache.org/pool/download_pool.cgi"/> -http://commons.apache.org/"/> -Commons Object Pooling Library -Commons Object Pooling Library - - -http://svn.apache.org/repos/asf/commons/proper/pool/trunk"/> -http://svn.apache.org/repos/asf/commons/proper/pool"/> - - - - -commons-pool -2012-01-07 -1.6 - - -commons-pool -2011-12-20 -1.5.7 - - -commons-pool -2011-04-03 -1.5.6 - - -commons-pool -2010-09-10 -1.5.5 - - -commons-pool -2009-11-20 -1.5.4 - - -commons-pool -2009-09-23 -1.5.3 - - -commons-pool -2009-07-12 -1.5.2 - - -commons-pool -2009-06-16 -1.5.1 - - -commons-pool -2009-06-10 -1.5 - - - - -commons-pool -2008-01-15 -1.4 - - - - -commons-pool -2006-04-06 -1.3 - - - - -commons-pool -2004-06-07 -1.2 - - - - -commons-pool -2003-10-20 -1.1 - - - - -commons-pool -2002-08-12 -1.0.1 - - - - -commons-pool -2002-05-04 -1.0 - - -http://commons.apache.org/mail-lists.html"/> - -
[09/50] [abbrv] commons-pool git commit: Remove unused throws
Remove unused throws git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1725736 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/d404937b Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/d404937b Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/d404937b Branch: refs/heads/master Commit: d404937b66525d96f8e4ba5dd034328dd7bd883d Parents: ccbbb32 Author: Mark Thomas Authored: Wed Jan 20 15:01:00 2016 + Committer: Mark Thomas Committed: Wed Jan 20 15:01:00 2016 + -- .../org/apache/commons/pool2/impl/GenericObjectPool.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/d404937b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java -- diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java index ed18d49..6182d41 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java @@ -327,7 +327,7 @@ public class GenericObjectPool extends BaseGenericObjectPool * * @see AbandonedConfig */ -public void setAbandonedConfig(AbandonedConfig abandonedConfig) throws IllegalArgumentException { +public void setAbandonedConfig(AbandonedConfig abandonedConfig) { if (abandonedConfig == null) { this.abandonedConfig = null; } else { @@ -534,7 +534,7 @@ public class GenericObjectPool extends BaseGenericObjectPool @Override public void returnObject(T obj) { PooledObject p = allObjects.get(new IdentityWrapper(obj)); - + if (p == null) { if (!isAbandonedConfig()) { throw new IllegalStateException( @@ -825,7 +825,7 @@ public class GenericObjectPool extends BaseGenericObjectPool removeAbandoned(ac); } } - + /** * Tries to ensure that {@link #getMinIdle()} idle instances are available * in the pool. @@ -1163,5 +1163,5 @@ public class GenericObjectPool extends BaseGenericObjectPool builder.append(", abandonedConfig="); builder.append(abandonedConfig); } - + }
[03/50] [abbrv] commons-pool git commit: Obsolete DOAP
Obsolete DOAP git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/branches/POOL_FUTURE@1719169 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/28a07d41 Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/28a07d41 Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/28a07d41 Branch: refs/heads/POOL_FUTURE Commit: 28a07d414c5aaf4e2f43e5274190347cc06c305a Parents: 49832ce Author: Sebastian Bazley Authored: Thu Dec 10 18:16:44 2015 + Committer: Sebastian Bazley Committed: Thu Dec 10 18:16:44 2015 + -- doap_pool.rdf | 112 - 1 file changed, 112 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/28a07d41/doap_pool.rdf -- diff --git a/doap_pool.rdf b/doap_pool.rdf deleted file mode 100644 index bd81210..000 --- a/doap_pool.rdf +++ /dev/null @@ -1,112 +0,0 @@ - - -http://usefulinc.com/ns/doap#"; xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:asfext="http://projects.apache.org/ns/asfext#"; xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"; xmlns:doap="http://usefulinc.com/ns/doap#"; xml:lang="en"> - http://commons.apache.org/pool/";> -Apache Commons Pool -http://commons.apache.org/pool/"/> -Java -http://projects.apache.org/category/library"/> -http://usefulinc.com/doap/licenses/asl20"/> -http://issues.apache.org/jira/browse/POOL"/> -http://commons.apache.org/pool/download_pool.cgi"/> -http://commons.apache.org/"/> -Commons Object Pooling Library -Commons Object Pooling Library - - -http://svn.apache.org/repos/asf/commons/proper/pool/trunk"/> -http://svn.apache.org/repos/asf/commons/proper/pool"/> - - - - -commons-pool -2010-09-10 -1.5.5 - - -commons-pool -2009-11-20 -1.5.4 - - -commons-pool -2009-09-23 -1.5.3 - - -commons-pool -2009-07-12 -1.5.2 - - -commons-pool -2009-06-16 -1.5.1 - - -commons-pool -2009-06-10 -1.5 - - - - -commons-pool -2008-01-15 -1.4 - - - - -commons-pool -2006-04-06 -1.3 - - - - -commons-pool -2004-06-07 -1.2 - - - - -commons-pool -2003-10-20 -1.1 - - - - -commons-pool -2002-08-12 -1.0.1 - - - - -commons-pool -2002-05-04 -1.0 - - -http://commons.apache.org/mail-lists.html"/> - -
[21/50] [abbrv] commons-pool git commit: [POOL-309] Fix misspellings from "destory" to "destroy". interupt -> interrupt
[POOL-309] Fix misspellings from "destory" to "destroy". interupt -> interrupt git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1733561 13f79535-47bb-0310-9956-ffa450edef68 Project: http://git-wip-us.apache.org/repos/asf/commons-pool/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-pool/commit/29cc202b Tree: http://git-wip-us.apache.org/repos/asf/commons-pool/tree/29cc202b Diff: http://git-wip-us.apache.org/repos/asf/commons-pool/diff/29cc202b Branch: refs/heads/master Commit: 29cc202b9c9783a8cf7a0e2d01785dbfb0a97060 Parents: 5ec116a Author: Gary D. Gregory Authored: Fri Mar 4 06:41:20 2016 + Committer: Gary D. Gregory Committed: Fri Mar 4 06:41:20 2016 + -- .../java/org/apache/commons/pool2/impl/TestGenericObjectPool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-pool/blob/29cc202b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java -- diff --git a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java index 92fee38..a694106 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java @@ -248,7 +248,7 @@ public class TestGenericObjectPool extends TestBaseObjectPool { Thread.sleep(200); wtt.interrupt(); -// Give interupt time to take effect +// Give interrupt time to take effect Thread.sleep(200); // Check thread was interrupted
[lang] .travis.yml: include apache rat license check in the main script, so that the build fails if there are violations
Repository: commons-lang Updated Branches: refs/heads/master 4fb393be2 -> 15dcb423c .travis.yml: include apache rat license check in the main script, so that the build fails if there are violations Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/15dcb423 Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/15dcb423 Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/15dcb423 Branch: refs/heads/master Commit: 15dcb423cf0af2b52c0b5cc60d5f0bce85dcacdd Parents: 4fb393b Author: pascalschumacher Authored: Sun Mar 12 18:07:19 2017 +0100 Committer: pascalschumacher Committed: Sun Mar 12 18:07:19 2017 +0100 -- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/15dcb423/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 44a34a8..5684ab6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ jdk: - oraclejdk8 script: - - mvn test checkstyle:check javadoc:javadoc -B + - mvn test checkstyle:check javadoc:javadoc apache-rat:check -B after_success: - - mvn clean apache-rat:check cobertura:cobertura coveralls:report + - mvn clean cobertura:cobertura coveralls:report
[4/6] [lang] Replace tabs with spaces in DateUtils
Replace tabs with spaces in DateUtils Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/4259a706 Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/4259a706 Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/4259a706 Branch: refs/heads/master Commit: 4259a706ab8641f408afc3ce224b1c0ba5a43d17 Parents: ba7c788 Author: Allon Mureinik Authored: Sat Mar 11 09:54:27 2017 +0200 Committer: pascalschumacher Committed: Sun Mar 12 17:41:50 2017 +0100 -- src/main/java/org/apache/commons/lang3/time/DateUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/4259a706/src/main/java/org/apache/commons/lang3/time/DateUtils.java -- diff --git a/src/main/java/org/apache/commons/lang3/time/DateUtils.java b/src/main/java/org/apache/commons/lang3/time/DateUtils.java index fc9f577..859011a 100644 --- a/src/main/java/org/apache/commons/lang3/time/DateUtils.java +++ b/src/main/java/org/apache/commons/lang3/time/DateUtils.java @@ -675,9 +675,9 @@ public class DateUtils { * @throws NullPointerException if {@code date} or {@code tz} is null */ public static Calendar toCalendar(final Date date, final TimeZone tz) { - final Calendar c = Calendar.getInstance(tz); - c.setTime(date); - return c; +final Calendar c = Calendar.getInstance(tz); +c.setTime(date); +return c; } //---
[1/6] [lang] Remove unused SystemUtils import from ExceptionUtils
Repository: commons-lang Updated Branches: refs/heads/master 4282efae5 -> 4fb393be2 Remove unused SystemUtils import from ExceptionUtils Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/ba7c7880 Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/ba7c7880 Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/ba7c7880 Branch: refs/heads/master Commit: ba7c788042ce0f4e156b6900d3d698e47aef5a4d Parents: 1f8479a Author: Allon Mureinik Authored: Sat Mar 11 09:52:41 2017 +0200 Committer: pascalschumacher Committed: Sun Mar 12 17:41:49 2017 +0100 -- .../java/org/apache/commons/lang3/exception/ExceptionUtils.java | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/ba7c7880/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java -- diff --git a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java index 7b5b4d4..39e270b 100644 --- a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java +++ b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java @@ -29,7 +29,6 @@ import java.util.StringTokenizer; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ClassUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.SystemUtils; /** * Provides utilities for manipulating and examining
[6/6] [lang] Add checkstyle to Travis CI (closes #254)
Add checkstyle to Travis CI (closes #254) Currently, checkstyle is only run as part of the reporting phase, and it's up to the developer to check the report manually. This patch adds the checkstyle configuration to the build plugins so it can be used to check the code (as opposed to just generate a report of the failures) and adds it to Travis CI's configuration so every new patch will be automatically checked against it. Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/4fb393be Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/4fb393be Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/4fb393be Branch: refs/heads/master Commit: 4fb393be2c847d77b371a246e22704855a42201a Parents: 754e669 Author: Allon Mureinik Authored: Sat Mar 11 11:14:16 2017 +0200 Committer: pascalschumacher Committed: Sun Mar 12 17:57:23 2017 +0100 -- .travis.yml | 2 +- pom.xml | 11 ++- 2 files changed, 11 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/4fb393be/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 4e3fd53..44a34a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ jdk: - oraclejdk8 script: - - mvn test javadoc:javadoc -B + - mvn test checkstyle:check javadoc:javadoc -B after_success: - mvn clean apache-rat:check cobertura:cobertura coveralls:report http://git-wip-us.apache.org/repos/asf/commons-lang/blob/4fb393be/pom.xml -- diff --git a/pom.xml b/pom.xml index c4049c9..fc75181 100644 --- a/pom.xml +++ b/pom.xml @@ -576,6 +576,7 @@ 2.8 +2.17 @@ -646,6 +647,14 @@ + +maven-checkstyle-plugin +${checkstyle.plugin.version} + + ${basedir}/checkstyle.xml + false + + @@ -654,7 +663,7 @@ maven-checkstyle-plugin -2.17 +${checkstyle.plugin.version} ${basedir}/checkstyle.xml false
[3/6] [lang] Upgrade maven-checkstyle-plugin to 2.17
Upgrade maven-checkstyle-plugin to 2.17 This patch upgrades maven-checkstyle-plugin to the latest available version, 2.17. This is done in order to consume a fix for checkstyle wrongfully reporting an error if the @return javadoc tag was used in an annotation type, as it is in Guarded (line 36). Note that checkstyle has removed the RedundantThrows check (see discussion at https://github.com/checkstyle/checkstyle/issues/473), so it was removed from the project's checkstyle.xml configuration. Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/c121f03d Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/c121f03d Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/c121f03d Branch: refs/heads/master Commit: c121f03d5c6dae98b0c735cec0a5126520293f08 Parents: 4259a70 Author: Allon Mureinik Authored: Sat Mar 11 10:13:44 2017 +0200 Committer: pascalschumacher Committed: Sun Mar 12 17:41:50 2017 +0100 -- checkstyle.xml | 3 --- pom.xml| 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/c121f03d/checkstyle.xml -- diff --git a/checkstyle.xml b/checkstyle.xml index bbec654..6f03c44 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -36,9 +36,6 @@ limitations under the License. - - - http://git-wip-us.apache.org/repos/asf/commons-lang/blob/c121f03d/pom.xml -- diff --git a/pom.xml b/pom.xml index d467ecd..c4049c9 100644 --- a/pom.xml +++ b/pom.xml @@ -654,7 +654,7 @@ maven-checkstyle-plugin -2.15 +2.17 ${basedir}/checkstyle.xml false
[2/6] [lang] Apply JavaDoc checkstyle only to public methods
Apply JavaDoc checkstyle only to public methods The defacto style of the project requires Javadoc for public methods only, but the checkstyle Javadoc check defaults to requiring them even for private methods, generating 46 errors. This patch sets the checkstyle Javadoc check's scope to public to clean up the checkstyle report so it can be enabled in the CI. If we wish to reset the check to a laxer scope, the aforementioned errors should be fixed first. Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/1f8479a8 Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/1f8479a8 Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/1f8479a8 Branch: refs/heads/master Commit: 1f8479a84b52bb8c755c84501ba98f0d511adfd0 Parents: 4282efa Author: Allon Mureinik Authored: Sun Mar 5 12:05:23 2017 +0200 Committer: pascalschumacher Committed: Sun Mar 12 17:41:49 2017 +0100 -- checkstyle.xml | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/1f8479a8/checkstyle.xml -- diff --git a/checkstyle.xml b/checkstyle.xml index d4df9da..bbec654 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -41,6 +41,7 @@ limitations under the License. +
[5/6] [lang] org.apache.commons.lang3.concurrent.annotation package-info
org.apache.commons.lang3.concurrent.annotation package-info Added package-info.java to the org.apache.commons.lang3.concurrent.annotation package to solve a checkstyle violation. Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/754e669f Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/754e669f Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/754e669f Branch: refs/heads/master Commit: 754e669f76c5587b163cea7fc5c68f274a267ef1 Parents: c121f03 Author: Allon Mureinik Authored: Sat Mar 11 10:49:22 2017 +0200 Committer: pascalschumacher Committed: Sun Mar 12 17:41:50 2017 +0100 -- .../concurrent/annotation/package-info.java | 22 1 file changed, 22 insertions(+) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/754e669f/src/main/java/org/apache/commons/lang3/concurrent/annotation/package-info.java -- diff --git a/src/main/java/org/apache/commons/lang3/concurrent/annotation/package-info.java b/src/main/java/org/apache/commons/lang3/concurrent/annotation/package-info.java new file mode 100644 index 000..3f29ebf --- /dev/null +++ b/src/main/java/org/apache/commons/lang3/concurrent/annotation/package-info.java @@ -0,0 +1,22 @@ +/* + * 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. + */ +/** + * Provides annotations to document classes' thread safety + * + * @since 3.6 + */ +package org.apache.commons.lang3.concurrent.annotation;
[lang] LANG-1293: Add StringUtils#isAllEmpty and #isAllBlank methods
Repository: commons-lang Updated Branches: refs/heads/master 3ce7f9eec -> 4282efae5 LANG-1293: Add StringUtils#isAllEmpty and #isAllBlank methods fix error in javadoc (side effects: close #221, close #197) Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/4282efae Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/4282efae Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/4282efae Branch: refs/heads/master Commit: 4282efae5f4ab456cef3acac5574f13f4f450b9e Parents: 3ce7f9e Author: pascalschumacher Authored: Sun Mar 12 17:33:53 2017 +0100 Committer: pascalschumacher Committed: Sun Mar 12 17:33:53 2017 +0100 -- src/main/java/org/apache/commons/lang3/StringUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/4282efae/src/main/java/org/apache/commons/lang3/StringUtils.java -- diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index 56a1c47..2250595 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -426,7 +426,7 @@ public class StringUtils { /** * Checks if all of the CharSequences are empty (""), null or whitespace only. * - * Whitespace is defined by {@link Character#isWhitespace(char)}. + * Whitespace is defined by {@link Character#isWhitespace(char)}. * * * StringUtils.isAllBlank(null) = true
[1/2] [lang] LANG-1293: Add StringUtils#isAllEmpty and #isAllBlank methods
Repository: commons-lang Updated Branches: refs/heads/master 31a9fa0cc -> 3ce7f9eec LANG-1293: Add StringUtils#isAllEmpty and #isAllBlank methods Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/6b9c3315 Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/6b9c3315 Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/6b9c3315 Branch: refs/heads/master Commit: 6b9c3315885f8f9e4be19db9ef05257035b97bca Parents: 31a9fa0 Author: Martin Authored: Sun Dec 4 22:13:20 2016 +0100 Committer: pascalschumacher Committed: Sun Mar 12 17:07:31 2017 +0100 -- .../org/apache/commons/lang3/StringUtils.java | 48 .../lang3/StringUtilsEmptyBlankTest.java| 29 2 files changed, 77 insertions(+) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/6b9c3315/src/main/java/org/apache/commons/lang3/StringUtils.java -- diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index 63caeac..d91ad55 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -311,6 +311,29 @@ public class StringUtils { } /** + * Checks if all of the CharSequences are empty ("") or null. + * + * + * StringUtils.isAllEmpty(null) = true + * StringUtils.isAllEmpty(null, "") = true + * StringUtils.isAllEmpty(new String[] {}) = true + * StringUtils.isAllEmpty(null, "foo") = false + * StringUtils.isAllEmpty("", "bar")= false + * StringUtils.isAllEmpty("bob", "")= false + * StringUtils.isAllEmpty(" bob ", null) = false + * StringUtils.isAllEmpty(" ", "bar") = false + * StringUtils.isAllEmpty("foo", "bar") = false + * + * + * @param css the CharSequences to check, may be null or empty + * @return {@code true} if all of the CharSequences are empty or null + * @since 3.6 + */ +public static boolean isAllEmpty(final CharSequence... css) { + return !isAnyNotEmpty(css); +} + +/** * Checks if a CharSequence is empty (""), null or whitespace only. * * Whitespace is defined by {@link Character#isWhitespace(char)}. @@ -455,6 +478,31 @@ public class StringUtils { return !isAnyBlank(css); } +/** + * Checks if all of the CharSequences are empty (""), null or whitespace only. + * + * Whitespace is defined by {@link Character#isWhitespace(char)}. + * + * + * StringUtils.isAllBlank(null) = true + * StringUtils.isAllBlank(null, "foo") = false + * StringUtils.isAllBlank(null, null) = true + * StringUtils.isAllBlank("", "bar")= false + * StringUtils.isAllBlank("bob", "")= false + * StringUtils.isAllBlank(" bob ", null) = false + * StringUtils.isAllBlank(" ", "bar") = false + * StringUtils.isAllBlank("foo", "bar") = false + * StringUtils.isAllBlank(new String[] {}) = true + * + * + * @param css the CharSequences to check, may be null or empty + * @return {@code true} if all of the CharSequences are empty or null or whitespace only + * @since 3.6 + */ +public static boolean isAllBlank(final CharSequence... css) { + return !isAnyNotBlank(css); +} + // Trim //--- /** http://git-wip-us.apache.org/repos/asf/commons-lang/blob/6b9c3315/src/test/java/org/apache/commons/lang3/StringUtilsEmptyBlankTest.java -- diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsEmptyBlankTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsEmptyBlankTest.java index 769a138..b04d0da 100644 --- a/src/test/java/org/apache/commons/lang3/StringUtilsEmptyBlankTest.java +++ b/src/test/java/org/apache/commons/lang3/StringUtilsEmptyBlankTest.java @@ -82,6 +82,21 @@ public class StringUtilsEmptyBlankTest { } @Test +public void testIsAllEmpty() { +assertTrue(StringUtils.isAllEmpty()); +assertTrue(StringUtils.isAllEmpty(new String[]{})); +assertTrue(StringUtils.isAllEmpty((String) null)); +assertTrue(StringUtils.isAllEmpty((String[]) null)); +assertFalse(StringUtils.isAllEmpty(null, "foo")); +assertFalse(StringUtils.isAllEmpty("", "bar")); +assertFalse(StringUtils.isAllEmpty("bob", "")); +assertFalse(StringUtils.isAllEmpty(" bob ", null)); +assertFalse(StringUtils.isAllEmpty(" ", "bar")); +assertFalse(Str
[2/2] [lang] revert "LANG-1270: Add StringUtils#isAnyNotEmpty and #isAnyNotBlank" and add "LANG-1293: Add StringUtils#isAllEmpty and #isAllBlank methods" instead
revert "LANG-1270: Add StringUtils#isAnyNotEmpty and #isAnyNotBlank" and add "LANG-1293: Add StringUtils#isAllEmpty and #isAllBlank methods" instead Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/3ce7f9ee Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/3ce7f9ee Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/3ce7f9ee Branch: refs/heads/master Commit: 3ce7f9eecfacbf3de716a8338ad4929371a66ca2 Parents: 6b9c331 Author: pascalschumacher Authored: Sun Mar 12 17:21:27 2017 +0100 Committer: pascalschumacher Committed: Sun Mar 12 17:21:27 2017 +0100 -- src/changes/changes.xml | 2 +- .../org/apache/commons/lang3/StringUtils.java | 83 +--- .../lang3/StringUtilsEmptyBlankTest.java| 26 -- 3 files changed, 19 insertions(+), 92 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3ce7f9ee/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 5b2cb64..595fcc8 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -66,7 +66,7 @@ The type attribute can be add,update,fix,remove. Implementation of a Memomizer Add ArrayUtils#toStringArray method StringUtils#abbreviate should support 'custom ellipses' parameter -Add StringUtils#isAnyNotEmpty and #isAnyNotBlank +Add StringUtils#isAllEmpty and #isAllBlank methods Provide annotations to document thread safety Increase test coverage of org.apache.commons.lang3.ArrayUtils StrSubstitutor should state its thread safety http://git-wip-us.apache.org/repos/asf/commons-lang/blob/3ce7f9ee/src/main/java/org/apache/commons/lang3/StringUtils.java -- diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index d91ad55..56a1c47 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -259,36 +259,6 @@ public class StringUtils { } /** - * Checks if any of the CharSequences are not empty ("") and not null. - * - * - * StringUtils.isAnyNotEmpty(null) = false - * StringUtils.isAnyNotEmpty(new String[] {}) = false - * StringUtils.isAnyNotEmpty(null, "foo") = true - * StringUtils.isAnyNotEmpty("", "bar")= true - * StringUtils.isAnyNotEmpty("bob", "")= true - * StringUtils.isAnyNotEmpty(" bob ", null) = true - * StringUtils.isAnyNotEmpty(" ", "bar") = true - * StringUtils.isAnyNotEmpty("foo", "bar") = true - * - * - * @param css the CharSequences to check, may be null or empty - * @return {@code true} if any of the CharSequences are not empty and not null - * @since 3.6 - */ -public static boolean isAnyNotEmpty(final CharSequence... css) { - if (ArrayUtils.isEmpty(css)) { -return false; - } - for (final CharSequence cs : css) { -if (isNotEmpty(cs)) { - return true; -} - } - return false; -} - -/** * Checks if none of the CharSequences are empty ("") or null. * * @@ -330,7 +300,15 @@ public class StringUtils { * @since 3.6 */ public static boolean isAllEmpty(final CharSequence... css) { - return !isAnyNotEmpty(css); +if (ArrayUtils.isEmpty(css)) { +return true; +} +for (final CharSequence cs : css) { +if (isNotEmpty(cs)) { +return false; +} +} +return true; } /** @@ -421,39 +399,6 @@ public class StringUtils { } /** - * Checks if any of the CharSequences are not empty (""), not null and not whitespace only. - * - * Whitespace is defined by {@link Character#isWhitespace(char)}. - * - * - * StringUtils.isAnyNotBlank(null) = false - * StringUtils.isAnyNotBlank(null, "foo") = true - * StringUtils.isAnyNotBlank(null, null) = false - * StringUtils.isAnyNotBlank("", "bar")= true - * StringUtils.isAnyNotBlank("bob", "")= true - * StringUtils.isAnyNotBlank(" bob ", null) = true - * StringUtils.isAnyNotBlank(" ", "bar") = true - * StringUtils.isAnyNotBlank("foo", "bar") = true - * StringUtils.isAnyNotBlank(new String[] {}) = false - * - * - * @param css the CharSequences to check, may be null or empty - * @return {@code true} if any of the CharSequences are not empty and not null and not whitespace only - * @since
svn commit: r1786589 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java
Author: sebb Date: Sun Mar 12 14:53:35 2017 New Revision: 1786589 URL: http://svn.apache.org/viewvc?rev=1786589&view=rev Log: Notes on keep-alive Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=1786589&r1=1786588&r2=1786589&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Sun Mar 12 14:53:35 2017 @@ -276,7 +276,9 @@ import org.apache.commons.net.io.Util; * The implementation currently uses a {@link CopyStreamListener} which is passed to the * {@link Util#copyStream(InputStream, OutputStream, int, long, CopyStreamListener, boolean)} * method, so the timing is partially dependent on how long each block transfer takes. - * + * + * This keep-alive feature is optional; if it does not help or causes problems then don't use it. + * * @see #FTP_SYSTEM_TYPE * @see #SYSTEM_TYPE_PROPERTIES * @see FTP @@ -3735,6 +3737,8 @@ implements Configurable /** * Set the time to wait between sending control connection keepalive messages * when processing file upload or download. + * + * See the class Javadoc section "Control channel keep-alive feature:" * * @param controlIdle the wait (in secs) between keepalive messages. Zero (or less) disables. * @since 3.0 @@ -3745,7 +3749,11 @@ implements Configurable } /** - * Get the time to wait between sending control connection keepalive messages. + * Get the time to wait between sending control connection keepalive messages + * when processing file upload or download. + * + * See the class Javadoc section "Control channel keep-alive feature:" + * * @return the number of seconds between keepalive messages. * @since 3.0 */
svn commit: r1786588 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java
Author: sebb Date: Sun Mar 12 14:39:10 2017 New Revision: 1786588 URL: http://svn.apache.org/viewvc?rev=1786588&view=rev Log: COunt IOErrors for debug Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=1786588&r1=1786587&r2=1786588&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Sun Mar 12 14:39:10 2017 @@ -3763,6 +3763,7 @@ implements Configurable * successfully acked NOOPs at end of transfer * unanswered NOOPs at end of transfer * unanswered NOOPs after fetching additional replies + * Number of IOErrors ignored * * @return the debug array * @deprecated 3.7 For testing only; may be dropped or changed at any time @@ -3888,6 +3889,7 @@ implements Configurable private long time = System.currentTimeMillis(); private int notAcked; private int acksAcked; +private int ioErrors; CSL(FTPClient parent, long idleTime, int maxWait) throws SocketException { this.idle = idleTime; @@ -3912,6 +3914,7 @@ implements Configurable } catch (SocketTimeoutException e) { notAcked++; } catch (IOException e) { +ioErrors++; // Ignored } time = now; @@ -3934,7 +3937,7 @@ implements Configurable } finally { parent.setSoTimeout(currentSoTimeout); } -return new int [] {acksAcked, remain, notAcked}; // debug counts +return new int [] {acksAcked, remain, notAcked, ioErrors}; // debug counts } }
svn commit: r1786587 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/util/SubnetUtils.java
Author: sebb Date: Sun Mar 12 14:35:49 2017 New Revision: 1786587 URL: http://svn.apache.org/viewvc?rev=1786587&view=rev Log: NET-626 SubnetUtils#SubnetUtils - improved comment Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/util/SubnetUtils.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1786587&r1=1786586&r2=1786587&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Sun Mar 12 14:35:49 2017 @@ -71,6 +71,9 @@ This is mainly a bug-fix release. See fu However it is not source compatible with releases before 3.4, as some methods were added to the interface NtpV3Packet in 3.4 "> + +SubnetUtils#SubnetUtils - improved comment + SubnetUtils - improve construction Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/util/SubnetUtils.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/util/SubnetUtils.java?rev=1786587&r1=1786586&r2=1786587&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/util/SubnetUtils.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/util/SubnetUtils.java Sun Mar 12 14:35:49 2017 @@ -45,7 +45,7 @@ public class SubnetUtils { * Constructor that takes a CIDR-notation string, e.g. "192.168.0.1/16" * @param cidrNotation A CIDR-notation string, e.g. "192.168.0.1/16" * @throws IllegalArgumentException if the parameter is invalid, - * i.e. does not match n.n.n.n/m where n=1-3 decimal digits, m = 1-2 decimal digits in range 1-32 + * i.e. does not match n.n.n.n/m where n=1-3 decimal digits, m = 1-2 decimal digits in range 0-32 */ public SubnetUtils(String cidrNotation) { Matcher matcher = cidrPattern.matcher(cidrNotation);
[commons-text] Git Push Summary
Repository: commons-text Updated Branches: refs/heads/deprecated_classes_methods_move_to_commons_text [created] 94ca2ca01
[lang] ClassUtilsTest: some tests can simplified because lang does not support java versions without autoboxing anymore
Repository: commons-lang Updated Branches: refs/heads/master 5482ce61b -> 31a9fa0cc ClassUtilsTest: some tests can simplified because lang does not support java versions without autoboxing anymore Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/31a9fa0c Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/31a9fa0c Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/31a9fa0c Branch: refs/heads/master Commit: 31a9fa0cce769c976d74cdcb6e6ce8831793db7b Parents: 5482ce6 Author: pascalschumacher Authored: Sun Mar 12 13:44:03 2017 +0100 Committer: pascalschumacher Committed: Sun Mar 12 13:44:03 2017 +0100 -- .../apache/commons/lang3/ClassUtilsTest.java| 83 +--- 1 file changed, 38 insertions(+), 45 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/31a9fa0c/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java -- diff --git a/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java b/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java index b0a23cd..744aaa8 100644 --- a/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java @@ -16,7 +16,6 @@ */ package org.apache.commons.lang3; -import static org.apache.commons.lang3.JavaVersion.JAVA_1_5; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -385,13 +384,11 @@ public class ClassUtilsTest { assertTrue(ClassUtils.isAssignable(array1s, array1s)); assertTrue(ClassUtils.isAssignable(array1s, array1)); -final boolean autoboxing = SystemUtils.isJavaVersionAtLeast(JAVA_1_5); - -assertEquals(autoboxing, ClassUtils.isAssignable(arrayPrimitives, arrayWrappers)); -assertEquals(autoboxing, ClassUtils.isAssignable(arrayWrappers, arrayPrimitives)); +assertTrue(ClassUtils.isAssignable(arrayPrimitives, arrayWrappers)); +assertTrue(ClassUtils.isAssignable(arrayWrappers, arrayPrimitives)); assertFalse(ClassUtils.isAssignable(arrayPrimitives, array1)); assertFalse(ClassUtils.isAssignable(arrayWrappers, array1)); -assertEquals(autoboxing, ClassUtils.isAssignable(arrayPrimitives, array2)); +assertTrue(ClassUtils.isAssignable(arrayPrimitives, array2)); assertTrue(ClassUtils.isAssignable(arrayWrappers, array2)); } @@ -463,18 +460,16 @@ public class ClassUtilsTest { assertTrue(ClassUtils.isAssignable(String.class, String.class)); assertFalse(ClassUtils.isAssignable(Object.class, String.class)); -final boolean autoboxing = SystemUtils.isJavaVersionAtLeast(JAVA_1_5); - -assertEquals(autoboxing, ClassUtils.isAssignable(Integer.TYPE, Integer.class)); -assertEquals(autoboxing, ClassUtils.isAssignable(Integer.TYPE, Object.class)); -assertEquals(autoboxing, ClassUtils.isAssignable(Integer.class, Integer.TYPE)); -assertEquals(autoboxing, ClassUtils.isAssignable(Integer.class, Object.class)); +assertTrue(ClassUtils.isAssignable(Integer.TYPE, Integer.class)); +assertTrue(ClassUtils.isAssignable(Integer.TYPE, Object.class)); +assertTrue(ClassUtils.isAssignable(Integer.class, Integer.TYPE)); +assertTrue(ClassUtils.isAssignable(Integer.class, Object.class)); assertTrue(ClassUtils.isAssignable(Integer.TYPE, Integer.TYPE)); assertTrue(ClassUtils.isAssignable(Integer.class, Integer.class)); -assertEquals(autoboxing, ClassUtils.isAssignable(Boolean.TYPE, Boolean.class)); -assertEquals(autoboxing, ClassUtils.isAssignable(Boolean.TYPE, Object.class)); -assertEquals(autoboxing, ClassUtils.isAssignable(Boolean.class, Boolean.TYPE)); -assertEquals(autoboxing, ClassUtils.isAssignable(Boolean.class, Object.class)); +assertTrue(ClassUtils.isAssignable(Boolean.TYPE, Boolean.class)); +assertTrue(ClassUtils.isAssignable(Boolean.TYPE, Object.class)); +assertTrue(ClassUtils.isAssignable(Boolean.class, Boolean.TYPE)); +assertTrue(ClassUtils.isAssignable(Boolean.class, Object.class)); assertTrue(ClassUtils.isAssignable(Boolean.TYPE, Boolean.TYPE)); assertTrue(ClassUtils.isAssignable(Boolean.class, Boolean.class)); } @@ -612,46 +607,44 @@ public class ClassUtilsTest { @Test public void test_isAssignable_DefaultUnboxing_Widening() throws Exception { -final boolean autoboxing = SystemUtils.isJavaVersionAtLeast(JAVA_1_5); - // test byte conversions assertFalse("byte -> char", ClassUtils.isAssignable(Byte.class, Character.TYPE)); -
[lang] ClassUtilsTest#test_isAssignable_ClassArray_ClassArray: add explicit cast to avoid compiler warning and remove commented out code
Repository: commons-lang Updated Branches: refs/heads/master f0f896ee6 -> 5482ce61b ClassUtilsTest#test_isAssignable_ClassArray_ClassArray: add explicit cast to avoid compiler warning and remove commented out code Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/5482ce61 Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/5482ce61 Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/5482ce61 Branch: refs/heads/master Commit: 5482ce61b003726a9476c76a4337e043af4318c0 Parents: f0f896e Author: pascalschumacher Authored: Sun Mar 12 13:13:35 2017 +0100 Committer: pascalschumacher Committed: Sun Mar 12 13:13:35 2017 +0100 -- src/test/java/org/apache/commons/lang3/ClassUtilsTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/5482ce61/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java -- diff --git a/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java b/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java index d9c1e6f..b0a23cd 100644 --- a/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/ClassUtilsTest.java @@ -378,9 +378,8 @@ public class ClassUtilsTest { assertFalse(ClassUtils.isAssignable(null, array2)); assertTrue(ClassUtils.isAssignable(null, array0)); assertTrue(ClassUtils.isAssignable(array0, array0)); -//assertTrue(ClassUtils.isAssignable(array0, null)); assertTrue(ClassUtils.isAssignable(array0, (Class[]) null)); // explicit cast to avoid warning -assertTrue(ClassUtils.isAssignable((Class[]) null, null)); +assertTrue(ClassUtils.isAssignable((Class[]) null, (Class[]) null)); // explicit cast to avoid warning assertFalse(ClassUtils.isAssignable(array1, array1s)); assertTrue(ClassUtils.isAssignable(array1s, array1s));
[lang] AbstractExceptionContextTest#testJavaSerialization: remove unnecessary SuppressWarnings annotation
Repository: commons-lang Updated Branches: refs/heads/master 05bf337fc -> f0f896ee6 AbstractExceptionContextTest#testJavaSerialization: remove unnecessary SuppressWarnings annotation Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/f0f896ee Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/f0f896ee Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/f0f896ee Branch: refs/heads/master Commit: f0f896ee600ea7ff66c083747f370453b914be48 Parents: 05bf337 Author: pascalschumacher Authored: Sun Mar 12 13:10:34 2017 +0100 Committer: pascalschumacher Committed: Sun Mar 12 13:10:34 2017 +0100 -- .../commons/lang3/exception/AbstractExceptionContextTest.java| 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/f0f896ee/src/test/java/org/apache/commons/lang3/exception/AbstractExceptionContextTest.java -- diff --git a/src/test/java/org/apache/commons/lang3/exception/AbstractExceptionContextTest.java b/src/test/java/org/apache/commons/lang3/exception/AbstractExceptionContextTest.java index 462c4cc..e569ade 100644 --- a/src/test/java/org/apache/commons/lang3/exception/AbstractExceptionContextTest.java +++ b/src/test/java/org/apache/commons/lang3/exception/AbstractExceptionContextTest.java @@ -179,9 +179,9 @@ public abstract class AbstractExceptionContextTest
[lang] StringUtils#indexOfAny, #lastIndexOfAny: remove unused local variable
Repository: commons-lang Updated Branches: refs/heads/master ee19f8247 -> 05bf337fc StringUtils#indexOfAny, #lastIndexOfAny: remove unused local variable Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/05bf337f Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/05bf337f Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/05bf337f Branch: refs/heads/master Commit: 05bf337fc0095d2557368b481f332245f5754b03 Parents: ee19f82 Author: pascalschumacher Authored: Sun Mar 12 13:06:53 2017 +0100 Committer: pascalschumacher Committed: Sun Mar 12 13:06:53 2017 +0100 -- src/main/java/org/apache/commons/lang3/StringUtils.java | 2 -- 1 file changed, 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/05bf337f/src/main/java/org/apache/commons/lang3/StringUtils.java -- diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java index a92c4df..63caeac 100644 --- a/src/main/java/org/apache/commons/lang3/StringUtils.java +++ b/src/main/java/org/apache/commons/lang3/StringUtils.java @@ -2461,7 +2461,6 @@ public class StringUtils { if (str == null || searchStrs == null) { return INDEX_NOT_FOUND; } -final int sz = searchStrs.length; // String's can't have a MAX_VALUEth index. int ret = Integer.MAX_VALUE; @@ -2514,7 +2513,6 @@ public class StringUtils { if (str == null || searchStrs == null) { return INDEX_NOT_FOUND; } -final int sz = searchStrs.length; int ret = INDEX_NOT_FOUND; int tmp = 0; for (final CharSequence search : searchStrs) {
svn commit: r1786564 - /commons/proper/jexl/trunk/RELEASE-NOTES.txt
Author: henrib Date: Sun Mar 12 10:13:56 2017 New Revision: 1786564 URL: http://svn.apache.org/viewvc?rev=1786564&view=rev Log: JEXL: Reworded compatibility break warning Modified: commons/proper/jexl/trunk/RELEASE-NOTES.txt Modified: commons/proper/jexl/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/RELEASE-NOTES.txt?rev=1786564&r1=1786563&r2=1786564&view=diff == --- commons/proper/jexl/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/jexl/trunk/RELEASE-NOTES.txt Sun Mar 12 10:13:56 2017 @@ -27,11 +27,11 @@ Version 3.1 is a minor release. Warning: -This release does break compatibility by adding methods to interfaces; these interfaces are not expected to be -implemented by code external to the Jexl project and this compatibility break should remain hypothetical. -It is however possible and we are sorry if it causes problems to any of you. -To mitigate this issue, besides continue using JEXL 3.0, you are likely delegating to JEXL3 objects and you -shall be able to continue doing so with these new methods. The 3 interfaces & methods are: +This release does break source compatibility by adding methods to existing interfaces; these interfaces are however not +expected to be implemented by code external to the Jexl project. This compatibility break should remain hypothetical. +It is nevertheless possible and we are sorry if it causes problems to any of you. +If you encounter this issue, besides continuing using JEXL 3.0, your code likely delegates method calls to JEXL3 objects +and you shall be able to continue doing so with these new methods. The 3 interfaces & methods are: 1 - 'public java.lang.Boolean isCancellable()' in interface org.apache.commons.jexl3.JexlEngine$Options 2 - 'public java.util.concurrent.Callable callable(org.apache.commons.jexl3.JexlContext)'in interface org.apache.commons.jexl3.JexlExpression