-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.x: Fix Generics T[] in Zip & CombineLatest #4525
Changes from 1 commit
a755ef4
94f4503
b8e5108
39a9e31
4a972f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,7 +163,7 @@ public static int bufferSize() { | |
*/ | ||
@SchedulerSupport(SchedulerSupport.NONE) | ||
@BackpressureSupport(BackpressureKind.FULL) | ||
public static <T, R> Flowable<R> combineLatest(Publisher<? extends T>[] sources, Function<? super T[], ? extends R> combiner) { | ||
public static <T, R> Flowable<R> combineLatest(Publisher<? extends T>[] sources, Function<? super Object[], ? extends R> combiner) { | ||
return combineLatest(sources, combiner, bufferSize()); | ||
} | ||
|
||
|
@@ -194,7 +194,7 @@ public static <T, R> Flowable<R> combineLatest(Publisher<? extends T>[] sources, | |
*/ | ||
@SchedulerSupport(SchedulerSupport.NONE) | ||
@BackpressureSupport(BackpressureKind.FULL) | ||
public static <T, R> Flowable<R> combineLatest(Function<? super T[], ? extends R> combiner, Publisher<? extends T>... sources) { | ||
public static <T, R> Flowable<R> combineLatest(Function<? super Object[], ? extends R> combiner, Publisher<? extends T>... sources) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one does not seem necessary to be honest. It just has switched arguments with the one above. Or do I oversee anything? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This and other overloads of operators let's you use varargs to specify any number of sources at the expense that varargs has to be the last argument. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ups right didn't see those little dots there too many overloads ... |
||
return combineLatest(sources, combiner, bufferSize()); | ||
} | ||
|
||
|
@@ -227,7 +227,7 @@ public static <T, R> Flowable<R> combineLatest(Function<? super T[], ? extends R | |
*/ | ||
@SchedulerSupport(SchedulerSupport.NONE) | ||
@BackpressureSupport(BackpressureKind.FULL) | ||
public static <T, R> Flowable<R> combineLatest(Publisher<? extends T>[] sources, Function<? super T[], ? extends R> combiner, int bufferSize) { | ||
public static <T, R> Flowable<R> combineLatest(Publisher<? extends T>[] sources, Function<? super Object[], ? extends R> combiner, int bufferSize) { | ||
ObjectHelper.requireNonNull(sources, "sources is null"); | ||
if (sources.length == 0) { | ||
return empty(); | ||
|
@@ -265,7 +265,7 @@ public static <T, R> Flowable<R> combineLatest(Publisher<? extends T>[] sources, | |
@SchedulerSupport(SchedulerSupport.NONE) | ||
@BackpressureSupport(BackpressureKind.FULL) | ||
public static <T, R> Flowable<R> combineLatest(Iterable<? extends Publisher<? extends T>> sources, | ||
Function<? super T[], ? extends R> combiner) { | ||
Function<? super Object[], ? extends R> combiner) { | ||
return combineLatest(sources, combiner, bufferSize()); | ||
} | ||
|
||
|
@@ -299,7 +299,7 @@ public static <T, R> Flowable<R> combineLatest(Iterable<? extends Publisher<? ex | |
@SchedulerSupport(SchedulerSupport.NONE) | ||
@BackpressureSupport(BackpressureKind.FULL) | ||
public static <T, R> Flowable<R> combineLatest(Iterable<? extends Publisher<? extends T>> sources, | ||
Function<? super T[], ? extends R> combiner, int bufferSize) { | ||
Function<? super Object[], ? extends R> combiner, int bufferSize) { | ||
ObjectHelper.requireNonNull(sources, "sources is null"); | ||
ObjectHelper.requireNonNull(combiner, "combiner is null"); | ||
ObjectHelper.verifyPositive(bufferSize, "bufferSize"); | ||
|
@@ -334,7 +334,7 @@ public static <T, R> Flowable<R> combineLatest(Iterable<? extends Publisher<? ex | |
@SchedulerSupport(SchedulerSupport.NONE) | ||
@BackpressureSupport(BackpressureKind.FULL) | ||
public static <T, R> Flowable<R> combineLatestDelayError(Publisher<? extends T>[] sources, | ||
Function<? super T[], ? extends R> combiner) { | ||
Function<? super Object[], ? extends R> combiner) { | ||
return combineLatestDelayError(sources, combiner, bufferSize()); | ||
} | ||
|
||
|
@@ -367,7 +367,7 @@ public static <T, R> Flowable<R> combineLatestDelayError(Publisher<? extends T>[ | |
*/ | ||
@SchedulerSupport(SchedulerSupport.NONE) | ||
@BackpressureSupport(BackpressureKind.FULL) | ||
public static <T, R> Flowable<R> combineLatestDelayError(Function<? super T[], ? extends R> combiner, | ||
public static <T, R> Flowable<R> combineLatestDelayError(Function<? super Object[], ? extends R> combiner, | ||
Publisher<? extends T>... sources) { | ||
return combineLatestDelayError(sources, combiner, bufferSize()); | ||
} | ||
|
@@ -398,7 +398,7 @@ public static <T, R> Flowable<R> combineLatestDelayError(Function<? super T[], ? | |
* @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a> | ||
*/ | ||
@SchedulerSupport(SchedulerSupport.NONE) | ||
public static <T, R> Flowable<R> combineLatestDelayError(Function<? super T[], ? extends R> combiner, | ||
public static <T, R> Flowable<R> combineLatestDelayError(Function<? super Object[], ? extends R> combiner, | ||
int bufferSize, Publisher<? extends T>... sources) { | ||
return combineLatestDelayError(sources, combiner, bufferSize); | ||
} | ||
|
@@ -435,7 +435,7 @@ public static <T, R> Flowable<R> combineLatestDelayError(Function<? super T[], ? | |
@SchedulerSupport(SchedulerSupport.NONE) | ||
@BackpressureSupport(BackpressureKind.FULL) | ||
public static <T, R> Flowable<R> combineLatestDelayError(Publisher<? extends T>[] sources, | ||
Function<? super T[], ? extends R> combiner, int bufferSize) { | ||
Function<? super Object[], ? extends R> combiner, int bufferSize) { | ||
ObjectHelper.requireNonNull(sources, "sources is null"); | ||
ObjectHelper.requireNonNull(combiner, "combiner is null"); | ||
ObjectHelper.verifyPositive(bufferSize, "bufferSize"); | ||
|
@@ -475,7 +475,7 @@ public static <T, R> Flowable<R> combineLatestDelayError(Publisher<? extends T>[ | |
@SchedulerSupport(SchedulerSupport.NONE) | ||
@BackpressureSupport(BackpressureKind.FULL) | ||
public static <T, R> Flowable<R> combineLatestDelayError(Iterable<? extends Publisher<? extends T>> sources, | ||
Function<? super T[], ? extends R> combiner) { | ||
Function<? super Object[], ? extends R> combiner) { | ||
return combineLatestDelayError(sources, combiner, bufferSize()); | ||
} | ||
|
||
|
@@ -511,7 +511,7 @@ public static <T, R> Flowable<R> combineLatestDelayError(Iterable<? extends Publ | |
@SchedulerSupport(SchedulerSupport.NONE) | ||
@BackpressureSupport(BackpressureKind.FULL) | ||
public static <T, R> Flowable<R> combineLatestDelayError(Iterable<? extends Publisher<? extends T>> sources, | ||
Function<? super T[], ? extends R> combiner, int bufferSize) { | ||
Function<? super Object[], ? extends R> combiner, int bufferSize) { | ||
ObjectHelper.requireNonNull(sources, "sources is null"); | ||
ObjectHelper.requireNonNull(combiner, "combiner is null"); | ||
ObjectHelper.verifyPositive(bufferSize, "bufferSize"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth adding a sentence to the javadocs since people tend to ask why this isn't
? super T[]
If you feel so, you could add these two sentences after the first sentence of all the affected methods and before the marble diagram (as people forget to scroll down below the diagram).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do