Skip to content

Commit fb6dab6

Browse files
authored
3.x: Add nullability annotations to type arguments (#6840)
1 parent 04800ae commit fb6dab6

File tree

75 files changed

+474
-427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+474
-427
lines changed

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

+14-14
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public static Completable ambArray(@NonNull CompletableSource... sources) {
151151
@CheckReturnValue
152152
@NonNull
153153
@SchedulerSupport(SchedulerSupport.NONE)
154-
public static Completable amb(@NonNull Iterable<? extends CompletableSource> sources) {
154+
public static Completable amb(@NonNull Iterable<@NonNull ? extends CompletableSource> sources) {
155155
Objects.requireNonNull(sources, "sources is null");
156156

157157
return RxJavaPlugins.onAssembly(new CompletableAmb(null, sources));
@@ -216,7 +216,7 @@ public static Completable concatArray(@NonNull CompletableSource... sources) {
216216
@CheckReturnValue
217217
@NonNull
218218
@SchedulerSupport(SchedulerSupport.NONE)
219-
public static Completable concat(@NonNull Iterable<? extends CompletableSource> sources) {
219+
public static Completable concat(@NonNull Iterable<@NonNull ? extends CompletableSource> sources) {
220220
Objects.requireNonNull(sources, "sources is null");
221221

222222
return RxJavaPlugins.onAssembly(new CompletableConcatIterable(sources));
@@ -241,7 +241,7 @@ public static Completable concat(@NonNull Iterable<? extends CompletableSource>
241241
@SchedulerSupport(SchedulerSupport.NONE)
242242
@BackpressureSupport(BackpressureKind.FULL)
243243
@NonNull
244-
public static Completable concat(@NonNull Publisher<? extends CompletableSource> sources) {
244+
public static Completable concat(@NonNull Publisher<@NonNull ? extends CompletableSource> sources) {
245245
return concat(sources, 2);
246246
}
247247

@@ -266,7 +266,7 @@ public static Completable concat(@NonNull Publisher<? extends CompletableSource>
266266
@NonNull
267267
@SchedulerSupport(SchedulerSupport.NONE)
268268
@BackpressureSupport(BackpressureKind.FULL)
269-
public static Completable concat(@NonNull Publisher<? extends CompletableSource> sources, int prefetch) {
269+
public static Completable concat(@NonNull Publisher<@NonNull ? extends CompletableSource> sources, int prefetch) {
270270
Objects.requireNonNull(sources, "sources is null");
271271
ObjectHelper.verifyPositive(prefetch, "prefetch");
272272
return RxJavaPlugins.onAssembly(new CompletableConcat(sources, prefetch));
@@ -733,7 +733,7 @@ public static Completable mergeArray(@NonNull CompletableSource... sources) {
733733
@CheckReturnValue
734734
@NonNull
735735
@SchedulerSupport(SchedulerSupport.NONE)
736-
public static Completable merge(@NonNull Iterable<? extends CompletableSource> sources) {
736+
public static Completable merge(@NonNull Iterable<@NonNull ? extends CompletableSource> sources) {
737737
Objects.requireNonNull(sources, "sources is null");
738738
return RxJavaPlugins.onAssembly(new CompletableMergeIterable(sources));
739739
}
@@ -772,7 +772,7 @@ public static Completable merge(@NonNull Iterable<? extends CompletableSource> s
772772
@SchedulerSupport(SchedulerSupport.NONE)
773773
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
774774
@NonNull
775-
public static Completable merge(@NonNull Publisher<? extends CompletableSource> sources) {
775+
public static Completable merge(@NonNull Publisher<@NonNull ? extends CompletableSource> sources) {
776776
return merge0(sources, Integer.MAX_VALUE, false);
777777
}
778778

@@ -813,7 +813,7 @@ public static Completable merge(@NonNull Publisher<? extends CompletableSource>
813813
@SchedulerSupport(SchedulerSupport.NONE)
814814
@BackpressureSupport(BackpressureKind.FULL)
815815
@NonNull
816-
public static Completable merge(@NonNull Publisher<? extends CompletableSource> sources, int maxConcurrency) {
816+
public static Completable merge(@NonNull Publisher<@NonNull ? extends CompletableSource> sources, int maxConcurrency) {
817817
return merge0(sources, maxConcurrency, false);
818818
}
819819

@@ -840,7 +840,7 @@ public static Completable merge(@NonNull Publisher<? extends CompletableSource>
840840
@NonNull
841841
@SchedulerSupport(SchedulerSupport.NONE)
842842
@BackpressureSupport(BackpressureKind.FULL)
843-
private static Completable merge0(@NonNull Publisher<? extends CompletableSource> sources, int maxConcurrency, boolean delayErrors) {
843+
private static Completable merge0(@NonNull Publisher<@NonNull ? extends CompletableSource> sources, int maxConcurrency, boolean delayErrors) {
844844
Objects.requireNonNull(sources, "sources is null");
845845
ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency");
846846
return RxJavaPlugins.onAssembly(new CompletableMerge(sources, maxConcurrency, delayErrors));
@@ -886,7 +886,7 @@ public static Completable mergeArrayDelayError(@NonNull CompletableSource... sou
886886
@CheckReturnValue
887887
@NonNull
888888
@SchedulerSupport(SchedulerSupport.NONE)
889-
public static Completable mergeDelayError(@NonNull Iterable<? extends CompletableSource> sources) {
889+
public static Completable mergeDelayError(@NonNull Iterable<@NonNull ? extends CompletableSource> sources) {
890890
Objects.requireNonNull(sources, "sources is null");
891891
return RxJavaPlugins.onAssembly(new CompletableMergeDelayErrorIterable(sources));
892892
}
@@ -912,7 +912,7 @@ public static Completable mergeDelayError(@NonNull Iterable<? extends Completabl
912912
@SchedulerSupport(SchedulerSupport.NONE)
913913
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
914914
@NonNull
915-
public static Completable mergeDelayError(@NonNull Publisher<? extends CompletableSource> sources) {
915+
public static Completable mergeDelayError(@NonNull Publisher<@NonNull ? extends CompletableSource> sources) {
916916
return merge0(sources, Integer.MAX_VALUE, true);
917917
}
918918

@@ -940,7 +940,7 @@ public static Completable mergeDelayError(@NonNull Publisher<? extends Completab
940940
@SchedulerSupport(SchedulerSupport.NONE)
941941
@BackpressureSupport(BackpressureKind.FULL)
942942
@NonNull
943-
public static Completable mergeDelayError(@NonNull Publisher<? extends CompletableSource> sources, int maxConcurrency) {
943+
public static Completable mergeDelayError(@NonNull Publisher<@NonNull ? extends CompletableSource> sources, int maxConcurrency) {
944944
return merge0(sources, maxConcurrency, true);
945945
}
946946

@@ -1582,7 +1582,7 @@ public final Completable doOnError(@NonNull Consumer<? super Throwable> onError)
15821582
@CheckReturnValue
15831583
@NonNull
15841584
@SchedulerSupport(SchedulerSupport.NONE)
1585-
public final Completable doOnEvent(@NonNull Consumer<? super Throwable> onEvent) {
1585+
public final Completable doOnEvent(@NonNull Consumer<@Nullable ? super Throwable> onEvent) {
15861586
Objects.requireNonNull(onEvent, "onEvent is null");
15871587
return RxJavaPlugins.onAssembly(new CompletableDoOnEvent(this, onEvent));
15881588
}
@@ -2083,7 +2083,7 @@ public final Completable repeatUntil(@NonNull BooleanSupplier stop) {
20832083
@CheckReturnValue
20842084
@SchedulerSupport(SchedulerSupport.NONE)
20852085
@NonNull
2086-
public final Completable repeatWhen(@NonNull Function<? super Flowable<Object>, ? extends Publisher<?>> handler) {
2086+
public final Completable repeatWhen(@NonNull Function<? super Flowable<Object>, ? extends Publisher<@NonNull ?>> handler) {
20872087
return fromPublisher(toFlowable().repeatWhen(handler));
20882088
}
20892089

@@ -2234,7 +2234,7 @@ public final Completable retry(@NonNull Predicate<? super Throwable> predicate)
22342234
@CheckReturnValue
22352235
@SchedulerSupport(SchedulerSupport.NONE)
22362236
@NonNull
2237-
public final Completable retryWhen(@NonNull Function<? super Flowable<Throwable>, ? extends Publisher<?>> handler) {
2237+
public final Completable retryWhen(@NonNull Function<? super Flowable<Throwable>, ? extends Publisher<@NonNull ?>> handler) {
22382238
return fromPublisher(toFlowable().retryWhen(handler));
22392239
}
22402240

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323
* @since 2.2
2424
*/
2525
@FunctionalInterface
26-
public interface CompletableConverter<R> {
26+
public interface CompletableConverter<@NonNull R> {
2727
/**
2828
* Applies a function to the upstream Completable and returns a converted value of type {@code R}.
2929
*
3030
* @param upstream the upstream Completable instance
3131
* @return the converted value
3232
*/
33-
@NonNull
3433
R apply(@NonNull Completable upstream);
3534
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
* @param <T> the value type emitted
2727
*/
28-
public interface Emitter<T> {
28+
public interface Emitter<@NonNull T> {
2929

3030
/**
3131
* Signal a normal value.

0 commit comments

Comments
 (0)