Skip to content

Commit b5b27d4

Browse files
authored
2.x: Fix some grammar mistakes (ReactiveX#5959)
* 2.x: Fix some grammar mistakes * Fix additional a/an mistakes
1 parent ca535ba commit b5b27d4

File tree

9 files changed

+279
-240
lines changed

9 files changed

+279
-240
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ public final Completable doFinally(Action onFinally) {
13971397
*
13981398
* public final class CustomCompletableObserver implements CompletableObserver, Disposable {
13991399
*
1400-
* // The donstream's CompletableObserver that will receive the onXXX events
1400+
* // The downstream's CompletableObserver that will receive the onXXX events
14011401
* final CompletableObserver downstream;
14021402
*
14031403
* // The connection to the upstream source that will call this class' onXXX methods

src/main/java/io/reactivex/Flowable.java

+230-230
Large diffs are not rendered by default.

src/main/java/io/reactivex/Maybe.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -2978,7 +2978,7 @@ public final <R> Observable<R> flatMapObservable(Function<? super T, ? extends O
29782978
*
29792979
* @param <R> the result value type
29802980
* @param mapper
2981-
* a function that, when applied to the item emitted by the source Maybe, returns an
2981+
* a function that, when applied to the item emitted by the source Maybe, returns a
29822982
* Flowable
29832983
* @return the Flowable returned from {@code func} when applied to the item emitted by the source Maybe
29842984
* @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
@@ -3139,7 +3139,7 @@ public final Single<Boolean> isEmpty() {
31393139
*
31403140
* public final class CustomMaybeObserver&lt;T&gt; implements MaybeObserver&lt;T&gt;, Disposable {
31413141
*
3142-
* // The donstream's MaybeObserver that will receive the onXXX events
3142+
* // The downstream's MaybeObserver that will receive the onXXX events
31433143
* final MaybeObserver&lt;? super String&gt; downstream;
31443144
*
31453145
* // The connection to the upstream source that will call this class' onXXX methods

src/main/java/io/reactivex/Observable.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -9386,7 +9386,7 @@ public final Single<T> lastOrError() {
93869386
*
93879387
* public final class CustomObserver&lt;T&gt; implements Observer&lt;T&gt;, Disposable {
93889388
*
9389-
* // The donstream's Observer that will receive the onXXX events
9389+
* // The downstream's Observer that will receive the onXXX events
93909390
* final Observer&lt;? super String&gt; downstream;
93919391
*
93929392
* // The connection to the upstream source that will call this class' onXXX methods
@@ -12250,7 +12250,7 @@ public final Completable switchMapCompletable(@NonNull Function<? super T, ? ext
1225012250
* <dd>Errors of this {@code Observable} and all the {@code CompletableSource}s, who had the chance
1225112251
* to run to their completion, are delayed until
1225212252
* all of them terminate in some fashion. At this point, if there was only one failure, the respective
12253-
* {@code Throwable} is emitted to the dowstream. It there were more than one failures, the
12253+
* {@code Throwable} is emitted to the downstream. It there were more than one failures, the
1225412254
* operator combines all {@code Throwable}s into a {@link io.reactivex.exceptions.CompositeException CompositeException}
1225512255
* and signals that to the downstream.
1225612256
* If any inactivated (switched out) {@code CompletableSource}

src/main/java/io/reactivex/Single.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -2365,7 +2365,7 @@ public final <R> Maybe<R> flatMapMaybe(final Function<? super T, ? extends Maybe
23652365
*
23662366
* @param <R> the result value type
23672367
* @param mapper
2368-
* a function that, when applied to the item emitted by the source Single, returns an
2368+
* a function that, when applied to the item emitted by the source Single, returns a
23692369
* Flowable
23702370
* @return the Flowable returned from {@code func} when applied to the item emitted by the source Single
23712371
* @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
@@ -2517,7 +2517,7 @@ public final T blockingGet() {
25172517
*
25182518
* public final class CustomSingleObserver&lt;T&gt; implements SingleObserver&lt;T&gt;, Disposable {
25192519
*
2520-
* // The donstream's SingleObserver that will receive the onXXX events
2520+
* // The downstream's SingleObserver that will receive the onXXX events
25212521
* final SingleObserver&lt;? super String&gt; downstream;
25222522
*
25232523
* // The connection to the upstream source that will call this class' onXXX methods

src/main/java/io/reactivex/internal/operators/mixed/FlowableConcatMapCompletable.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import io.reactivex.plugins.RxJavaPlugins;
3232

3333
/**
34-
* Maps the upstream intems into {@link CompletableSource}s and subscribes to them one after the
34+
* Maps the upstream items into {@link CompletableSource}s and subscribes to them one after the
3535
* other completes or terminates (in error-delaying mode).
3636
* @param <T> the upstream value type
3737
* @since 2.1.11 - experimental

src/main/java/io/reactivex/internal/operators/mixed/ObservableConcatMapCompletable.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import io.reactivex.plugins.RxJavaPlugins;
2929

3030
/**
31-
* Maps the upstream intems into {@link CompletableSource}s and subscribes to them one after the
31+
* Maps the upstream items into {@link CompletableSource}s and subscribes to them one after the
3232
* other completes or terminates (in error-delaying mode).
3333
* @param <T> the upstream value type
3434
* @since 2.1.11 - experimental

src/main/java/io/reactivex/processors/ReplayProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* <p>
5050
* <img width="640" height="415" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/ReplayProcessor.t.png" alt="">
5151
* </li>
52-
* <li>{@link #createWithTimeAndSize(long, TimeUnit, Scheduler, int)}: retaims no more than the given number of items
52+
* <li>{@link #createWithTimeAndSize(long, TimeUnit, Scheduler, int)}: retains no more than the given number of items
5353
* which are also no older than the specified time and replays them to new {@code Subscriber}s (which could mean all items age out).
5454
* <p>
5555
* <img width="640" height="404" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/ReplayProcessor.nt.png" alt="">

src/test/java/io/reactivex/JavadocWording.java

+39
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,7 @@ static void aOrAn(StringBuilder e, RxMethod m, String wrongPre, String word, Str
816816
}
817817
}
818818

819+
jdx = 0;
819820
for (;;) {
820821
idx = m.javadoc.indexOf(wrongPre + " {@link " + word, jdx);
821822
if (idx >= 0) {
@@ -832,6 +833,7 @@ static void aOrAn(StringBuilder e, RxMethod m, String wrongPre, String word, Str
832833
}
833834
}
834835

836+
jdx = 0;
835837
for (;;) {
836838
idx = m.javadoc.indexOf(wrongPre + " {@linkplain " + word, jdx);
837839
if (idx >= 0) {
@@ -848,6 +850,7 @@ static void aOrAn(StringBuilder e, RxMethod m, String wrongPre, String word, Str
848850
}
849851
}
850852

853+
jdx = 0;
851854
for (;;) {
852855
idx = m.javadoc.indexOf(wrongPre + " {@code " + word, jdx);
853856
if (idx >= 0) {
@@ -863,7 +866,43 @@ static void aOrAn(StringBuilder e, RxMethod m, String wrongPre, String word, Str
863866
break;
864867
}
865868
}
869+
870+
// remove linebreaks and multi-spaces
871+
String javadoc2 = m.javadoc.replace("\n", " ").replace("\r", " ")
872+
.replace(" * ", " ")
873+
.replaceAll("\\s+", " ");
874+
875+
// strip {@xxx } tags
876+
int kk = 0;
877+
for (;;) {
878+
int jj = javadoc2.indexOf("{@", kk);
879+
if (jj < 0) {
880+
break;
881+
}
882+
int nn = javadoc2.indexOf(" ", jj + 2);
883+
int mm = javadoc2.indexOf("}", jj + 2);
884+
885+
javadoc2 = javadoc2.substring(0, jj) + javadoc2.substring(nn + 1, mm) + javadoc2.substring(mm + 1);
866886

887+
kk = mm + 1;
888+
}
889+
890+
jdx = 0;
891+
for (;;) {
892+
idx = javadoc2.indexOf(wrongPre + " " + word, jdx);
893+
if (idx >= 0) {
894+
e.append("java.lang.RuntimeException: a/an typo ")
895+
.append(word)
896+
.append("\r\n at io.reactivex.")
897+
.append(baseTypeName)
898+
.append(" (")
899+
.append(baseTypeName)
900+
.append(".java:").append(m.javadocLine).append(")\r\n\r\n");
901+
jdx = idx + wrongPre.length() + 1 + word.length();
902+
} else {
903+
break;
904+
}
905+
}
867906
}
868907

869908
static void missingClosingDD(StringBuilder e, RxMethod m, String baseTypeName) {

0 commit comments

Comments
 (0)