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 d8cb9a6  Pull up AbandonedConfig and related methods from 
GenericKeyedObjectPool and GenericObjectPool to BaseGenericObjectPool (fix for 
CPD issues).       - BaseGenericObjectPool.getLogAbandoned()       - 
BaseGenericObjectPool.getRemoveAbandonedOnBorrow()       - 
BaseGenericObjectPool.getRemoveAbandonedOnMaintenance()       - 
BaseGenericObjectPool.getRemoveAbandonedTimeout()       - 
BaseGenericObjectPool.getRemoveAbandonedTimeoutDuration()       - 
BaseGenericObjectPool.isAbandon [...]
d8cb9a6 is described below

commit d8cb9a68a45edac20a6048862e4db67ca9380d16
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Jun 28 10:49:23 2021 -0400

    Pull up AbandonedConfig and related methods from GenericKeyedObjectPool
    and GenericObjectPool to BaseGenericObjectPool (fix for CPD issues).
          - BaseGenericObjectPool.getLogAbandoned()
          - BaseGenericObjectPool.getRemoveAbandonedOnBorrow()
          - BaseGenericObjectPool.getRemoveAbandonedOnMaintenance()
          - BaseGenericObjectPool.getRemoveAbandonedTimeout()
          - BaseGenericObjectPool.getRemoveAbandonedTimeoutDuration()
          - BaseGenericObjectPool.isAbandonedConfig()
          - BaseGenericObjectPool.setAbandonedConfig(AbandonedConfig)
---
 src/changes/changes.xml                            |  14 ++-
 .../commons/pool2/impl/BaseGenericObjectPool.java  | 118 +++++++++++++++++++--
 .../commons/pool2/impl/GenericKeyedObjectPool.java | 109 -------------------
 .../commons/pool2/impl/GenericObjectPool.java      | 102 +-----------------
 4 files changed, 124 insertions(+), 219 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 5e4335e..2c9575b 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -72,9 +72,19 @@ The <action> type attribute can be add,update,fix,remove.
     <action issue="POOL-395" dev="ggregory" type="add" due-to="Gary Gregory, 
Arash Nikoo">
       Improve exception thrown in GenericObjectPool.borrowObject when pool is 
exhausted. Added BaseGenericObjectPool.setMessagesStatistics(boolean).
     </action>
-    <action issue="POOL-395" dev="ggregory" type="add" due-to="Gary Gregory, 
Arash Nikoo">
+    <action dev="ggregory" type="add" due-to="Gary Gregory">
       Add and use AbandonedConfig.copy(AbandonedConfig) to fix CPD code 
duplication issues in GenericKeyedObjectPool and GenericObjectPool.
     </action>
+    <action dev="ggregory" type="add" due-to="Gary Gregory">
+      Pull up AbandonedConfig and related methods from GenericKeyedObjectPool 
and GenericObjectPool to BaseGenericObjectPool (fix for CPD issues).
+      - BaseGenericObjectPool.getLogAbandoned()
+      - BaseGenericObjectPool.getRemoveAbandonedOnBorrow()
+      - BaseGenericObjectPool.getRemoveAbandonedOnMaintenance()
+      - BaseGenericObjectPool.getRemoveAbandonedTimeout()
+      - BaseGenericObjectPool.getRemoveAbandonedTimeoutDuration()
+      - BaseGenericObjectPool.isAbandonedConfig()
+      - BaseGenericObjectPool.setAbandonedConfig(AbandonedConfig)
+    </action>
     <!-- FIXES -->
     <action dev="ggregory" type="fix" due-to="Gary Gregory">
       Fix "[WARNING] Old version of checkstyle detected. Consider updating to 
>= v8.30." Update Checktyle to 8.44.
@@ -222,7 +232,7 @@ The <action> type attribute can be add,update,fix,remove.
   </release>
   <release version="2.8.0" date="2019-12-05" description="This is a 
maintenance release (Java 8).">
     <action dev="ggregory" issue="POOL-374" type="fix" due-to="Gary Gregory, 
Phil Steitz">
-       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.
+       GenericKeyedObjectPool.returnObject(K, T) should throw 
IllegalStateException instead of NullPointerException when a key is not found 
in the pool map.
     </action>
     <action dev="ggregory" issue="POOL-375" type="update" due-to="Gary 
Gregory">
        Update optional library cglib from 3.2.12 to 3.3.0.
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 e743d21..0acb7c5 100644
--- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
@@ -328,6 +328,7 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
      */
     public static final int MEAN_TIMING_STATS_CACHE_SIZE = 100;
     private static final String EVICTION_POLICY_TYPE_NAME = 
EvictionPolicy.class.getName();
+    private static final Duration DEFAULT_REMOVE_ABANDONED_TIMEOUT = 
Duration.ofSeconds(Integer.MAX_VALUE);
     // Configuration attributes
     private volatile int maxTotal = 
GenericKeyedObjectPoolConfig.DEFAULT_MAX_TOTAL;
     private volatile boolean blockWhenExhausted = 
BaseObjectPoolConfig.DEFAULT_BLOCK_WHEN_EXHAUSTED;
@@ -352,6 +353,7 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
     final Object evictionLock = new Object();
     private Evictor evictor = null; // @GuardedBy("evictionLock")
     EvictionIterator evictionIterator = null; // @GuardedBy("evictionLock")
+
     /*
      * Class loader for evictor thread to use since, in a JavaEE or similar
      * environment, the context class loader for the evictor thread may not 
have
@@ -368,7 +370,7 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
     final AtomicLong destroyedCount = new AtomicLong();
     final AtomicLong destroyedByEvictorCount = new AtomicLong();
     final AtomicLong destroyedByBorrowValidationCount = new AtomicLong();
-    
+
     private final StatsStore activeTimes = new 
StatsStore(MEAN_TIMING_STATS_CACHE_SIZE);
     private final StatsStore idleTimes = new 
StatsStore(MEAN_TIMING_STATS_CACHE_SIZE);
     private final StatsStore waitTimes = new 
StatsStore(MEAN_TIMING_STATS_CACHE_SIZE);
@@ -378,6 +380,9 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
     private volatile SwallowedExceptionListener swallowedExceptionListener;
     private volatile boolean messageStatistics;
 
+    /** Additional configuration properties for abandoned object tracking. */
+    protected volatile AbandonedConfig abandonedConfig;
+
     /**
      * Handles JMX registration (if required) and the initialization required 
for
      * monitoring.
@@ -618,6 +623,20 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
     }
 
     /**
+     * Gets whether this pool identifies and logs any abandoned objects.
+     *
+     * @return {@code true} if abandoned object removal is configured for this
+     *         pool and removal events are to be logged otherwise {@code false}
+     *
+     * @see AbandonedConfig#getLogAbandoned()
+     * @since 2.11.0
+     */
+    public boolean getLogAbandoned() {
+        final AbandonedConfig ac = this.abandonedConfig;
+        return ac != null && ac.getLogAbandoned();
+    }
+
+    /**
      * Gets the maximum time a thread has waited to borrow objects from the 
pool.
      * @return maximum wait time in milliseconds since the pool was created
      */
@@ -713,7 +732,7 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
      * Statistics may not accurately reflect snapshot state at the time of the 
exception because we do not want to lock the pool when gathering this
      * information.
      * </p>
-     * 
+     *
      * @return whether to include statistics in exception messages.
      * @since 2.11.0
      */
@@ -782,6 +801,68 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
     }
 
     /**
+     * Gets whether a check is made for abandoned objects when an object is 
borrowed
+     * from this pool.
+     *
+     * @return {@code true} if abandoned object removal is configured to be
+     *         activated by borrowObject otherwise {@code false}
+     *
+     * @see AbandonedConfig#getRemoveAbandonedOnBorrow()
+     * @since 2.11.0
+     */
+    public boolean getRemoveAbandonedOnBorrow() {
+        final AbandonedConfig ac = this.abandonedConfig;
+        return ac != null && ac.getRemoveAbandonedOnBorrow();
+    }
+
+    /**
+     * Gets whether a check is made for abandoned objects when the evictor 
runs.
+     *
+     * @return {@code true} if abandoned object removal is configured to be
+     *         activated when the evictor runs otherwise {@code false}
+     *
+     * @see AbandonedConfig#getRemoveAbandonedOnMaintenance()
+     * @since 2.11.0
+     */
+    public boolean getRemoveAbandonedOnMaintenance() {
+        final AbandonedConfig ac = this.abandonedConfig;
+        return ac != null && ac.getRemoveAbandonedOnMaintenance();
+    }
+
+    /**
+     * Gets the timeout before which an object will be considered to be
+     * abandoned by this pool.
+     *
+     * @return The abandoned object timeout in seconds if abandoned object
+     *         removal is configured for this pool; Integer.MAX_VALUE 
otherwise.
+     *
+     * @see AbandonedConfig#getRemoveAbandonedTimeout()
+     * @see AbandonedConfig#getRemoveAbandonedTimeoutDuration()
+     * @deprecated Use {@link #getRemoveAbandonedTimeoutDuration()}.
+     * @since 2.11.0
+     */
+    @Deprecated
+    public int getRemoveAbandonedTimeout() {
+        final AbandonedConfig ac = this.abandonedConfig;
+        return ac != null ? ac.getRemoveAbandonedTimeout() : Integer.MAX_VALUE;
+    }
+
+    /**
+     * Gets the timeout before which an object will be considered to be
+     * abandoned by this pool.
+     *
+     * @return The abandoned object timeout in seconds if abandoned object
+     *         removal is configured for this pool; Integer.MAX_VALUE 
otherwise.
+     *
+     * @see AbandonedConfig#getRemoveAbandonedTimeoutDuration()
+     * @since 2.11.0
+     */
+    public Duration getRemoveAbandonedTimeoutDuration() {
+        final AbandonedConfig ac = this.abandonedConfig;
+        return ac != null ? ac.getRemoveAbandonedTimeoutDuration() : 
DEFAULT_REMOVE_ABANDONED_TIMEOUT;
+    }
+
+    /**
      * The total number of objects returned to this pool over the lifetime of
      * the pool. This excludes attempts to return the same object multiple
      * times.
@@ -975,6 +1056,19 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
     }
 
     /**
+     * Gets whether or not abandoned object removal is configured for this 
pool.
+     *
+     * @return true if this pool is configured to detect and remove
+     * abandoned objects
+     * @since 2.11.0
+     */
+    public boolean isAbandonedConfig() {
+        return abandonedConfig != null;
+    }
+
+    // Monitoring (primarily JMX) related methods
+
+    /**
      * Has this pool instance been closed.
      * @return {@code true} when this pool has been closed.
      */
@@ -1067,6 +1161,18 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
     }
 
     /**
+     * Sets the abandoned object removal configuration.
+     *
+     * @param abandonedConfig the new configuration to use. This is used by 
value.
+     *
+     * @see AbandonedConfig
+     * @since 2.11.0
+     */
+    public void setAbandonedConfig(final AbandonedConfig abandonedConfig) {
+        this.abandonedConfig = AbandonedConfig.copy(abandonedConfig);
+    }
+
+    /**
      * Sets whether to block when the {@code borrowObject()} method is
      * invoked when the pool is exhausted (the maximum number of "active"
      * objects has been reached).
@@ -1109,8 +1215,6 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
         setEvictorShutdownTimeout(config.getEvictorShutdownTimeout());
     }
 
-    // Monitoring (primarily JMX) related methods
-
     /**
      * Sets the eviction policy for this pool.
      *
@@ -1292,7 +1396,7 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
      * @param messagesDetails whether to include statistics in exception 
messages.
      * @since 2.11.0
      */
-    public void setMessagesStatistics(boolean messagesDetails) {
+    public void setMessagesStatistics(final boolean messagesDetails) {
         this.messageStatistics = messagesDetails;
     }
 
@@ -1398,6 +1502,8 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
         
setSoftMinEvictableIdleTime(Duration.ofMillis(softMinEvictableIdleTimeMillis));
     }
 
+    // Inner classes
+
     /**
      * The listener used (if any) to receive notifications of exceptions
      * unavoidably swallowed by the pool.
@@ -1520,8 +1626,6 @@ public abstract class BaseGenericObjectPool<T> extends 
BaseObject {
         
setTimeBetweenEvictionRuns(Duration.ofMillis(timeBetweenEvictionRunsMillis));
     }
 
-    // Inner classes
-
     /**
      * <p>Starts the evictor with the given delay. If there is an evictor
      * running when this method is called, it is stopped and replaced with a
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 7d68cac..a6b8a84 100644
--- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
@@ -186,8 +186,6 @@ public class GenericKeyedObjectPool<K, T> extends 
BaseGenericObjectPool<T>
 
     }
 
-    private static final Duration DEFAULT_REMOVE_ABANDONED_TIMEOUT = 
Duration.ofSeconds(Integer.MAX_VALUE);
-
     // JMX specific attributes
     private static final String ONAME_BASE =
             "org.apache.commons.pool2:type=GenericKeyedObjectPool,name=";
@@ -238,9 +236,6 @@ public class GenericKeyedObjectPool<K, T> extends 
BaseGenericObjectPool<T>
 
     private K evictionKey = null; // @GuardedBy("evictionLock")
 
-    // Additional configuration properties for abandoned object tracking
-    private volatile AbandonedConfig abandonedConfig;
-
     /**
      * Constructs a new {@code GenericKeyedObjectPool} using defaults from
      * {@link GenericKeyedObjectPoolConfig}.
@@ -1101,21 +1096,6 @@ public class GenericKeyedObjectPool<K, T> extends 
BaseGenericObjectPool<T>
     }
 
     /**
-     * Gets whether this pool identifies and logs any abandoned objects.
-     *
-     * @return {@code true} if abandoned object removal is configured for this
-     *         pool and removal events are to be logged otherwise {@code false}
-     *
-     * @see AbandonedConfig#getLogAbandoned()
-     * @since 2.10.0
-     */
-    @Override
-    public boolean getLogAbandoned() {
-        final AbandonedConfig ac = this.abandonedConfig;
-        return ac != null && ac.getLogAbandoned();
-    }
-
-    /**
      * Gets the cap on the number of "idle" instances per key in the pool.
      * If maxIdlePerKey is set too low on heavily loaded systems it is possible
      * you will see objects being destroyed and almost immediately new objects
@@ -1282,71 +1262,6 @@ public class GenericKeyedObjectPool<K, T> extends 
BaseGenericObjectPool<T>
     }
 
     /**
-     * Gets whether a check is made for abandoned objects when an object is 
borrowed
-     * from this pool.
-     *
-     * @return {@code true} if abandoned object removal is configured to be
-     *         activated by borrowObject otherwise {@code false}
-     *
-     * @see AbandonedConfig#getRemoveAbandonedOnBorrow()
-     * @since 2.10.0
-     */
-    @Override
-    public boolean getRemoveAbandonedOnBorrow() {
-        final AbandonedConfig ac = this.abandonedConfig;
-        return ac != null && ac.getRemoveAbandonedOnBorrow();
-    }
-
-    /**
-     * Gets whether a check is made for abandoned objects when the evictor 
runs.
-     *
-     * @return {@code true} if abandoned object removal is configured to be
-     *         activated when the evictor runs otherwise {@code false}
-     *
-     * @see AbandonedConfig#getRemoveAbandonedOnMaintenance()
-     * @since 2.10.0
-     */
-    @Override
-    public boolean getRemoveAbandonedOnMaintenance() {
-        final AbandonedConfig ac = this.abandonedConfig;
-        return ac != null && ac.getRemoveAbandonedOnMaintenance();
-    }
-
-    /**
-     * Gets the timeout before which an object will be considered to be
-     * abandoned by this pool.
-     *
-     * @return The abandoned object timeout in seconds if abandoned object
-     *         removal is configured for this pool; Integer.MAX_VALUE 
otherwise.
-     *
-     * @see AbandonedConfig#getRemoveAbandonedTimeout()
-     * @see AbandonedConfig#getRemoveAbandonedTimeoutDuration()
-     * @deprecated Use {@link #getRemoveAbandonedTimeoutDuration()}.
-     * @since 2.10.0
-     */
-    @Override
-    @Deprecated
-    public int getRemoveAbandonedTimeout() {
-        final AbandonedConfig ac = this.abandonedConfig;
-        return ac != null ? ac.getRemoveAbandonedTimeout() : Integer.MAX_VALUE;
-    }
-
-    /**
-     * Gets the timeout before which an object will be considered to be
-     * abandoned by this pool.
-     *
-     * @return The abandoned object timeout in seconds if abandoned object
-     *         removal is configured for this pool; Integer.MAX_VALUE 
otherwise.
-     *
-     * @see AbandonedConfig#getRemoveAbandonedTimeoutDuration()
-     * @since 2.10.0
-     */
-    public Duration getRemoveAbandonedTimeoutDuration() {
-        final AbandonedConfig ac = this.abandonedConfig;
-        return ac != null ? ac.getRemoveAbandonedTimeoutDuration() : 
DEFAULT_REMOVE_ABANDONED_TIMEOUT;
-    }
-
-    /**
      * Checks to see if there are any threads currently waiting to borrow
      * objects but are blocked waiting for more objects to become available.
      *
@@ -1421,18 +1336,6 @@ public class GenericKeyedObjectPool<K, T> extends 
BaseGenericObjectPool<T>
     }
 
     /**
-     * Gets whether or not abandoned object removal is configured for this 
pool.
-     *
-     * @return true if this pool is configured to detect and remove
-     * abandoned objects
-     * @since 2.10.0
-     */
-    @Override
-    public boolean isAbandonedConfig() {
-        return abandonedConfig != null;
-    }
-
-    /**
      * Provides information on all the objects in the pool, both idle (waiting
      * to be borrowed) and active (currently borrowed).
      * <p>
@@ -1723,18 +1626,6 @@ public class GenericKeyedObjectPool<K, T> extends 
BaseGenericObjectPool<T>
     }
 
     /**
-     * Sets the abandoned object removal configuration.
-     *
-     * @param abandonedConfig the new configuration to use. This is used by 
value.
-     *
-     * @see AbandonedConfig
-     * @since 2.10.0
-     */
-    public void setAbandonedConfig(final AbandonedConfig abandonedConfig) {
-        this.abandonedConfig = AbandonedConfig.copy(abandonedConfig);
-    }
-
-    /**
      * Sets the configuration.
      *
      * @param conf the new configuration to use. This is used by value.
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 7ab55c2..0014460 100644
--- a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPool.java
@@ -84,8 +84,6 @@ import org.apache.commons.pool2.UsageTracking;
 public class GenericObjectPool<T> extends BaseGenericObjectPool<T>
         implements ObjectPool<T>, GenericObjectPoolMXBean, UsageTracking<T> {
 
-    private static final Duration DEFAULT_REMOVE_ABANDONED_TIMEOUT = 
Duration.ofSeconds(Integer.MAX_VALUE);
-
     // JMX specific attributes
     private static final String ONAME_BASE =
         "org.apache.commons.pool2:type=GenericObjectPool,name=";
@@ -123,9 +121,6 @@ public class GenericObjectPool<T> extends 
BaseGenericObjectPool<T>
 
     private final LinkedBlockingDeque<PooledObject<T>> idleObjects;
 
-    // Additional configuration properties for abandoned object tracking
-    private volatile AbandonedConfig abandonedConfig;
-
     /**
      * Creates a new {@code GenericObjectPool} using defaults from
      * {@link GenericObjectPoolConfig}.
@@ -816,20 +811,6 @@ public class GenericObjectPool<T> extends 
BaseGenericObjectPool<T>
     }
 
     /**
-     * Gets whether this pool identifies and logs any abandoned objects.
-     *
-     * @return {@code true} if abandoned object removal is configured for this
-     *         pool and removal events are to be logged otherwise {@code false}
-     *
-     * @see AbandonedConfig#getLogAbandoned()
-     */
-    @Override
-    public boolean getLogAbandoned() {
-        final AbandonedConfig ac = this.abandonedConfig;
-        return ac != null && ac.getLogAbandoned();
-    }
-
-    /**
      * Gets the cap on the number of "idle" instances in the pool. If maxIdle
      * is set too low on heavily loaded systems it is possible you will see
      * objects being destroyed and almost immediately new objects being 
created.
@@ -915,74 +896,14 @@ public class GenericObjectPool<T> extends 
BaseGenericObjectPool<T>
         return 0;
     }
 
-    /**
-     * Gets whether a check is made for abandoned objects when an object is 
borrowed
-     * from this pool.
-     *
-     * @return {@code true} if abandoned object removal is configured to be
-     *         activated by borrowObject otherwise {@code false}
-     *
-     * @see AbandonedConfig#getRemoveAbandonedOnBorrow()
-     */
-    @Override
-    public boolean getRemoveAbandonedOnBorrow() {
-        final AbandonedConfig ac = this.abandonedConfig;
-        return ac != null && ac.getRemoveAbandonedOnBorrow();
-    }
-
-
     //--- Usage tracking support 
-----------------------------------------------
 
-    /**
-     * Gets whether a check is made for abandoned objects when the evictor 
runs.
-     *
-     * @return {@code true} if abandoned object removal is configured to be
-     *         activated when the evictor runs otherwise {@code false}
-     *
-     * @see AbandonedConfig#getRemoveAbandonedOnMaintenance()
-     */
-    @Override
-    public boolean getRemoveAbandonedOnMaintenance() {
-        final AbandonedConfig ac = this.abandonedConfig;
-        return ac != null && ac.getRemoveAbandonedOnMaintenance();
-    }
+    
 
 
     //--- JMX support 
----------------------------------------------------------
 
     /**
-     * Gets the timeout before which an object will be considered to be
-     * abandoned by this pool.
-     *
-     * @return The abandoned object timeout in seconds if abandoned object
-     *         removal is configured for this pool; Integer.MAX_VALUE 
otherwise.
-     *
-     * @see AbandonedConfig#getRemoveAbandonedTimeout()
-     * @see AbandonedConfig#getRemoveAbandonedTimeoutDuration()
-     * @deprecated Use {@link #getRemoveAbandonedTimeoutDuration()}.
-     */
-    @Override
-    @Deprecated
-    public int getRemoveAbandonedTimeout() {
-        final AbandonedConfig ac = this.abandonedConfig;
-        return ac != null ? ac.getRemoveAbandonedTimeout() : Integer.MAX_VALUE;
-    }
-
-    /**
-     * Gets the timeout before which an object will be considered to be
-     * abandoned by this pool.
-     *
-     * @return The abandoned object timeout in seconds if abandoned object
-     *         removal is configured for this pool; Integer.MAX_VALUE 
otherwise.
-     *
-     * @see AbandonedConfig#getRemoveAbandonedTimeoutDuration()
-     */
-    public Duration getRemoveAbandonedTimeoutDuration() {
-        final AbandonedConfig ac = this.abandonedConfig;
-        return ac != null ? ac.getRemoveAbandonedTimeoutDuration() : 
DEFAULT_REMOVE_ABANDONED_TIMEOUT;
-    }
-
-    /**
      * {@inheritDoc}
      * <p>
      * Activation of this method decrements the active count and attempts to
@@ -1029,16 +950,6 @@ public class GenericObjectPool<T> extends 
BaseGenericObjectPool<T>
     }
 
     /**
-     * Gets whether or not abandoned object removal is configured for this 
pool.
-     *
-     * @return true if this pool is configured to detect and remove
-     * abandoned objects
-     */
-    @Override
-    public boolean isAbandonedConfig() {
-        return abandonedConfig != null;
-    }
-    /**
      * Provides information on all the objects in the pool, both idle (waiting
      * to be borrowed) and active (currently borrowed).
      * <p>
@@ -1211,17 +1122,6 @@ public class GenericObjectPool<T> extends 
BaseGenericObjectPool<T>
     }
 
     /**
-     * Sets the abandoned object removal configuration.
-     *
-     * @param abandonedConfig the new configuration to use. This is used by 
value.
-     *
-     * @see AbandonedConfig
-     */
-    public void setAbandonedConfig(final AbandonedConfig abandonedConfig) {
-        this.abandonedConfig = AbandonedConfig.copy(abandonedConfig);
-    }
-
-    /**
      * Sets the base pool configuration.
      *
      * @param conf the new configuration to use. This is used by value.

Reply via email to