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
commit 663365186c18a85c1c0876387c06640c1a6a572d Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Fri Oct 7 17:38:56 2022 -0400 Javadoc and better exception --- .../commons/pool2/BaseKeyedPooledObjectFactory.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/apache/commons/pool2/BaseKeyedPooledObjectFactory.java b/src/main/java/org/apache/commons/pool2/BaseKeyedPooledObjectFactory.java index a1762c89..369550b1 100644 --- a/src/main/java/org/apache/commons/pool2/BaseKeyedPooledObjectFactory.java +++ b/src/main/java/org/apache/commons/pool2/BaseKeyedPooledObjectFactory.java @@ -36,7 +36,7 @@ package org.apache.commons.pool2; public abstract class BaseKeyedPooledObjectFactory<K, V, E extends Exception> extends BaseObject implements KeyedPooledObjectFactory<K, V, E> { /** - * Reinitialize an instance to be returned by the pool. + * Reinitializes an instance to be returned by the pool. * <p> * The default implementation is a no-op. * </p> @@ -50,7 +50,7 @@ public abstract class BaseKeyedPooledObjectFactory<K, V, E extends Exception> ex } /** - * Create an instance that can be served by the pool. + * Creates an instance that can be served by the pool. * * @param key the key used when constructing the object * @return an instance that can be served by the pool @@ -61,7 +61,7 @@ public abstract class BaseKeyedPooledObjectFactory<K, V, E extends Exception> ex public abstract V create(K key) throws E; /** - * Destroy an instance no longer needed by the pool. + * Destroys an instance no longer needed by the pool. * <p> * The default implementation is a no-op. * </p> @@ -80,7 +80,7 @@ public abstract class BaseKeyedPooledObjectFactory<K, V, E extends Exception> ex } /** - * Uninitialize an instance to be returned to the idle object pool. + * Uninitializes an instance to be returned to the idle object pool. * <p> * The default implementation is a no-op. * </p> @@ -101,7 +101,7 @@ public abstract class BaseKeyedPooledObjectFactory<K, V, E extends Exception> ex * * @param key the key used when selecting the object * @param p a {@code PooledObject} wrapping the instance to be validated - * @return always {@code true} in the default implementation + * @return always {@code true} in this default implementation */ @Override public boolean validateObject(final K key, final PooledObject<V> p) { @@ -109,12 +109,13 @@ public abstract class BaseKeyedPooledObjectFactory<K, V, E extends Exception> ex } /** - * Wrap the provided instance with an implementation of + * Wraps the provided instance with an implementation of * {@link PooledObject}. * * @param value the instance to wrap - * * @return The provided instance, wrapped by a {@link PooledObject} + * @throws E if there is a problem wrapping an instance, + * this will be propagated to the code requesting an object. */ - public abstract PooledObject<V> wrap(V value); + public abstract PooledObject<V> wrap(V value) throws E; }