diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-09-25 19:06:51 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-09-25 19:06:51 -0400 |
| commit | 51825f93a1e7ba9ba739070a5cc5b69ad9e7ddd8 (patch) | |
| tree | 3119bc9394d76ac468b2a160740bdd36ce626236 | |
| parent | e525a21d91879bc2026f5932e894c428b146d36c (diff) | |
Warning cleanup
| -rw-r--r-- | src/main/java/bjc/data/internals/BoundLazy.java | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/main/java/bjc/data/internals/BoundLazy.java b/src/main/java/bjc/data/internals/BoundLazy.java index 9c984eb..a350a2b 100644 --- a/src/main/java/bjc/data/internals/BoundLazy.java +++ b/src/main/java/bjc/data/internals/BoundLazy.java @@ -13,8 +13,11 @@ import bjc.funcdata.IList; * Implements a lazy holder that has been bound. * * @author Ben Culkin + * @param <OldType> + * The old type of the value. + * @param <BoundContainedType> + * The type of the new bound value. */ -@SuppressWarnings("javadoc") public class BoundLazy<OldType, BoundContainedType> implements IHolder<BoundContainedType> { /* The old value. */ @@ -57,7 +60,10 @@ public class BoundLazy<OldType, BoundContainedType> /* Prepare a list of pending actions. */ final IList<UnaryOperator<BoundContainedType>> pendingActions = new FunctionalList<>(); - actions.forEach(pendingActions::add); + + for (UnaryOperator<BoundContainedType> pendAct : actions) { + pendingActions.add(pendAct); + } /* Create the new supplier of a value. */ final Supplier<IHolder<BoundContainedType>> typeSupplier = () -> { @@ -69,7 +75,8 @@ public class BoundLazy<OldType, BoundContainedType> } /* Apply all the pending actions. */ - return pendingActions.reduceAux(oldHolder, (action, state) -> state.transform(action), value -> value); + return pendingActions.reduceAux(oldHolder, + (action, state) -> state.transform(action), value -> value); }; return new BoundLazy<>(typeSupplier, bindr); @@ -95,7 +102,10 @@ public class BoundLazy<OldType, BoundContainedType> /* Prepare a list of pending actions. */ final IList<UnaryOperator<BoundContainedType>> pendingActions = new FunctionalList<>(); - actions.forEach(pendingActions::add); + + for (UnaryOperator<BoundContainedType> pendAct : actions) { + pendingActions.add(pendAct); + } /* Prepare the new supplier. */ final Supplier<MappedType> typeSupplier = () -> { @@ -107,7 +117,8 @@ public class BoundLazy<OldType, BoundContainedType> } /* Apply pending actions. */ - return pendingActions.reduceAux(oldHolder.getValue(), (action, state) -> action.apply(state), value -> mapper.apply(value)); + return pendingActions.reduceAux(oldHolder.getValue(), + (action, state) -> action.apply(state), value -> mapper.apply(value)); }; return new Lazy<>(typeSupplier); |
