diff options
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/SingleSupplier.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/data/SingleSupplier.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/SingleSupplier.java b/BJC-Utils2/src/main/java/bjc/utils/data/SingleSupplier.java index fde5111..c675ebf 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/SingleSupplier.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/SingleSupplier.java @@ -15,11 +15,11 @@ import java.util.function.Supplier; public class SingleSupplier<T> implements Supplier<T> { private static long nextID = 0; - private Supplier<T> source; + private final Supplier<T> source; private boolean gotten; - private long id; + private final long id; /* * This is bad practice, but I want to know where the single @@ -33,7 +33,7 @@ public class SingleSupplier<T> implements Supplier<T> { * @param supp * The supplier to give a single value from */ - public SingleSupplier(Supplier<T> supp) { + public SingleSupplier(final Supplier<T> supp) { source = supp; gotten = false; @@ -44,10 +44,10 @@ public class SingleSupplier<T> implements Supplier<T> { @Override public T get() { if (gotten == true) { - String msg = String.format( + final String msg = String.format( "Attempted to retrieve value more than once from single supplier #%d", id); - IllegalStateException isex = new IllegalStateException(msg); + final IllegalStateException isex = new IllegalStateException(msg); isex.initCause(instSite); @@ -58,7 +58,7 @@ public class SingleSupplier<T> implements Supplier<T> { try { throw new IllegalStateException("Previous instantiation here."); - } catch (IllegalStateException isex) { + } catch (final IllegalStateException isex) { instSite = isex; } |
