From 20a1c5bf04dbd006387d550fc782e6da42d3e4e1 Mon Sep 17 00:00:00 2001 From: akarnokd Date: Sun, 29 Apr 2018 11:08:35 +0200 Subject: [PATCH] 2.x: Maybe/Single Javadoc; annotation cleanup --- src/main/java/io/reactivex/Maybe.java | 38 +++++++++---------- src/main/java/io/reactivex/Single.java | 7 +--- .../java/io/reactivex/JavadocWording.java | 8 ++-- .../mixed/ObservableConcatMapMaybeTest.java | 2 +- .../mixed/ObservableConcatMapSingleTest.java | 2 +- .../operators/single/SingleConcatTest.java | 1 - 6 files changed, 27 insertions(+), 31 deletions(-) diff --git a/src/main/java/io/reactivex/Maybe.java b/src/main/java/io/reactivex/Maybe.java index 23c787a5c7..49daf38cbe 100644 --- a/src/main/java/io/reactivex/Maybe.java +++ b/src/main/java/io/reactivex/Maybe.java @@ -3503,7 +3503,7 @@ public final Maybe onErrorComplete(final Predicate predica } /** - * Instructs a Maybe to pass control to another MaybeSource rather than invoking + * Instructs a Maybe to pass control to another {@link MaybeSource} rather than invoking * {@link MaybeObserver#onError onError} if it encounters an error. *

* @@ -3516,7 +3516,7 @@ public final Maybe onErrorComplete(final Predicate predica * * * @param next - * the next Maybe source that will take over if the source Maybe encounters + * the next {@code MaybeSource} that will take over if the source Maybe encounters * an error * @return the new Maybe instance * @see ReactiveX operators documentation: Catch @@ -4348,14 +4348,14 @@ public final Maybe timeout(long timeout, TimeUnit timeUnit, Scheduler schedul } /** - * If this Maybe source didn't signal an event before the timeoutIndicator MaybeSource signals, a - * TimeoutException is signalled instead. + * If the current {@code Maybe} didn't signal an event before the {@code timeoutIndicator} {@link MaybeSource} signals, a + * {@link TimeoutException} is signaled instead. *

*
Scheduler:
*
{@code timeout} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type of the - * @param timeoutIndicator the MaybeSource that indicates the timeout by signalling onSuccess + * @param timeoutIndicator the {@code MaybeSource} that indicates the timeout by signaling onSuccess * or onComplete. * @return the new Maybe instance */ @@ -4367,17 +4367,17 @@ public final Maybe timeout(MaybeSource timeoutIndicator) { } /** - * If the current Maybe source didn't signal an event before the timeoutIndicator MaybeSource signals, - * the current Maybe is cancelled and the {@code fallback} MaybeSource subscribed to + * If the current {@code Maybe} didn't signal an event before the {@code timeoutIndicator} {@link MaybeSource} signals, + * the current {@code Maybe} is cancelled and the {@code fallback} {@code MaybeSource} subscribed to * as a continuation. *
*
Scheduler:
*
{@code timeout} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type of the - * @param timeoutIndicator the MaybeSource that indicates the timeout by signalling onSuccess - * or onComplete. - * @param fallback the MaybeSource that is subscribed to if the current Maybe times out + * @param timeoutIndicator the {@code MaybeSource} that indicates the timeout by signaling {@code onSuccess} + * or {@code onComplete}. + * @param fallback the {@code MaybeSource} that is subscribed to if the current {@code Maybe} times out * @return the new Maybe instance */ @CheckReturnValue @@ -4389,8 +4389,8 @@ public final Maybe timeout(MaybeSource timeoutIndicator, MaybeSource *
Backpressure:
*
The {@code timeoutIndicator} {@link Publisher} is consumed in an unbounded manner and @@ -4399,8 +4399,8 @@ public final Maybe timeout(MaybeSource timeoutIndicator, MaybeSource{@code timeout} does not operate by default on a particular {@link Scheduler}.
* * @param the value type of the - * @param timeoutIndicator the MaybeSource that indicates the timeout by signalling onSuccess - * or onComplete. + * @param timeoutIndicator the {@code MaybeSource} that indicates the timeout by signaling {@code onSuccess} + * or {@code onComplete}. * @return the new Maybe instance */ @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) @@ -4412,8 +4412,8 @@ public final Maybe timeout(Publisher timeoutIndicator) { } /** - * If the current Maybe source didn't signal an event before the timeoutIndicator Publisher signals, - * the current Maybe is cancelled and the {@code fallback} MaybeSource subscribed to + * If the current {@code Maybe} didn't signal an event before the {@code timeoutIndicator} {@link Publisher} signals, + * the current {@code Maybe} is cancelled and the {@code fallback} {@code MaybeSource} subscribed to * as a continuation. *
*
Backpressure:
@@ -4423,9 +4423,9 @@ public final Maybe timeout(Publisher timeoutIndicator) { *
{@code timeout} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type of the - * @param timeoutIndicator the MaybeSource that indicates the timeout by signalling onSuccess - * or onComplete - * @param fallback the MaybeSource that is subscribed to if the current Maybe times out + * @param timeoutIndicator the {@code MaybeSource} that indicates the timeout by signaling {@code onSuccess} + * or {@code onComplete} + * @param fallback the {@code MaybeSource} that is subscribed to if the current {@code Maybe} times out * @return the new Maybe instance */ @BackpressureSupport(BackpressureKind.UNBOUNDED_IN) diff --git a/src/main/java/io/reactivex/Single.java b/src/main/java/io/reactivex/Single.java index fd9ad9870b..b3ede60c4e 100644 --- a/src/main/java/io/reactivex/Single.java +++ b/src/main/java/io/reactivex/Single.java @@ -336,7 +336,6 @@ public static Flowable concatArray(SingleSource... sources) * @param sources a sequence of Single that need to be eagerly concatenated * @return the new Flowable instance with the specified concatenation behavior */ - @SuppressWarnings({ "rawtypes", "unchecked" }) @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @@ -362,7 +361,6 @@ public static Flowable concatArrayEager(SingleSource... sour * @param sources a sequence of Publishers that need to be eagerly concatenated * @return the new Publisher instance with the specified concatenation behavior */ - @SuppressWarnings({ "rawtypes", "unchecked" }) @BackpressureSupport(BackpressureKind.FULL) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @@ -386,7 +384,6 @@ public static Flowable concatEager(Publisher Single create(SingleOnSubscribe source) { } /** - * Calls a Callable for each individual SingleObserver to return the actual Single source to + * Calls a {@link Callable} for each individual {@link SingleObserver} to return the actual {@link SingleSource} to * be subscribed to. *
*
Scheduler:
*
{@code defer} does not operate by default on a particular {@link Scheduler}.
*
* @param the value type - * @param singleSupplier the Callable that is called for each individual SingleObserver and + * @param singleSupplier the {@code Callable} that is called for each individual {@code SingleObserver} and * returns a SingleSource instance to subscribe to * @return the new Single instance */ diff --git a/src/test/java/io/reactivex/JavadocWording.java b/src/test/java/io/reactivex/JavadocWording.java index cdc87fe028..41d50e8d25 100644 --- a/src/test/java/io/reactivex/JavadocWording.java +++ b/src/test/java/io/reactivex/JavadocWording.java @@ -866,12 +866,12 @@ static void aOrAn(StringBuilder e, RxMethod m, String wrongPre, String word, Str break; } } - + // remove linebreaks and multi-spaces String javadoc2 = m.javadoc.replace("\n", " ").replace("\r", " ") .replace(" * ", " ") .replaceAll("\\s+", " "); - + // strip {@xxx } tags int kk = 0; for (;;) { @@ -881,12 +881,12 @@ static void aOrAn(StringBuilder e, RxMethod m, String wrongPre, String word, Str } int nn = javadoc2.indexOf(" ", jj + 2); int mm = javadoc2.indexOf("}", jj + 2); - + javadoc2 = javadoc2.substring(0, jj) + javadoc2.substring(nn + 1, mm) + javadoc2.substring(mm + 1); kk = mm + 1; } - + jdx = 0; for (;;) { idx = javadoc2.indexOf(wrongPre + " " + word, jdx); diff --git a/src/test/java/io/reactivex/internal/operators/mixed/ObservableConcatMapMaybeTest.java b/src/test/java/io/reactivex/internal/operators/mixed/ObservableConcatMapMaybeTest.java index 887c18e62e..8fbd2937f1 100644 --- a/src/test/java/io/reactivex/internal/operators/mixed/ObservableConcatMapMaybeTest.java +++ b/src/test/java/io/reactivex/internal/operators/mixed/ObservableConcatMapMaybeTest.java @@ -403,7 +403,7 @@ public void cancelNoConcurrentClean() { @Test public void checkUnboundedInnerQueue() { MaybeSubject ms = MaybeSubject.create(); - + @SuppressWarnings("unchecked") TestObserver to = Observable .fromArray(ms, Maybe.just(2), Maybe.just(3), Maybe.just(4)) diff --git a/src/test/java/io/reactivex/internal/operators/mixed/ObservableConcatMapSingleTest.java b/src/test/java/io/reactivex/internal/operators/mixed/ObservableConcatMapSingleTest.java index 843d05ab2c..bdd4f9e4cc 100644 --- a/src/test/java/io/reactivex/internal/operators/mixed/ObservableConcatMapSingleTest.java +++ b/src/test/java/io/reactivex/internal/operators/mixed/ObservableConcatMapSingleTest.java @@ -340,7 +340,7 @@ public void cancelNoConcurrentClean() { @Test public void checkUnboundedInnerQueue() { SingleSubject ss = SingleSubject.create(); - + @SuppressWarnings("unchecked") TestObserver to = Observable .fromArray(ss, Single.just(2), Single.just(3), Single.just(4)) diff --git a/src/test/java/io/reactivex/internal/operators/single/SingleConcatTest.java b/src/test/java/io/reactivex/internal/operators/single/SingleConcatTest.java index 6031eeeb9e..52d67e742a 100644 --- a/src/test/java/io/reactivex/internal/operators/single/SingleConcatTest.java +++ b/src/test/java/io/reactivex/internal/operators/single/SingleConcatTest.java @@ -108,7 +108,6 @@ public void concatEagerIterableTest() { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void concatEagerPublisherTest() { PublishProcessor pp1 = PublishProcessor.create();