Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Feb 9, 2024
1 parent b8398e3 commit bcee07e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private static final class ObjectDeque<S> {
* Number of instances created - number destroyed.
* Invariant: createCount <= maxTotalPerKey
*/
private final AtomicInteger createCount = new AtomicInteger(0);
private final AtomicInteger createCount = new AtomicInteger();

private long makeObjectCount;
private final Object makeObjectCountLock = new Object();
Expand Down Expand Up @@ -232,7 +232,7 @@ public String toString() {
* {@link #maxTotal} but there will never be more than {@link #maxTotal}
* created at any one time.
*/
private final AtomicInteger numTotal = new AtomicInteger(0);
private final AtomicInteger numTotal = new AtomicInteger();

private Iterator<K> evictionKeyIterator; // @GuardedBy("evictionLock")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class TestBasePoolableObjectFactory {
private static final class TestFactory extends BasePooledObjectFactory<AtomicInteger, RuntimeException> {
@Override
public AtomicInteger create() {
return new AtomicInteger(0);
return new AtomicInteger();
}
@Override
public void destroyObject(final PooledObject<AtomicInteger> p, final DestroyMode destroyMode){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void activateObject(final PooledObject<AtomicInteger> p) {
@Override
public AtomicInteger create() {
Waiter.sleepQuietly(createLatency);
return new AtomicInteger(0);
return new AtomicInteger();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public boolean validateObject(final PooledObject<String> obj) {

public static class TestEvictionPolicy<T> implements EvictionPolicy<T> {

private final AtomicInteger callCount = new AtomicInteger(0);
private final AtomicInteger callCount = new AtomicInteger();

@Override
public boolean evict(final EvictionConfig config, final PooledObject<T> underTest,
Expand Down

0 comments on commit bcee07e

Please sign in to comment.