Skip to content

Commit

Permalink
[POOL-238] Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Raju Kumar Gupta committed Dec 18, 2024
1 parent ca1a5e5 commit aee5c3b
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
*/
public class TestSoftReferenceObjectPool extends TestBaseObjectPool {

private static final class SimpleFactory <T, E extends Exception> extends BasePooledObjectFactory<T, E> {
private static final class SimpleFactory extends BasePooledObjectFactory<String, RuntimeException> {

int counter;

@Override
public T create() {
return (T)String.valueOf(counter++);
public String create() {
return String.valueOf(counter++);
}

@Override
public PooledObject<T> wrap(final T value) {
public PooledObject<String> wrap(final String value) {
return new DefaultPooledObject<>(value);
}
}
Expand All @@ -59,8 +59,8 @@ protected boolean isLifo() {
@Override
protected <T, E extends Exception> ObjectPool<T, E> makeEmptyPool(final int cap) {

final PooledObjectFactory<T, E> factory = new SimpleFactory<>();
return makeEmptyPool(factory);
final PooledObjectFactory<String, RuntimeException> factory = new SimpleFactory();
return (ObjectPool<T, E>)makeEmptyPool(factory);
}

@Override
Expand Down

0 comments on commit aee5c3b

Please sign in to comment.