From aee5c3bd470b719c0781d247958486633de12988 Mon Sep 17 00:00:00 2001 From: Raju Kumar Gupta Date: Wed, 18 Dec 2024 14:42:36 +0000 Subject: [PATCH] [POOL-238] Refactoring --- .../pool3/impl/TestSoftReferenceObjectPool.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/apache/commons/pool3/impl/TestSoftReferenceObjectPool.java b/src/test/java/org/apache/commons/pool3/impl/TestSoftReferenceObjectPool.java index 3f5f4c232..8036a8682 100644 --- a/src/test/java/org/apache/commons/pool3/impl/TestSoftReferenceObjectPool.java +++ b/src/test/java/org/apache/commons/pool3/impl/TestSoftReferenceObjectPool.java @@ -26,17 +26,17 @@ */ public class TestSoftReferenceObjectPool extends TestBaseObjectPool { - private static final class SimpleFactory extends BasePooledObjectFactory { + private static final class SimpleFactory extends BasePooledObjectFactory { int counter; @Override - public T create() { - return (T)String.valueOf(counter++); + public String create() { + return String.valueOf(counter++); } @Override - public PooledObject wrap(final T value) { + public PooledObject wrap(final String value) { return new DefaultPooledObject<>(value); } } @@ -59,8 +59,8 @@ protected boolean isLifo() { @Override protected ObjectPool makeEmptyPool(final int cap) { - final PooledObjectFactory factory = new SimpleFactory<>(); - return makeEmptyPool(factory); + final PooledObjectFactory factory = new SimpleFactory(); + return (ObjectPool)makeEmptyPool(factory); } @Override