Skip to content

Commit

Permalink
3.x: Add nullability annotations to type arguments (#6840)
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd committed Jan 14, 2020
1 parent 04800ae commit fb6dab6
Show file tree
Hide file tree
Showing 75 changed files with 474 additions and 427 deletions.
28 changes: 14 additions & 14 deletions src/main/java/io/reactivex/rxjava3/core/Completable.java
Expand Up @@ -151,7 +151,7 @@ public static Completable ambArray(@NonNull CompletableSource... sources) {
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public static Completable amb(@NonNull Iterable<? extends CompletableSource> sources) {
public static Completable amb(@NonNull Iterable<@NonNull ? extends CompletableSource> sources) {
Objects.requireNonNull(sources, "sources is null");

return RxJavaPlugins.onAssembly(new CompletableAmb(null, sources));
Expand Down Expand Up @@ -216,7 +216,7 @@ public static Completable concatArray(@NonNull CompletableSource... sources) {
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public static Completable concat(@NonNull Iterable<? extends CompletableSource> sources) {
public static Completable concat(@NonNull Iterable<@NonNull ? extends CompletableSource> sources) {
Objects.requireNonNull(sources, "sources is null");

return RxJavaPlugins.onAssembly(new CompletableConcatIterable(sources));
Expand All @@ -241,7 +241,7 @@ public static Completable concat(@NonNull Iterable<? extends CompletableSource>
@SchedulerSupport(SchedulerSupport.NONE)
@BackpressureSupport(BackpressureKind.FULL)
@NonNull
public static Completable concat(@NonNull Publisher<? extends CompletableSource> sources) {
public static Completable concat(@NonNull Publisher<@NonNull ? extends CompletableSource> sources) {
return concat(sources, 2);
}

Expand All @@ -266,7 +266,7 @@ public static Completable concat(@NonNull Publisher<? extends CompletableSource>
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
@BackpressureSupport(BackpressureKind.FULL)
public static Completable concat(@NonNull Publisher<? extends CompletableSource> sources, int prefetch) {
public static Completable concat(@NonNull Publisher<@NonNull ? extends CompletableSource> sources, int prefetch) {
Objects.requireNonNull(sources, "sources is null");
ObjectHelper.verifyPositive(prefetch, "prefetch");
return RxJavaPlugins.onAssembly(new CompletableConcat(sources, prefetch));
Expand Down Expand Up @@ -733,7 +733,7 @@ public static Completable mergeArray(@NonNull CompletableSource... sources) {
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public static Completable merge(@NonNull Iterable<? extends CompletableSource> sources) {
public static Completable merge(@NonNull Iterable<@NonNull ? extends CompletableSource> sources) {
Objects.requireNonNull(sources, "sources is null");
return RxJavaPlugins.onAssembly(new CompletableMergeIterable(sources));
}
Expand Down Expand Up @@ -772,7 +772,7 @@ public static Completable merge(@NonNull Iterable<? extends CompletableSource> s
@SchedulerSupport(SchedulerSupport.NONE)
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
@NonNull
public static Completable merge(@NonNull Publisher<? extends CompletableSource> sources) {
public static Completable merge(@NonNull Publisher<@NonNull ? extends CompletableSource> sources) {
return merge0(sources, Integer.MAX_VALUE, false);
}

Expand Down Expand Up @@ -813,7 +813,7 @@ public static Completable merge(@NonNull Publisher<? extends CompletableSource>
@SchedulerSupport(SchedulerSupport.NONE)
@BackpressureSupport(BackpressureKind.FULL)
@NonNull
public static Completable merge(@NonNull Publisher<? extends CompletableSource> sources, int maxConcurrency) {
public static Completable merge(@NonNull Publisher<@NonNull ? extends CompletableSource> sources, int maxConcurrency) {
return merge0(sources, maxConcurrency, false);
}

Expand All @@ -840,7 +840,7 @@ public static Completable merge(@NonNull Publisher<? extends CompletableSource>
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
@BackpressureSupport(BackpressureKind.FULL)
private static Completable merge0(@NonNull Publisher<? extends CompletableSource> sources, int maxConcurrency, boolean delayErrors) {
private static Completable merge0(@NonNull Publisher<@NonNull ? extends CompletableSource> sources, int maxConcurrency, boolean delayErrors) {
Objects.requireNonNull(sources, "sources is null");
ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency");
return RxJavaPlugins.onAssembly(new CompletableMerge(sources, maxConcurrency, delayErrors));
Expand Down Expand Up @@ -886,7 +886,7 @@ public static Completable mergeArrayDelayError(@NonNull CompletableSource... sou
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public static Completable mergeDelayError(@NonNull Iterable<? extends CompletableSource> sources) {
public static Completable mergeDelayError(@NonNull Iterable<@NonNull ? extends CompletableSource> sources) {
Objects.requireNonNull(sources, "sources is null");
return RxJavaPlugins.onAssembly(new CompletableMergeDelayErrorIterable(sources));
}
Expand All @@ -912,7 +912,7 @@ public static Completable mergeDelayError(@NonNull Iterable<? extends Completabl
@SchedulerSupport(SchedulerSupport.NONE)
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
@NonNull
public static Completable mergeDelayError(@NonNull Publisher<? extends CompletableSource> sources) {
public static Completable mergeDelayError(@NonNull Publisher<@NonNull ? extends CompletableSource> sources) {
return merge0(sources, Integer.MAX_VALUE, true);
}

Expand Down Expand Up @@ -940,7 +940,7 @@ public static Completable mergeDelayError(@NonNull Publisher<? extends Completab
@SchedulerSupport(SchedulerSupport.NONE)
@BackpressureSupport(BackpressureKind.FULL)
@NonNull
public static Completable mergeDelayError(@NonNull Publisher<? extends CompletableSource> sources, int maxConcurrency) {
public static Completable mergeDelayError(@NonNull Publisher<@NonNull ? extends CompletableSource> sources, int maxConcurrency) {
return merge0(sources, maxConcurrency, true);
}

Expand Down Expand Up @@ -1582,7 +1582,7 @@ public final Completable doOnError(@NonNull Consumer<? super Throwable> onError)
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable doOnEvent(@NonNull Consumer<? super Throwable> onEvent) {
public final Completable doOnEvent(@NonNull Consumer<@Nullable ? super Throwable> onEvent) {
Objects.requireNonNull(onEvent, "onEvent is null");
return RxJavaPlugins.onAssembly(new CompletableDoOnEvent(this, onEvent));
}
Expand Down Expand Up @@ -2083,7 +2083,7 @@ public final Completable repeatUntil(@NonNull BooleanSupplier stop) {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@NonNull
public final Completable repeatWhen(@NonNull Function<? super Flowable<Object>, ? extends Publisher<?>> handler) {
public final Completable repeatWhen(@NonNull Function<? super Flowable<Object>, ? extends Publisher<@NonNull ?>> handler) {
return fromPublisher(toFlowable().repeatWhen(handler));
}

Expand Down Expand Up @@ -2234,7 +2234,7 @@ public final Completable retry(@NonNull Predicate<? super Throwable> predicate)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@NonNull
public final Completable retryWhen(@NonNull Function<? super Flowable<Throwable>, ? extends Publisher<?>> handler) {
public final Completable retryWhen(@NonNull Function<? super Flowable<Throwable>, ? extends Publisher<@NonNull ?>> handler) {
return fromPublisher(toFlowable().retryWhen(handler));
}

Expand Down
Expand Up @@ -23,13 +23,12 @@
* @since 2.2
*/
@FunctionalInterface
public interface CompletableConverter<R> {
public interface CompletableConverter<@NonNull R> {
/**
* Applies a function to the upstream Completable and returns a converted value of type {@code R}.
*
* @param upstream the upstream Completable instance
* @return the converted value
*/
@NonNull
R apply(@NonNull Completable upstream);
}
2 changes: 1 addition & 1 deletion src/main/java/io/reactivex/rxjava3/core/Emitter.java
Expand Up @@ -25,7 +25,7 @@
*
* @param <T> the value type emitted
*/
public interface Emitter<T> {
public interface Emitter<@NonNull T> {

/**
* Signal a normal value.
Expand Down

0 comments on commit fb6dab6

Please sign in to comment.