This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-pool.git
The following commit(s) were added to refs/heads/master by this push:
new cb38a1b [POOL-374]
org.apache.commons.pool2.impl.GenericKeyedObjectPool.returnObject(K, T) should
throw IllegalStateException instead of NullPointerException when a key is not
found in the pool map.
cb38a1b is described below
commit cb38a1b69384a3811d50d9eb0145683227fe8d51
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Aug 26 19:02:31 2019 -0400
[POOL-374]
org.apache.commons.pool2.impl.GenericKeyedObjectPool.returnObject(K, T)
should throw IllegalStateException instead of NullPointerException when
a key is not found in the pool map.
Better message.
---
src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 3a5654e..927a91a 100644
--- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
@@ -454,7 +454,7 @@ public class GenericKeyedObjectPool<K, T> extends
BaseGenericObjectPool<T>
if (objectDeque == null) {
throw new IllegalStateException(
- "Returned object not currently part of this pool");
+ "No keyed pool found under the given key.");
}
final PooledObject<T> p = objectDeque.getAllObjects().get(new
IdentityWrapper<>(obj));