summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/data/SingleSupplier.java
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2017-04-10 16:40:33 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2017-04-10 16:40:33 -0400
commit889fac2bdf993dc86f64a8893c0260fdcf848acb (patch)
tree99ed08552efa86fdc5fdf4ddb8720d10e599fafe /BJC-Utils2/src/main/java/bjc/utils/data/SingleSupplier.java
parent1656b02144446aeedebb3d1179e07ed99c01861c (diff)
Cleanup
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.java12
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;
}