diff --git a/src/main/java/org/cactoos/scalar/And.java b/src/main/java/org/cactoos/scalar/And.java index ba2d370f32..dd33598d18 100644 --- a/src/main/java/org/cactoos/scalar/And.java +++ b/src/main/java/org/cactoos/scalar/And.java @@ -91,7 +91,8 @@ public And(final Func func, final X... src) { public And(final Func func, final Iterable src) { this( new Mapped<>( - item -> (Scalar) () -> func.apply(item), src + item -> new ScalarOf<>(() -> func.apply(item)), + src ) ); } @@ -118,7 +119,7 @@ public And(final X subject, final Func... conditions) { public And(final X subject, final Iterable> conditions) { this( new Mapped<>( - item -> (Scalar) () -> item.apply(subject), + item -> new ScalarOf<>(() -> item.apply(subject)), conditions ) ); diff --git a/src/main/java/org/cactoos/scalar/AndInThreads.java b/src/main/java/org/cactoos/scalar/AndInThreads.java index 37d896d1ef..90b226844c 100644 --- a/src/main/java/org/cactoos/scalar/AndInThreads.java +++ b/src/main/java/org/cactoos/scalar/AndInThreads.java @@ -92,7 +92,8 @@ public AndInThreads(final Func func, final Iterable src) { this( new Mapped<>( - item -> (Scalar) () -> func.apply(item), src + item -> new ScalarOf<>(() -> func.apply(item)), + src ) ); } @@ -164,7 +165,8 @@ public AndInThreads(final ExecutorService svc, this( svc, new Mapped<>( - item -> (Scalar) () -> func.apply(item), src + item -> new ScalarOf<>(() -> func.apply(item)), + src ) ); } @@ -210,7 +212,7 @@ public Boolean value() throws Exception { futures.add(this.service.submit(item::value)); } final boolean result = new And( - (Func, Boolean>) Future::get, + Future::get, futures ).value(); if (this.shut) { diff --git a/src/main/java/org/cactoos/scalar/AndWithIndex.java b/src/main/java/org/cactoos/scalar/AndWithIndex.java index a1f9103dc6..7997202872 100644 --- a/src/main/java/org/cactoos/scalar/AndWithIndex.java +++ b/src/main/java/org/cactoos/scalar/AndWithIndex.java @@ -29,6 +29,7 @@ import org.cactoos.Proc; import org.cactoos.Scalar; import org.cactoos.func.BiFuncOf; +import org.cactoos.func.FuncOf; import org.cactoos.iterable.IterableOf; import org.cactoos.iterable.Mapped; @@ -115,8 +116,8 @@ public AndWithIndex(final BiFunc func, final Iterable src) { this( new Mapped<>( - item -> (Func) input - -> func.apply(item, input), src + item -> new FuncOf<>(input -> func.apply(item, input)), + src ) ); } diff --git a/src/main/java/org/cactoos/scalar/Or.java b/src/main/java/org/cactoos/scalar/Or.java index c3438938ca..fefb1fc8ab 100644 --- a/src/main/java/org/cactoos/scalar/Or.java +++ b/src/main/java/org/cactoos/scalar/Or.java @@ -125,7 +125,8 @@ public Or(final Proc proc, final Iterable src) { public Or(final Func func, final Iterable src) { this( new Mapped<>( - item -> (Scalar) () -> func.apply(item), src + item -> new ScalarOf<>(() -> func.apply(item)), + src ) ); } @@ -140,7 +141,7 @@ public Or(final Func func, final Iterable src) { public Or(final X subject, final Func... conditions) { this( new Mapped<>( - item -> (Scalar) () -> item.apply(subject), + item -> new ScalarOf<>(() -> item.apply(subject)), new IterableOf<>(conditions) ) );