Skip to content
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

3.x: Add nullability annotations to type arguments #6840

Merged
merged 1 commit into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/main/java/io/reactivex/rxjava3/core/Completable.java
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading