Skip to content

Commit 1e4dbcf

Browse files
authored
3.x: Improve JavaDocs of Observable and fix similar issues elsewhere (#6831)
* 3.x: Javadoc cleanup of Observable * Another set of cleanups (too many things to fix at once) * 3.x: Improve JavaDocs of Observable and fix similar issues elsewhere
1 parent 6030d83 commit 1e4dbcf

19 files changed

+3846
-3237
lines changed

Diff for: src/main/java/io/reactivex/rxjava3/core/Completable.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ public static Completable create(@NonNull CompletableOnSubscribe source) {
336336
* when the {@code Completable} is subscribed to.
337337
* @return the created {@code Completable} instance
338338
* @throws NullPointerException if {@code source} is {@code null}
339+
* @throws IllegalArgumentException if {@code source} is a {@code Completable}
339340
*/
340341
@CheckReturnValue
341342
@NonNull
@@ -364,7 +365,7 @@ public static Completable unsafeCreate(@NonNull CompletableSource source) {
364365
@NonNull
365366
@SchedulerSupport(SchedulerSupport.NONE)
366367
public static Completable defer(@NonNull Supplier<? extends CompletableSource> completableSupplier) {
367-
Objects.requireNonNull(completableSupplier, "completableSupplier");
368+
Objects.requireNonNull(completableSupplier, "completableSupplier is null");
368369
return RxJavaPlugins.onAssembly(new CompletableDefer(completableSupplier));
369370
}
370371

Diff for: src/main/java/io/reactivex/rxjava3/core/Flowable.java

+123-105
Large diffs are not rendered by default.

Diff for: src/main/java/io/reactivex/rxjava3/core/Maybe.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,14 @@ public static <T> Maybe<T> amb(@NonNull Iterable<? extends MaybeSource<? extends
147147
* @param sources the array of sources. A subscription to each source will
148148
* occur in the same order as in the array.
149149
* @return the new {@code Maybe} instance
150+
* @throws NullPointerException if {@code sources} is {@code null}
150151
*/
151152
@CheckReturnValue
152153
@SchedulerSupport(SchedulerSupport.NONE)
153154
@NonNull
154155
@SafeVarargs
155156
public static <T> Maybe<T> ambArray(@NonNull MaybeSource<? extends T>... sources) {
157+
Objects.requireNonNull(sources, "sources is null");
156158
if (sources.length == 0) {
157159
return empty();
158160
}
@@ -402,6 +404,7 @@ public static <T> Flowable<T> concatArray(@NonNull MaybeSource<? extends T>... s
402404
@SafeVarargs
403405
@NonNull
404406
public static <T> Flowable<T> concatArrayDelayError(@NonNull MaybeSource<? extends T>... sources) {
407+
Objects.requireNonNull(sources, "sources is null");
405408
if (sources.length == 0) {
406409
return Flowable.empty();
407410
} else
@@ -1364,6 +1367,7 @@ public static <T> Flowable<T> mergeArray(MaybeSource<? extends T>... sources) {
13641367
@SafeVarargs
13651368
@NonNull
13661369
public static <T> Flowable<T> mergeArrayDelayError(@NonNull MaybeSource<? extends T>... sources) {
1370+
Objects.requireNonNull(sources, "sources is null");
13671371
if (sources.length == 0) {
13681372
return Flowable.empty();
13691373
}
@@ -1764,6 +1768,8 @@ public static Maybe<Long> timer(long delay, @NonNull TimeUnit unit, @NonNull Sch
17641768
* @param <T> the value type
17651769
* @param onSubscribe the function that is called with the subscribing {@code MaybeObserver}
17661770
* @return the new {@code Maybe} instance
1771+
* @throws IllegalArgumentException if {@code onSubscribe} is a {@code Maybe}
1772+
* @throws NullPointerException if {@code onSubscribe} is {@code null}
17671773
*/
17681774
@CheckReturnValue
17691775
@NonNull
@@ -1858,6 +1864,7 @@ public static <T, D> Maybe<T> using(@NonNull Supplier<? extends D> resourceSuppl
18581864
* @param <T> the value type
18591865
* @param source the source to wrap
18601866
* @return the {@code Maybe} wrapper or the source cast to {@code Maybe} (if possible)
1867+
* @throws NullPointerException if {@code source} is {@code null}
18611868
*/
18621869
@CheckReturnValue
18631870
@NonNull
@@ -3522,7 +3529,7 @@ public final Single<Boolean> isEmpty() {
35223529
* if (str.length() &lt; 2) {
35233530
* downstream.onSuccess(str);
35243531
* } else {
3525-
* // Maybe i {@code Maybe} ly expected to produce one of the onXXX events
3532+
* // Maybe is expected to produce one of the onXXX events only
35263533
* downstream.onComplete();
35273534
* }
35283535
* }

Diff for: src/main/java/io/reactivex/rxjava3/core/Observable.java

+3,593-3,097
Large diffs are not rendered by default.

Diff for: src/main/java/io/reactivex/rxjava3/core/Single.java

+2
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,15 @@ public static <T> Single<T> amb(@NonNull Iterable<? extends SingleSource<? exten
152152
* @param sources the array of sources. A subscription to each source will
153153
* occur in the same order as in this array.
154154
* @return the new {@code Single} instance
155+
* @throws NullPointerException if {@code sources} is {@code null}
155156
* @since 2.0
156157
*/
157158
@CheckReturnValue
158159
@SchedulerSupport(SchedulerSupport.NONE)
159160
@SafeVarargs
160161
@NonNull
161162
public static <T> Single<T> ambArray(@NonNull SingleSource<? extends T>... sources) {
163+
Objects.requireNonNull(sources, "sources is null");
162164
if (sources.length == 0) {
163165
return error(SingleInternalHelper.emptyThrower());
164166
}

Diff for: src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableBlockingSubscribe.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ private FlowableBlockingSubscribe() {
3636
/**
3737
* Subscribes to the source and calls the Subscriber methods on the current thread.
3838
* <p>
39-
* @param o the source publisher
39+
* @param source the source publisher
4040
* The cancellation and backpressure is composed through.
4141
* @param subscriber the subscriber to forward events and calls to in the current thread
4242
* @param <T> the value type
4343
*/
44-
public static <T> void subscribe(Publisher<? extends T> o, Subscriber<? super T> subscriber) {
44+
public static <T> void subscribe(Publisher<? extends T> source, Subscriber<? super T> subscriber) {
4545
final BlockingQueue<Object> queue = new LinkedBlockingQueue<>();
4646

4747
BlockingSubscriber<T> bs = new BlockingSubscriber<>(queue);
4848

49-
o.subscribe(bs);
49+
source.subscribe(bs);
5050

5151
try {
5252
for (;;) {
@@ -77,15 +77,15 @@ public static <T> void subscribe(Publisher<? extends T> o, Subscriber<? super T>
7777

7878
/**
7979
* Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
80-
* @param o the source publisher
80+
* @param source the source to await
8181
* @param <T> the value type
8282
*/
83-
public static <T> void subscribe(Publisher<? extends T> o) {
83+
public static <T> void subscribe(Publisher<? extends T> source) {
8484
BlockingIgnoringReceiver callback = new BlockingIgnoringReceiver();
8585
LambdaSubscriber<T> ls = new LambdaSubscriber<>(Functions.emptyConsumer(),
8686
callback, callback, Functions.REQUEST_MAX);
8787

88-
o.subscribe(ls);
88+
source.subscribe(ls);
8989

9090
BlockingHelper.awaitForComplete(callback, ls);
9191
Throwable e = callback.error;

Diff for: src/main/java/io/reactivex/rxjava3/internal/operators/observable/ObservableBlockingSubscribe.java

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ private ObservableBlockingSubscribe() {
3939
* The call to dispose() is composed through.
4040
* @param observer the subscriber to forward events and calls to in the current thread
4141
* @param <T> the value type
42+
* @throws NullPointerException if {@code observer} is {@code null}
4243
*/
4344
public static <T> void subscribe(ObservableSource<? extends T> o, Observer<? super T> observer) {
4445
final BlockingQueue<Object> queue = new LinkedBlockingQueue<>();

Diff for: src/main/java/io/reactivex/rxjava3/parallel/ParallelFlowable.java

+19-14
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ public abstract class ParallelFlowable<@NonNull T> {
7272
*
7373
* @param subscribers the array of Subscribers
7474
* @return true if the number of subscribers equals to the parallelism level
75+
* @throws NullPointerException if {@code subscribers} is {@code null}
76+
* @throws IllegalArgumentException if {@code subscribers.length} is different from {@link #parallelism()}
7577
*/
7678
protected final boolean validate(@NonNull Subscriber<?>[] subscribers) {
79+
Objects.requireNonNull(subscribers, "subscribers is null");
7780
int p = parallelism();
7881
if (subscribers.length != p) {
7982
Throwable iae = new IllegalArgumentException("parallelism = " + p + ", subscribers = " + subscribers.length);
@@ -156,7 +159,7 @@ public static <T> ParallelFlowable<T> from(@NonNull Publisher<? extends T> sourc
156159
@BackpressureSupport(BackpressureKind.FULL)
157160
public static <@NonNull T> ParallelFlowable<T> from(@NonNull Publisher<? extends T> source,
158161
int parallelism, int prefetch) {
159-
Objects.requireNonNull(source, "source");
162+
Objects.requireNonNull(source, "source is null");
160163
ObjectHelper.verifyPositive(parallelism, "parallelism");
161164
ObjectHelper.verifyPositive(prefetch, "prefetch");
162165

@@ -183,7 +186,7 @@ public static <T> ParallelFlowable<T> from(@NonNull Publisher<? extends T> sourc
183186
@SchedulerSupport(SchedulerSupport.NONE)
184187
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
185188
public final <R> ParallelFlowable<R> map(@NonNull Function<? super T, ? extends R> mapper) {
186-
Objects.requireNonNull(mapper, "mapper");
189+
Objects.requireNonNull(mapper, "mapper is null");
187190
return RxJavaPlugins.onAssembly(new ParallelMap<>(this, mapper));
188191
}
189192

@@ -212,7 +215,7 @@ public final <R> ParallelFlowable<R> map(@NonNull Function<? super T, ? extends
212215
@SchedulerSupport(SchedulerSupport.NONE)
213216
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
214217
public final <R> ParallelFlowable<R> map(@NonNull Function<? super T, ? extends R> mapper, @NonNull ParallelFailureHandling errorHandler) {
215-
Objects.requireNonNull(mapper, "mapper");
218+
Objects.requireNonNull(mapper, "mapper is null");
216219
Objects.requireNonNull(errorHandler, "errorHandler is null");
217220
return RxJavaPlugins.onAssembly(new ParallelMapTry<>(this, mapper, errorHandler));
218221
}
@@ -243,7 +246,7 @@ public final <R> ParallelFlowable<R> map(@NonNull Function<? super T, ? extends
243246
@SchedulerSupport(SchedulerSupport.NONE)
244247
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
245248
public final <R> ParallelFlowable<R> map(@NonNull Function<? super T, ? extends R> mapper, @NonNull BiFunction<? super Long, ? super Throwable, ParallelFailureHandling> errorHandler) {
246-
Objects.requireNonNull(mapper, "mapper");
249+
Objects.requireNonNull(mapper, "mapper is null");
247250
Objects.requireNonNull(errorHandler, "errorHandler is null");
248251
return RxJavaPlugins.onAssembly(new ParallelMapTry<>(this, mapper, errorHandler));
249252
}
@@ -267,7 +270,7 @@ public final <R> ParallelFlowable<R> map(@NonNull Function<? super T, ? extends
267270
@SchedulerSupport(SchedulerSupport.NONE)
268271
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
269272
public final ParallelFlowable<T> filter(@NonNull Predicate<? super T> predicate) {
270-
Objects.requireNonNull(predicate, "predicate");
273+
Objects.requireNonNull(predicate, "predicate is null");
271274
return RxJavaPlugins.onAssembly(new ParallelFilter<>(this, predicate));
272275
}
273276

@@ -295,7 +298,7 @@ public final ParallelFlowable<T> filter(@NonNull Predicate<? super T> predicate)
295298
@SchedulerSupport(SchedulerSupport.NONE)
296299
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
297300
public final ParallelFlowable<T> filter(@NonNull Predicate<? super T> predicate, @NonNull ParallelFailureHandling errorHandler) {
298-
Objects.requireNonNull(predicate, "predicate");
301+
Objects.requireNonNull(predicate, "predicate is null");
299302
Objects.requireNonNull(errorHandler, "errorHandler is null");
300303
return RxJavaPlugins.onAssembly(new ParallelFilterTry<>(this, predicate, errorHandler));
301304
}
@@ -325,7 +328,7 @@ public final ParallelFlowable<T> filter(@NonNull Predicate<? super T> predicate,
325328
@SchedulerSupport(SchedulerSupport.NONE)
326329
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
327330
public final ParallelFlowable<T> filter(@NonNull Predicate<? super T> predicate, @NonNull BiFunction<? super Long, ? super Throwable, ParallelFailureHandling> errorHandler) {
328-
Objects.requireNonNull(predicate, "predicate");
331+
Objects.requireNonNull(predicate, "predicate is null");
329332
Objects.requireNonNull(errorHandler, "errorHandler is null");
330333
return RxJavaPlugins.onAssembly(new ParallelFilterTry<>(this, predicate, errorHandler));
331334
}
@@ -401,7 +404,7 @@ public final ParallelFlowable<T> runOn(@NonNull Scheduler scheduler) {
401404
@BackpressureSupport(BackpressureKind.FULL)
402405
@SchedulerSupport(SchedulerSupport.CUSTOM)
403406
public final ParallelFlowable<T> runOn(@NonNull Scheduler scheduler, int prefetch) {
404-
Objects.requireNonNull(scheduler, "scheduler");
407+
Objects.requireNonNull(scheduler, "scheduler is null");
405408
ObjectHelper.verifyPositive(prefetch, "prefetch");
406409
return RxJavaPlugins.onAssembly(new ParallelRunOn<>(this, scheduler, prefetch));
407410
}
@@ -426,7 +429,7 @@ public final ParallelFlowable<T> runOn(@NonNull Scheduler scheduler, int prefetc
426429
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
427430
@SchedulerSupport(SchedulerSupport.NONE)
428431
public final Flowable<T> reduce(@NonNull BiFunction<T, T, T> reducer) {
429-
Objects.requireNonNull(reducer, "reducer");
432+
Objects.requireNonNull(reducer, "reducer is null");
430433
return RxJavaPlugins.onAssembly(new ParallelReduceFull<>(this, reducer));
431434
}
432435

@@ -453,8 +456,8 @@ public final Flowable<T> reduce(@NonNull BiFunction<T, T, T> reducer) {
453456
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
454457
@SchedulerSupport(SchedulerSupport.NONE)
455458
public final <R> ParallelFlowable<R> reduce(@NonNull Supplier<R> initialSupplier, @NonNull BiFunction<R, ? super T, R> reducer) {
456-
Objects.requireNonNull(initialSupplier, "initialSupplier");
457-
Objects.requireNonNull(reducer, "reducer");
459+
Objects.requireNonNull(initialSupplier, "initialSupplier is null");
460+
Objects.requireNonNull(reducer, "reducer is null");
458461
return RxJavaPlugins.onAssembly(new ParallelReduce<>(this, initialSupplier, reducer));
459462
}
460463

@@ -1024,13 +1027,15 @@ public final <C> ParallelFlowable<C> collect(@NonNull Supplier<? extends C> coll
10241027
* @param <T> the value type
10251028
* @param publishers the array of publishers
10261029
* @return the new ParallelFlowable instance
1030+
* @throws IllegalArgumentException if {@code publishers} is an empty array
10271031
*/
10281032
@CheckReturnValue
10291033
@NonNull
10301034
@SafeVarargs
10311035
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
10321036
@SchedulerSupport(SchedulerSupport.NONE)
10331037
public static <@NonNull T> ParallelFlowable<T> fromArray(@NonNull Publisher<T>... publishers) {
1038+
Objects.requireNonNull(publishers, "publishers is null");
10341039
if (publishers.length == 0) {
10351040
throw new IllegalArgumentException("Zero publishers not supported");
10361041
}
@@ -1427,7 +1432,7 @@ public final <U> ParallelFlowable<U> flatMapIterable(@NonNull Function<? super T
14271432
@SchedulerSupport(SchedulerSupport.NONE)
14281433
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
14291434
public final <R> ParallelFlowable<R> mapOptional(@NonNull Function<? super T, Optional<? extends R>> mapper) {
1430-
Objects.requireNonNull(mapper, "mapper");
1435+
Objects.requireNonNull(mapper, "mapper is null");
14311436
return RxJavaPlugins.onAssembly(new ParallelMapOptional<>(this, mapper));
14321437
}
14331438

@@ -1456,7 +1461,7 @@ public final <R> ParallelFlowable<R> mapOptional(@NonNull Function<? super T, Op
14561461
@SchedulerSupport(SchedulerSupport.NONE)
14571462
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
14581463
public final <R> ParallelFlowable<R> mapOptional(@NonNull Function<? super T, Optional<? extends R>> mapper, @NonNull ParallelFailureHandling errorHandler) {
1459-
Objects.requireNonNull(mapper, "mapper");
1464+
Objects.requireNonNull(mapper, "mapper is null");
14601465
Objects.requireNonNull(errorHandler, "errorHandler is null");
14611466
return RxJavaPlugins.onAssembly(new ParallelMapTryOptional<>(this, mapper, errorHandler));
14621467
}
@@ -1487,7 +1492,7 @@ public final <R> ParallelFlowable<R> mapOptional(@NonNull Function<? super T, Op
14871492
@SchedulerSupport(SchedulerSupport.NONE)
14881493
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
14891494
public final <R> ParallelFlowable<R> mapOptional(@NonNull Function<? super T, Optional<? extends R>> mapper, @NonNull BiFunction<? super Long, ? super Throwable, ParallelFailureHandling> errorHandler) {
1490-
Objects.requireNonNull(mapper, "mapper");
1495+
Objects.requireNonNull(mapper, "mapper is null");
14911496
Objects.requireNonNull(errorHandler, "errorHandler is null");
14921497
return RxJavaPlugins.onAssembly(new ParallelMapTryOptional<>(this, mapper, errorHandler));
14931498
}

Diff for: src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableSkipLastTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void skipLastWithBackpressure() {
9797

9898
}
9999

100-
@Test(expected = IndexOutOfBoundsException.class)
100+
@Test(expected = IllegalArgumentException.class)
101101
public void skipLastWithNegativeCount() {
102102
Flowable.just("one").skipLast(-1);
103103
}

Diff for: src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableTakeLastTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void takeLastWithZeroCount() {
8989
verify(subscriber, times(1)).onComplete();
9090
}
9191

92-
@Test(expected = IndexOutOfBoundsException.class)
92+
@Test(expected = IllegalArgumentException.class)
9393
public void takeLastWithNegativeCount() {
9494
Flowable.just("one").takeLast(-1);
9595
}

Diff for: src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableTakeLastTimedTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
public class FlowableTakeLastTimedTest extends RxJavaTest {
3434

35-
@Test(expected = IndexOutOfBoundsException.class)
35+
@Test(expected = IllegalArgumentException.class)
3636
public void takeLastTimedWithNegativeCount() {
3737
Flowable.just("one").takeLast(-1, 1, TimeUnit.SECONDS);
3838
}

Diff for: src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatMapEagerTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ public void badCapacityHint() throws Exception {
535535
try {
536536
Observable.concatEager(Arrays.asList(source, source, source), 1, -99);
537537
} catch (IllegalArgumentException ex) {
538-
assertEquals("prefetch > 0 required but it was -99", ex.getMessage());
538+
assertEquals("bufferSize > 0 required but it was -99", ex.getMessage());
539539
}
540540

541541
}
@@ -547,7 +547,7 @@ public void mappingBadCapacityHint() throws Exception {
547547
try {
548548
Observable.just(source, source, source).concatMapEager((Function)Functions.identity(), 10, -99);
549549
} catch (IllegalArgumentException ex) {
550-
assertEquals("prefetch > 0 required but it was -99", ex.getMessage());
550+
assertEquals("bufferSize > 0 required but it was -99", ex.getMessage());
551551
}
552552

553553
}

Diff for: src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableSkipLastTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void skipLastWithBackpressure() {
9292

9393
}
9494

95-
@Test(expected = IndexOutOfBoundsException.class)
95+
@Test(expected = IllegalArgumentException.class)
9696
public void skipLastWithNegativeCount() {
9797
Observable.just("one").skipLast(-1);
9898
}

Diff for: src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableTakeLastTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void takeLastWithZeroCount() {
8383
verify(observer, times(1)).onComplete();
8484
}
8585

86-
@Test(expected = IndexOutOfBoundsException.class)
86+
@Test(expected = IllegalArgumentException.class)
8787
public void takeLastWithNegativeCount() {
8888
Observable.just("one").takeLast(-1);
8989
}

Diff for: src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableTakeLastTimedTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
public class ObservableTakeLastTimedTest extends RxJavaTest {
3232

33-
@Test(expected = IndexOutOfBoundsException.class)
33+
@Test(expected = IllegalArgumentException.class)
3434
public void takeLastTimedWithNegativeCount() {
3535
Observable.just("one").takeLast(-1, 1, TimeUnit.SECONDS);
3636
}

Diff for: src/test/java/io/reactivex/rxjava3/validators/JavadocCodesAndLinks.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,13 @@ public void checkMaybe() throws Exception {
5050
checkSource("Maybe", "io.reactivex.rxjava3.core");
5151
}
5252

53+
@Test
54+
public void checkObservable() throws Exception {
55+
checkSource("Observable", "io.reactivex.rxjava3.core");
56+
}
57+
5358
static void checkSource(String baseClassName, String packageName) throws Exception {
54-
File f = TestHelper.findSource(baseClassName);
59+
File f = TestHelper.findSource(baseClassName, packageName);
5560
if (f == null) {
5661
return;
5762
}

Diff for: src/test/java/io/reactivex/rxjava3/validators/JavadocWording.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -990,5 +990,5 @@ static void backpressureMentionedWithoutAnnotation(StringBuilder e, RxMethod m,
990990
}
991991
}
992992

993-
static final String[] AT_RETURN_WORDS = { "@return a ", "@return the new ", "@return a new " };
993+
static final String[] AT_RETURN_WORDS = { "@return a ", "@return an ", "@return the new ", "@return a new " };
994994
}

Diff for: src/test/java/io/reactivex/rxjava3/validators/ParamValidationCheckerTest.java

+6
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,12 @@ void checkClass(Class<?> clazz) {
890890
error = ex;
891891
}
892892

893+
if (!success && error.getCause() instanceof NullPointerException) {
894+
if (!error.getCause().toString().contains("is null")) {
895+
fail++;
896+
b.append("\r\nNPEs should indicate which argument failed: " + m + " # " + i + " = " + p + ", tag = " + tag + ", params = " + Arrays.toString(callParams2));
897+
}
898+
}
893899
if (success != shouldSucceed) {
894900
fail++;
895901
if (shouldSucceed) {

0 commit comments

Comments
 (0)