This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch POOL_2_X in repository https://gitbox.apache.org/repos/asf/commons-pool.git
The following commit(s) were added to refs/heads/POOL_2_X by this push: new 687a437b Remove extra blank lines 687a437b is described below commit 687a437b511f1b07de94ac22ac558d465f81c7b2 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun Nov 26 14:11:16 2023 -0500 Remove extra blank lines --- .../org/apache/commons/pool2/impl/BaseGenericObjectPool.java | 1 - .../java/org/apache/commons/pool2/impl/DefaultPooledObject.java | 1 - .../org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java | 1 - src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java | 2 -- .../org/apache/commons/pool2/impl/GenericKeyedObjectPool.java | 6 ------ .../apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java | 1 - .../org/apache/commons/pool2/impl/GenericObjectPoolConfig.java | 3 --- .../java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java | 1 - .../org/apache/commons/pool2/impl/SoftReferenceObjectPool.java | 1 - .../java/org/apache/commons/pool2/proxy/BaseProxyHandler.java | 6 ------ .../java/org/apache/commons/pool2/proxy/CglibProxyHandler.java | 1 - .../java/org/apache/commons/pool2/proxy/CglibProxySource.java | 1 - .../java/org/apache/commons/pool2/proxy/JdkProxyHandler.java | 1 - .../org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java | 2 -- .../java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java | 8 -------- .../java/org/apache/commons/pool2/AbstractTestObjectPool.java | 3 --- src/test/java/org/apache/commons/pool2/PoolTest.java | 1 - .../java/org/apache/commons/pool2/impl/AtomicIntegerFactory.java | 5 ----- .../java/org/apache/commons/pool2/impl/TestEvictionTimer.java | 1 - .../apache/commons/pool2/impl/TestGenericKeyedObjectPool.java | 9 --------- .../org/apache/commons/pool2/impl/TestGenericObjectPool.java | 4 ---- .../org/apache/commons/pool2/impl/TestPooledSoftReference.java | 2 -- .../org/apache/commons/pool2/impl/TestSoftRefOutOfMemory.java | 1 - .../apache/commons/pool2/impl/TestSoftReferenceObjectPool.java | 1 - .../java/org/apache/commons/pool2/pool407/KeyedPool407Test.java | 1 - .../commons/pool2/proxy/AbstractTestProxiedKeyedObjectPool.java | 9 --------- .../commons/pool2/proxy/AbstractTestProxiedObjectPool.java | 9 --------- 27 files changed, 82 deletions(-) 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 7192b033..99660ac2 100644 --- a/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java @@ -2077,5 +2077,4 @@ public abstract class BaseGenericObjectPool<T> extends BaseObject implements Aut activeTimes.add(activeTime); } - } diff --git a/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObject.java b/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObject.java index 93ae2be4..c809e6c6 100644 --- a/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObject.java +++ b/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObject.java @@ -339,5 +339,4 @@ public class DefaultPooledObject<T> implements PooledObject<T> { usedBy.fillInStackTrace(); } - } \ No newline at end of file diff --git a/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java b/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java index 9caf1399..b6e216c7 100644 --- a/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java +++ b/src/main/java/org/apache/commons/pool2/impl/DefaultPooledObjectInfo.java @@ -65,7 +65,6 @@ public class DefaultPooledObjectInfo implements DefaultPooledObjectInfoMBean { return pooledObject.getLastBorrowInstant().toEpochMilli(); } - @Override public String getLastBorrowTimeFormatted() { return getTimeMillisFormatted(getLastBorrowTime()); 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 da432764..20170b36 100644 --- a/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java +++ b/src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java @@ -27,7 +27,6 @@ import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; - /** * Provides a shared idle object eviction timer for all pools. * <p> @@ -120,7 +119,6 @@ final class EvictionTimer { } } - /** Executor instance */ private static ScheduledThreadPoolExecutor executor; //@GuardedBy("EvictionTimer.class") 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 daae216f..031352a6 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java @@ -200,7 +200,6 @@ public class GenericKeyedObjectPool<K, T> extends BaseGenericObjectPool<T> private volatile int minIdlePerKey = GenericKeyedObjectPoolConfig.DEFAULT_MIN_IDLE_PER_KEY; - private volatile int maxTotalPerKey = GenericKeyedObjectPoolConfig.DEFAULT_MAX_TOTAL_PER_KEY; @@ -236,7 +235,6 @@ public class GenericKeyedObjectPool<K, T> extends BaseGenericObjectPool<T> private Iterator<K> evictionKeyIterator; // @GuardedBy("evictionLock") - private K evictionKey; // @GuardedBy("evictionLock") /** @@ -676,7 +674,6 @@ public class GenericKeyedObjectPool<K, T> extends BaseGenericObjectPool<T> } } - /** * Closes the keyed object pool. Once the pool is closed, * {@link #borrowObject(Object)} will fail with IllegalStateException, but @@ -716,7 +713,6 @@ public class GenericKeyedObjectPool<K, T> extends BaseGenericObjectPool<T> } } - /** * Creates a new pooled object or null. * @@ -914,7 +910,6 @@ public class GenericKeyedObjectPool<K, T> extends BaseGenericObjectPool<T> } } - @Override void ensureMinIdle() throws Exception { final int minIdlePerKeySave = getMinIdlePerKey(); @@ -1115,7 +1110,6 @@ public class GenericKeyedObjectPool<K, T> extends BaseGenericObjectPool<T> } } - /** * Gets a reference to the factory used to create, destroy and validate * the objects used by this pool. diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java index 72c66e7a..b58ff804 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPoolConfig.java @@ -54,7 +54,6 @@ public class GenericKeyedObjectPoolConfig<T> extends BaseObjectPoolConfig<T> { */ public static final int DEFAULT_MAX_IDLE_PER_KEY = 8; - private int minIdlePerKey = DEFAULT_MIN_IDLE_PER_KEY; private int maxIdlePerKey = DEFAULT_MAX_IDLE_PER_KEY; diff --git a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java index e496c544..529611af 100644 --- a/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java +++ b/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java @@ -48,7 +48,6 @@ public class GenericObjectPoolConfig<T> extends BaseObjectPoolConfig<T> { */ public static final int DEFAULT_MIN_IDLE = 0; - private int maxTotal = DEFAULT_MAX_TOTAL; private int maxIdle = DEFAULT_MAX_IDLE; @@ -78,7 +77,6 @@ public class GenericObjectPoolConfig<T> extends BaseObjectPoolConfig<T> { return maxIdle; } - /** * Gets the value for the {@code maxTotal} configuration attribute * for pools created with this configuration instance. @@ -105,7 +103,6 @@ public class GenericObjectPoolConfig<T> extends BaseObjectPoolConfig<T> { return minIdle; } - /** * Sets the value for the {@code maxIdle} configuration attribute for * pools created with this configuration instance. 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 56425c5d..d52ec573 100644 --- a/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java +++ b/src/main/java/org/apache/commons/pool2/impl/LinkedBlockingDeque.java @@ -327,7 +327,6 @@ final class LinkedBlockingDeque<E> extends AbstractQueue<E> this(Integer.MAX_VALUE, fairness); } - // Basic linking and unlinking operations, called only while holding lock /** 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 621da745..52cca5ca 100644 --- a/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java @@ -58,7 +58,6 @@ public class SoftReferenceObjectPool<T> extends BaseObjectPool<T> { /** Total number of instances that have been destroyed */ private long destroyCount; // @GuardedBy("this") - /** Total number of instances that have been created */ private long createCount; // @GuardedBy("this") diff --git a/src/main/java/org/apache/commons/pool2/proxy/BaseProxyHandler.java b/src/main/java/org/apache/commons/pool2/proxy/BaseProxyHandler.java index c22798df..8a1d3573 100644 --- a/src/main/java/org/apache/commons/pool2/proxy/BaseProxyHandler.java +++ b/src/main/java/org/apache/commons/pool2/proxy/BaseProxyHandler.java @@ -33,7 +33,6 @@ class BaseProxyHandler<T> { private volatile T pooledObject; private final UsageTracking<T> usageTracking; - /** * Constructs a new wrapper for the given pooled object. * @@ -47,7 +46,6 @@ class BaseProxyHandler<T> { this.usageTracking = usageTracking; } - /** * Disable the proxy wrapper. Called when the object has been returned to * the pool. Further use of the wrapper should result in an @@ -61,7 +59,6 @@ class BaseProxyHandler<T> { return result; } - /** * Invoke the given method on the wrapped object. * @@ -79,7 +76,6 @@ class BaseProxyHandler<T> { return method.invoke(object, args); } - /** * Gets the wrapped, pooled object. * @@ -89,7 +85,6 @@ class BaseProxyHandler<T> { return pooledObject; } - /** * @since 2.4.3 */ @@ -105,7 +100,6 @@ class BaseProxyHandler<T> { return builder.toString(); } - /** * Check that the proxy is still valid (i.e. that {@link #disableProxy()} * has not been called). diff --git a/src/main/java/org/apache/commons/pool2/proxy/CglibProxyHandler.java b/src/main/java/org/apache/commons/pool2/proxy/CglibProxyHandler.java index 4a3d856f..fcea73f7 100644 --- a/src/main/java/org/apache/commons/pool2/proxy/CglibProxyHandler.java +++ b/src/main/java/org/apache/commons/pool2/proxy/CglibProxyHandler.java @@ -33,7 +33,6 @@ import net.sf.cglib.proxy.MethodProxy; final class CglibProxyHandler<T> extends BaseProxyHandler<T> implements MethodInterceptor { - /** * Constructs a CGLib proxy instance. * diff --git a/src/main/java/org/apache/commons/pool2/proxy/CglibProxySource.java b/src/main/java/org/apache/commons/pool2/proxy/CglibProxySource.java index 56613d99..1a324292 100644 --- a/src/main/java/org/apache/commons/pool2/proxy/CglibProxySource.java +++ b/src/main/java/org/apache/commons/pool2/proxy/CglibProxySource.java @@ -54,7 +54,6 @@ public class CglibProxySource<T> implements ProxySource<T> { return (T) enhancer.create(); } - @Override public T resolveProxy(final T proxy) { @SuppressWarnings("unchecked") diff --git a/src/main/java/org/apache/commons/pool2/proxy/JdkProxyHandler.java b/src/main/java/org/apache/commons/pool2/proxy/JdkProxyHandler.java index 1bf7176e..61e3d2b7 100644 --- a/src/main/java/org/apache/commons/pool2/proxy/JdkProxyHandler.java +++ b/src/main/java/org/apache/commons/pool2/proxy/JdkProxyHandler.java @@ -43,7 +43,6 @@ final class JdkProxyHandler<T> extends BaseProxyHandler<T> super(pooledObject, usageTracking); } - @Override public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { 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 0259429e..cc30630b 100644 --- a/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/proxy/ProxiedKeyedObjectPool.java @@ -37,7 +37,6 @@ public class ProxiedKeyedObjectPool<K, V> implements KeyedObjectPool<K, V> { private final KeyedObjectPool<K, V> pool; private final ProxySource<V> proxySource; - /** * Constructs a new proxied object pool. * @@ -50,7 +49,6 @@ public class ProxiedKeyedObjectPool<K, V> implements KeyedObjectPool<K, V> { this.proxySource = proxySource; } - @Override public void addObject(final K key) throws Exception { pool.addObject(key); 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 6400ea3c..00d5e80c 100644 --- a/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java +++ b/src/main/java/org/apache/commons/pool2/proxy/ProxiedObjectPool.java @@ -34,7 +34,6 @@ public class ProxiedObjectPool<T> implements ObjectPool<T> { private final ObjectPool<T> pool; private final ProxySource<T> proxySource; - /** * Constructs a new proxied object pool. * @@ -51,7 +50,6 @@ public class ProxiedObjectPool<T> implements ObjectPool<T> { pool.addObject(); } - @SuppressWarnings("unchecked") @Override public T borrowObject() throws Exception { @@ -62,37 +60,31 @@ public class ProxiedObjectPool<T> implements ObjectPool<T> { return proxySource.createProxy(pool.borrowObject(), usageTracking); } - @Override public void clear() throws Exception { pool.clear(); } - @Override public void close() { pool.close(); } - @Override public int getNumActive() { return pool.getNumActive(); } - @Override public int getNumIdle() { return pool.getNumIdle(); } - @Override public void invalidateObject(final T proxy) throws Exception { pool.invalidateObject(proxySource.resolveProxy(proxy)); } - @Override public void returnObject(final T proxy) throws Exception { pool.returnObject(proxySource.resolveProxy(proxy)); diff --git a/src/test/java/org/apache/commons/pool2/AbstractTestObjectPool.java b/src/test/java/org/apache/commons/pool2/AbstractTestObjectPool.java index ad310bb8..165a6cce 100644 --- a/src/test/java/org/apache/commons/pool2/AbstractTestObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/AbstractTestObjectPool.java @@ -16,7 +16,6 @@ */ package org.apache.commons.pool2; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -198,7 +197,6 @@ public abstract class AbstractTestObjectPool { expectedMethods.add(new MethodCall("makeObject")); assertEquals(expectedMethods, factory.getMethodCalls()); - // when activateObject fails in borrowObject, a new object should be borrowed/created reset(pool, factory, expectedMethods); pool.addObject(); @@ -273,7 +271,6 @@ public abstract class AbstractTestObjectPool { pool.addObjects(5); pool.close(); - // Test exception handling close should swallow failures try { pool = makeEmptyPool(factory); diff --git a/src/test/java/org/apache/commons/pool2/PoolTest.java b/src/test/java/org/apache/commons/pool2/PoolTest.java index cfa0fe09..ba978015 100644 --- a/src/test/java/org/apache/commons/pool2/PoolTest.java +++ b/src/test/java/org/apache/commons/pool2/PoolTest.java @@ -17,7 +17,6 @@ package org.apache.commons.pool2; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/src/test/java/org/apache/commons/pool2/impl/AtomicIntegerFactory.java b/src/test/java/org/apache/commons/pool2/impl/AtomicIntegerFactory.java index 6b1068c8..92748845 100644 --- a/src/test/java/org/apache/commons/pool2/impl/AtomicIntegerFactory.java +++ b/src/test/java/org/apache/commons/pool2/impl/AtomicIntegerFactory.java @@ -74,7 +74,6 @@ public class AtomicIntegerFactory this.createLatency = createLatency; } - /** * @param destroyLatency the destroyLatency to set */ @@ -82,7 +81,6 @@ public class AtomicIntegerFactory this.destroyLatency = destroyLatency; } - /** * @param passivateLatency the passivateLatency to set */ @@ -90,7 +88,6 @@ public class AtomicIntegerFactory this.passivateLatency = passivateLatency; } - /** * @param validateLatency the validateLatency to set */ @@ -98,14 +95,12 @@ public class AtomicIntegerFactory this.validateLatency = validateLatency; } - @Override public boolean validateObject(final PooledObject<AtomicInteger> instance) { Waiter.sleepQuietly(validateLatency); return instance.getObject().intValue() == 1; } - @Override public PooledObject<AtomicInteger> wrap(final AtomicInteger integer) { return new DefaultPooledObject<>(integer); diff --git a/src/test/java/org/apache/commons/pool2/impl/TestEvictionTimer.java b/src/test/java/org/apache/commons/pool2/impl/TestEvictionTimer.java index d6d827f9..a7284f52 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestEvictionTimer.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestEvictionTimer.java @@ -16,7 +16,6 @@ */ package org.apache.commons.pool2.impl; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; 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 04174017..ac745406 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericKeyedObjectPool.java @@ -17,7 +17,6 @@ package org.apache.commons.pool2.impl; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; @@ -797,7 +796,6 @@ public class TestGenericKeyedObjectPool extends AbstractTestKeyedObjectPool { return String.valueOf(key) + String.valueOf(n); } - @Override protected boolean isFifo() { return false; @@ -1201,7 +1199,6 @@ public class TestGenericKeyedObjectPool extends AbstractTestKeyedObjectPool { } } - /** * Tests POOL-411, or least tries to reproduce the NPE, but does not. * @@ -1665,7 +1662,6 @@ public class TestGenericKeyedObjectPool extends AbstractTestKeyedObjectPool { assertEquals(0, gkoPool.getNumIdle()); } - @Test @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) public void testExceptionOnActivateDuringBorrow() throws Exception { @@ -2143,7 +2139,6 @@ public class TestGenericKeyedObjectPool extends AbstractTestKeyedObjectPool { assertThrows(NoSuchElementException.class, () -> gkoPool.borrowObject("")); } - @Test @Timeout(value = 60_000, unit = TimeUnit.MILLISECONDS) public void testMaxTotalPerKeyZero() { @@ -2153,7 +2148,6 @@ public class TestGenericKeyedObjectPool extends AbstractTestKeyedObjectPool { assertThrows(NoSuchElementException.class, () -> gkoPool.borrowObject("a")); } - /** * Verifies that if a borrow of a new key is blocked because maxTotal has * been reached, that borrow continues once another object is returned. @@ -2367,7 +2361,6 @@ public class TestGenericKeyedObjectPool extends AbstractTestKeyedObjectPool { gkoPool.setTimeBetweenEvictionRuns(Duration.ofMillis(100)); gkoPool.setTestWhileIdle(true); - //Generate a random key final String key = "A"; @@ -2522,7 +2515,6 @@ public class TestGenericKeyedObjectPool extends AbstractTestKeyedObjectPool { } } - @Test public void testReturnObjectWithBlockWhenExhausted() throws Exception { gkoPool.setBlockWhenExhausted(true); @@ -2860,4 +2852,3 @@ public void testValidateOnCreateFailure() throws Exception { } - 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 0e06368f..10d0da16 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPool.java @@ -17,7 +17,6 @@ package org.apache.commons.pool2.impl; - import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -989,7 +988,6 @@ public class TestGenericObjectPool extends TestBaseObjectPool { } } - @Test @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) public void testAddObject() throws Exception { @@ -1223,7 +1221,6 @@ public class TestGenericObjectPool extends TestBaseObjectPool { genericObjectPool.close(); } - @Test @Timeout(value = 60000, unit = TimeUnit.MILLISECONDS) public void testConcurrentBorrowAndEvict() throws Exception { @@ -2084,7 +2081,6 @@ public class TestGenericObjectPool extends TestBaseObjectPool { } } - /** * Test the following scenario: * Thread 1 borrows an instance diff --git a/src/test/java/org/apache/commons/pool2/impl/TestPooledSoftReference.java b/src/test/java/org/apache/commons/pool2/impl/TestPooledSoftReference.java index 2e3fff8d..9c3d4dad 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestPooledSoftReference.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestPooledSoftReference.java @@ -16,7 +16,6 @@ */ package org.apache.commons.pool2.impl; - import static org.junit.jupiter.api.Assertions.assertEquals; import java.lang.ref.SoftReference; @@ -24,7 +23,6 @@ import java.lang.ref.SoftReference; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - /** * Tests for PooledSoftReference. */ diff --git a/src/test/java/org/apache/commons/pool2/impl/TestSoftRefOutOfMemory.java b/src/test/java/org/apache/commons/pool2/impl/TestSoftRefOutOfMemory.java index cdb15516..33efae4a 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestSoftRefOutOfMemory.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestSoftRefOutOfMemory.java @@ -17,7 +17,6 @@ package org.apache.commons.pool2.impl; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; diff --git a/src/test/java/org/apache/commons/pool2/impl/TestSoftReferenceObjectPool.java b/src/test/java/org/apache/commons/pool2/impl/TestSoftReferenceObjectPool.java index 6f4c12f5..d39f1a90 100644 --- a/src/test/java/org/apache/commons/pool2/impl/TestSoftReferenceObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/impl/TestSoftReferenceObjectPool.java @@ -61,7 +61,6 @@ public class TestSoftReferenceObjectPool extends TestBaseObjectPool { return (ObjectPool<String>) new SoftReferenceObjectPool<>(new SimpleFactory()); } - @Override protected <E extends Exception> ObjectPool<Object> makeEmptyPool(final PooledObjectFactory<Object> factory) { return new SoftReferenceObjectPool<>(factory); diff --git a/src/test/java/org/apache/commons/pool2/pool407/KeyedPool407Test.java b/src/test/java/org/apache/commons/pool2/pool407/KeyedPool407Test.java index 5ac3c4dd..c69980c5 100644 --- a/src/test/java/org/apache/commons/pool2/pool407/KeyedPool407Test.java +++ b/src/test/java/org/apache/commons/pool2/pool407/KeyedPool407Test.java @@ -70,7 +70,6 @@ public class KeyedPool407Test extends AbstractPool407Test { assertShutdown(termination, poolConfigMaxWait, obj, pooledObject); } - private void test(final AbstractKeyedPool407Factory factory, final int poolSize, final Duration poolConfigMaxWait) throws Exception { final ExecutorService executor = Executors.newFixedThreadPool(poolSize); try (final KeyedPool407 pool = new KeyedPool407(factory, poolConfigMaxWait)) { diff --git a/src/test/java/org/apache/commons/pool2/proxy/AbstractTestProxiedKeyedObjectPool.java b/src/test/java/org/apache/commons/pool2/proxy/AbstractTestProxiedKeyedObjectPool.java index 75bfdf2e..ff3d759a 100644 --- a/src/test/java/org/apache/commons/pool2/proxy/AbstractTestProxiedKeyedObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/proxy/AbstractTestProxiedKeyedObjectPool.java @@ -36,8 +36,6 @@ import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - - public abstract class AbstractTestProxiedKeyedObjectPool { private static final class TestKeyedObjectFactory extends BaseKeyedPooledObjectFactory<String, TestObject> { @@ -75,7 +73,6 @@ public abstract class AbstractTestProxiedKeyedObjectPool { private static final String KEY1 = "key1"; - private static final String DATA1 = "data1"; private static final Duration ABANDONED_TIMEOUT_SECS = Duration.ofSeconds(3); @@ -84,10 +81,8 @@ public abstract class AbstractTestProxiedKeyedObjectPool { private StringWriter log; - protected abstract ProxySource<TestObject> getproxySource(); - @BeforeEach public void setUp() { log = new StringWriter(); @@ -111,7 +106,6 @@ public abstract class AbstractTestProxiedKeyedObjectPool { pool = new ProxiedKeyedObjectPool<>(innerPool, getproxySource()); } - @Test public void testAccessAfterInvalidate() throws Exception { final TestObject obj = pool.borrowObject(KEY1); @@ -130,7 +124,6 @@ public abstract class AbstractTestProxiedKeyedObjectPool { } - @Test public void testAccessAfterReturn() throws Exception { final TestObject obj = pool.borrowObject(KEY1); @@ -159,7 +152,6 @@ public abstract class AbstractTestProxiedKeyedObjectPool { pool.returnObject(KEY1, obj); } - @Test public void testPassThroughMethods01() throws Exception { assertEquals(0, pool.getNumActive()); @@ -176,7 +168,6 @@ public abstract class AbstractTestProxiedKeyedObjectPool { assertEquals(0, pool.getNumIdle()); } - @Test public void testPassThroughMethods02() { pool.close(); diff --git a/src/test/java/org/apache/commons/pool2/proxy/AbstractTestProxiedObjectPool.java b/src/test/java/org/apache/commons/pool2/proxy/AbstractTestProxiedObjectPool.java index f65e53ba..f9608aff 100644 --- a/src/test/java/org/apache/commons/pool2/proxy/AbstractTestProxiedObjectPool.java +++ b/src/test/java/org/apache/commons/pool2/proxy/AbstractTestProxiedObjectPool.java @@ -36,7 +36,6 @@ import org.apache.commons.pool2.impl.GenericObjectPoolConfig; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - public abstract class AbstractTestProxiedObjectPool { protected interface TestObject { @@ -74,15 +73,12 @@ public abstract class AbstractTestProxiedObjectPool { private static final Duration ABANDONED_TIMEOUT_SECS = Duration.ofSeconds(3); - private ObjectPool<TestObject> pool; private StringWriter log; - protected abstract ProxySource<TestObject> getproxySource(); - @BeforeEach public void setUp() { log = new StringWriter(); @@ -106,7 +102,6 @@ public abstract class AbstractTestProxiedObjectPool { pool = new ProxiedObjectPool<>(innerPool, getproxySource()); } - @Test public void testAccessAfterInvalidate() throws Exception { final TestObject obj = pool.borrowObject(); @@ -125,7 +120,6 @@ public abstract class AbstractTestProxiedObjectPool { } - @Test public void testAccessAfterReturn() throws Exception { final TestObject obj = pool.borrowObject(); @@ -143,7 +137,6 @@ public abstract class AbstractTestProxiedObjectPool { obj::getData); } - @Test public void testBorrowObject() throws Exception { final TestObject obj = pool.borrowObject(); @@ -172,7 +165,6 @@ public abstract class AbstractTestProxiedObjectPool { assertEquals(0, pool.getNumIdle()); } - @Test public void testPassThroughMethods02() { pool.close(); @@ -181,7 +173,6 @@ public abstract class AbstractTestProxiedObjectPool { () -> pool.addObject()); } - @Test public void testUsageTracking() throws Exception { final TestObject obj = pool.borrowObject();