diff --git a/src/main/java/io/reactivex/Maybe.java b/src/main/java/io/reactivex/Maybe.java index 7fbb057c26..e54195277b 100644 --- a/src/main/java/io/reactivex/Maybe.java +++ b/src/main/java/io/reactivex/Maybe.java @@ -1967,13 +1967,12 @@ public final Maybe cast(final Class clazz) { * * * @param the value type of the Maybe returned by the transformer function - * @param transformer - * implements the function that transforms the source Maybe + * @param transformer the transformer function, not null * @return a Maybe, transformed by the transformer function * @see RxJava wiki: Implementing Your Own Operators */ @SchedulerSupport(SchedulerSupport.NONE) - public final Maybe compose(Function, ? extends MaybeSource> transformer) { + public final Maybe compose(MaybeTransformer transformer) { return wrap(to(transformer)); } diff --git a/src/main/java/io/reactivex/Single.java b/src/main/java/io/reactivex/Single.java index 3902167d8b..b2afbbda66 100644 --- a/src/main/java/io/reactivex/Single.java +++ b/src/main/java/io/reactivex/Single.java @@ -1467,13 +1467,12 @@ public final Single hide() { * * * @param the value type of the single returned by the transformer function - * @param transformer - * implements the function that transforms the source Single + * @param transformer the transformer function, not null * @return the source Single, transformed by the transformer function * @see RxJava wiki: Implementing Your Own Operators */ @SchedulerSupport(SchedulerSupport.NONE) - public final Single compose(Function, ? extends SingleSource> transformer) { + public final Single compose(SingleTransformer transformer) { return wrap(to(transformer)); } diff --git a/src/test/java/io/reactivex/internal/operators/single/SingleMiscTest.java b/src/test/java/io/reactivex/internal/operators/single/SingleMiscTest.java index b09c2e9d9c..293dab0849 100644 --- a/src/test/java/io/reactivex/internal/operators/single/SingleMiscTest.java +++ b/src/test/java/io/reactivex/internal/operators/single/SingleMiscTest.java @@ -13,18 +13,23 @@ package io.reactivex.internal.operators.single; -import static org.junit.Assert.*; - -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.junit.Test; - -import io.reactivex.*; +import io.reactivex.Single; +import io.reactivex.SingleObserver; +import io.reactivex.SingleSource; +import io.reactivex.SingleTransformer; import io.reactivex.disposables.Disposables; import io.reactivex.exceptions.TestException; import io.reactivex.functions.*; import io.reactivex.schedulers.Schedulers; +import org.junit.Test; + +import java.util.concurrent.Callable; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicBoolean; + +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertSame; public class SingleMiscTest { @Test @@ -78,7 +83,7 @@ public void contains() { public void compose() { Single.just(1) - .compose(new Function, SingleSource>() { + .compose(new SingleTransformer() { @Override public SingleSource apply(Single f) throws Exception { return f.map(new Function() { diff --git a/src/test/java/io/reactivex/maybe/MaybeTest.java b/src/test/java/io/reactivex/maybe/MaybeTest.java index bb6e2f9928..20934b941b 100644 --- a/src/test/java/io/reactivex/maybe/MaybeTest.java +++ b/src/test/java/io/reactivex/maybe/MaybeTest.java @@ -388,7 +388,7 @@ public void toNull() { @Test public void compose() { - Maybe.just(1).compose(new Function, MaybeSource>() { + Maybe.just(1).compose(new MaybeTransformer() { @Override public MaybeSource apply(Maybe m) throws Exception { return m.map(new Function() {