Skip to content

Commit f1441b0

Browse files
authored
3.x: Rename zipIterable, remove zip(O(O)), adjust concatMapX arg order (#6638)
1 parent 54d9279 commit f1441b0

File tree

12 files changed

+178
-401
lines changed

12 files changed

+178
-401
lines changed

src/main/java/io/reactivex/rxjava3/core/Flowable.java

+45-100
Large diffs are not rendered by default.

src/main/java/io/reactivex/rxjava3/core/Observable.java

+42-97
Large diffs are not rendered by default.

src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableInternalHelper.java

-19
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313
package io.reactivex.rxjava3.internal.operators.flowable;
1414

15-
import java.util.List;
1615
import java.util.concurrent.TimeUnit;
1716

1817
import org.reactivestreams.*;
@@ -217,24 +216,6 @@ public void accept(Subscription t) throws Exception {
217216
}
218217
}
219218

220-
static final class ZipIterableFunction<T, R>
221-
implements Function<List<Publisher<? extends T>>, Publisher<? extends R>> {
222-
private final Function<? super Object[], ? extends R> zipper;
223-
224-
ZipIterableFunction(Function<? super Object[], ? extends R> zipper) {
225-
this.zipper = zipper;
226-
}
227-
228-
@Override
229-
public Publisher<? extends R> apply(List<Publisher<? extends T>> list) {
230-
return Flowable.zipIterable(list, zipper, false, Flowable.bufferSize());
231-
}
232-
}
233-
234-
public static <T, R> Function<List<Publisher<? extends T>>, Publisher<? extends R>> zipIterable(final Function<? super Object[], ? extends R> zipper) {
235-
return new ZipIterableFunction<T, R>(zipper);
236-
}
237-
238219
static final class ReplaySupplier<T> implements Supplier<ConnectableFlowable<T>> {
239220

240221
final Flowable<T> parent;

src/main/java/io/reactivex/rxjava3/internal/operators/observable/ObservableInternalHelper.java

-19
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313
package io.reactivex.rxjava3.internal.operators.observable;
1414

15-
import java.util.List;
1615
import java.util.concurrent.TimeUnit;
1716

1817
import io.reactivex.rxjava3.core.*;
@@ -214,24 +213,6 @@ public static <T> Supplier<ConnectableObservable<T>> replaySupplier(final Observ
214213
return new TimedReplayCallable<T>(parent, time, unit, scheduler, eagerTruncate);
215214
}
216215

217-
static final class ZipIterableFunction<T, R>
218-
implements Function<List<ObservableSource<? extends T>>, ObservableSource<? extends R>> {
219-
private final Function<? super Object[], ? extends R> zipper;
220-
221-
ZipIterableFunction(Function<? super Object[], ? extends R> zipper) {
222-
this.zipper = zipper;
223-
}
224-
225-
@Override
226-
public ObservableSource<? extends R> apply(List<ObservableSource<? extends T>> list) {
227-
return Observable.zipIterable(list, zipper, false, Observable.bufferSize());
228-
}
229-
}
230-
231-
public static <T, R> Function<List<ObservableSource<? extends T>>, ObservableSource<? extends R>> zipIterable(final Function<? super Object[], ? extends R> zipper) {
232-
return new ZipIterableFunction<T, R>(zipper);
233-
}
234-
235216
static final class ReplaySupplier<T> implements Supplier<ConnectableObservable<T>> {
236217
private final Observable<T> parent;
237218

src/test/java/io/reactivex/rxjava3/flowable/FlowableNullTests.java

+4-54
Original file line numberDiff line numberDiff line change
@@ -651,34 +651,9 @@ public Object apply(Object[] a) {
651651
}).blockingLast();
652652
}
653653

654-
@Test(expected = NullPointerException.class)
655-
public void zipPublisherNull() {
656-
Flowable.zip((Publisher<Publisher<Object>>)null, new Function<Object[], Object>() {
657-
@Override
658-
public Object apply(Object[] a) {
659-
return 1;
660-
}
661-
});
662-
}
663-
664-
@Test(expected = NullPointerException.class)
665-
public void zipPublisherFunctionNull() {
666-
Flowable.zip((Flowable.just(just1)), null);
667-
}
668-
669-
@Test(expected = NullPointerException.class)
670-
public void zipPublisherFunctionReturnsNull() {
671-
Flowable.zip((Flowable.just(just1)), new Function<Object[], Object>() {
672-
@Override
673-
public Object apply(Object[] a) {
674-
return null;
675-
}
676-
}).blockingLast();
677-
}
678-
679654
@Test(expected = NullPointerException.class)
680655
public void zipIterable2Null() {
681-
Flowable.zipIterable((Iterable<Publisher<Object>>)null, new Function<Object[], Object>() {
656+
Flowable.zip((Iterable<Publisher<Object>>)null, new Function<Object[], Object>() {
682657
@Override
683658
public Object apply(Object[] a) {
684659
return 1;
@@ -688,7 +663,7 @@ public Object apply(Object[] a) {
688663

689664
@Test(expected = NullPointerException.class)
690665
public void zipIterable2IteratorNull() {
691-
Flowable.zipIterable(new Iterable<Publisher<Object>>() {
666+
Flowable.zip(new Iterable<Publisher<Object>>() {
692667
@Override
693668
public Iterator<Publisher<Object>> iterator() {
694669
return null;
@@ -704,13 +679,13 @@ public Object apply(Object[] a) {
704679
@SuppressWarnings("unchecked")
705680
@Test(expected = NullPointerException.class)
706681
public void zipIterable2FunctionNull() {
707-
Flowable.zipIterable(Arrays.asList(just1, just1), null, true, 128);
682+
Flowable.zip(Arrays.asList(just1, just1), null, true, 128);
708683
}
709684

710685
@SuppressWarnings("unchecked")
711686
@Test(expected = NullPointerException.class)
712687
public void zipIterable2FunctionReturnsNull() {
713-
Flowable.zipIterable(Arrays.asList(just1, just1), new Function<Object[], Object>() {
688+
Flowable.zip(Arrays.asList(just1, just1), new Function<Object[], Object>() {
714689
@Override
715690
public Object apply(Object[] a) {
716691
return null;
@@ -2721,31 +2696,6 @@ public void combineLatestDelayErrorIterableFunctionNull() {
27212696
Flowable.combineLatestDelayError(Arrays.asList(just1), null, 128);
27222697
}
27232698

2724-
@Test(expected = NullPointerException.class)
2725-
public void zipFlowableNull() {
2726-
Flowable.zip((Flowable<Flowable<Object>>)null, new Function<Object[], Object>() {
2727-
@Override
2728-
public Object apply(Object[] a) {
2729-
return 1;
2730-
}
2731-
});
2732-
}
2733-
2734-
@Test(expected = NullPointerException.class)
2735-
public void zipFlowableFunctionNull() {
2736-
Flowable.zip((Flowable.just(just1)), null);
2737-
}
2738-
2739-
@Test(expected = NullPointerException.class)
2740-
public void zipFlowableFunctionReturnsNull() {
2741-
Flowable.zip((Flowable.just(just1)), new Function<Object[], Object>() {
2742-
@Override
2743-
public Object apply(Object[] a) {
2744-
return null;
2745-
}
2746-
}).blockingLast();
2747-
}
2748-
27492699
@Test(expected = NullPointerException.class)
27502700
public void concatFlowableNull() {
27512701
Flowable.concat((Flowable<Flowable<Object>>)null);

0 commit comments

Comments
 (0)