Skip to content

Commit

Permalink
Make internal classes final where possible (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvest committed Jul 7, 2024
2 parents ddb12ce + 0f92468 commit 5b62240
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

public class DirectAllocationController<T extends Poolable> extends AllocationController<T> {
public final class DirectAllocationController<T extends Poolable> extends AllocationController<T> {
private final LinkedTransferQueue<BSlot<T>> live;
private final RefillPile<T> disregardPile;
private final BSlot<T> poisonPill;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import static java.util.Objects.requireNonNull;

public class InlineAllocationController<T extends Poolable> extends AllocationController<T> {
public final class InlineAllocationController<T extends Poolable> extends AllocationController<T> {
private static final VarHandle SIZE;
private static final VarHandle ALLOC_COUNT;
private static final VarHandle FAILED_ALLOC_COUNT;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/stormpot/internal/OrExpiration.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @author Guillaume Lederrey
* @since 2.4
*/
public class OrExpiration<T extends Poolable> implements Expiration<T> {
public final class OrExpiration<T extends Poolable> implements Expiration<T> {
private final Expiration<T> firstExpiration;
private final Expiration<T> secondExpiration;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/stormpot/internal/PoolBuilderDefaults.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import java.util.concurrent.ThreadFactory;

public class PoolBuilderDefaults {
public final class PoolBuilderDefaults {
public final Expiration<? super Poolable> expiration;
public final ThreadFactory threadFactory;
public final boolean preciseLeakDetectionEnabled;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/stormpot/internal/RefillSlot.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import stormpot.Poolable;

public class RefillSlot<T extends Poolable> {
public final class RefillSlot<T extends Poolable> {
final BSlot<T> slot;
volatile RefillSlot<T> next;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
import java.util.concurrent.LinkedTransferQueue;
import java.util.concurrent.ThreadFactory;

public class ThreadedAllocationController<T extends Poolable> extends AllocationController<T> {
public final class ThreadedAllocationController<T extends Poolable> extends AllocationController<T> {
private final BAllocThread<T> allocator;
private final Thread allocatorThread;

ThreadedAllocationController(
LinkedTransferQueue<BSlot<T>> live,
RefillPile<T> disregardPile,
Expand Down

0 comments on commit 5b62240

Please sign in to comment.