Skip to content

Commit 434d1f4

Browse files
authored
2.x: cleanup for text and javadoc 04/15 (#5286)
1 parent 85e0ea5 commit 434d1f4

10 files changed

+28
-28
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -3566,10 +3566,10 @@ public final Maybe<T> retryUntil(final BooleanSupplier stop) {
35663566
* This retries 3 times, each time incrementing the number of seconds it waits.
35673567
*
35683568
* <pre><code>
3569-
* Publisher.create((Subscriber<? super String> s) -> {
3569+
* Flowable.create((FlowableEmitter<? super String> s) -> {
35703570
* System.out.println("subscribing");
35713571
* s.onError(new RuntimeException("always fails"));
3572-
* }).retryWhen(attempts -> {
3572+
* }, BackpressureStrategy.BUFFER).retryWhen(attempts -> {
35733573
* return attempts.zipWith(Publisher.range(1, 3), (n, i) -> i).flatMap(i -> {
35743574
* System.out.println("delay retry by " + i + " second(s)");
35753575
* return Publisher.timer(i, TimeUnit.SECONDS);

src/main/java/io/reactivex/internal/operators/flowable/FlowableFlattenIterable.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import io.reactivex.annotations.Nullable;
2424
import io.reactivex.exceptions.*;
2525
import io.reactivex.functions.Function;
26+
import io.reactivex.internal.functions.ObjectHelper;
2627
import io.reactivex.internal.fuseable.*;
2728
import io.reactivex.internal.queue.SpscArrayQueue;
2829
import io.reactivex.internal.subscriptions.*;
@@ -298,7 +299,7 @@ void drain() {
298299
R v;
299300

300301
try {
301-
v = it.next();
302+
v = ObjectHelper.requireNonNull(it.next(), "The iterator returned a null value");
302303
} catch (Throwable ex) {
303304
Exceptions.throwIfFatal(ex);
304305
current = null;
@@ -437,7 +438,7 @@ public R poll() throws Exception {
437438
current = it;
438439
}
439440

440-
R r = it.next();
441+
R r = ObjectHelper.requireNonNull(it.next(), "The iterator returned a null value");
441442

442443
if (!it.hasNext()) {
443444
current = null;

src/main/java/io/reactivex/internal/operators/observable/ObservableBlockingSubscribe.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private ObservableBlockingSubscribe() {
3434
/**
3535
* Subscribes to the source and calls the Observer methods on the current thread.
3636
* <p>
37-
* @param o the source publisher
37+
* @param o the source ObservableSource
3838
* The call to dispose() is composed through.
3939
* @param observer the subscriber to forward events and calls to in the current thread
4040
* @param <T> the value type
@@ -70,7 +70,7 @@ public static <T> void subscribe(ObservableSource<? extends T> o, Observer<? sup
7070

7171
/**
7272
* Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
73-
* @param o the source publisher
73+
* @param o the source ObservableSource
7474
* @param <T> the value type
7575
*/
7676
public static <T> void subscribe(ObservableSource<? extends T> o) {
@@ -89,7 +89,7 @@ public static <T> void subscribe(ObservableSource<? extends T> o) {
8989

9090
/**
9191
* Subscribes to the source and calls the given actions on the current thread.
92-
* @param o the source publisher
92+
* @param o the source ObservableSource
9393
* @param onNext the callback action for each source value
9494
* @param onError the callback action for an error event
9595
* @param onComplete the callback action for the completion event.

src/main/java/io/reactivex/internal/operators/observable/ObservableBufferBoundarySupplier.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void onSubscribe(Disposable s) {
8787
ObservableSource<B> boundary;
8888

8989
try {
90-
boundary = ObjectHelper.requireNonNull(boundarySupplier.call(), "The boundary publisher supplied is null");
90+
boundary = ObjectHelper.requireNonNull(boundarySupplier.call(), "The boundary ObservableSource supplied is null");
9191
} catch (Throwable ex) {
9292
Exceptions.throwIfFatal(ex);
9393
cancelled = true;
@@ -179,7 +179,7 @@ void next() {
179179
ObservableSource<B> boundary;
180180

181181
try {
182-
boundary = ObjectHelper.requireNonNull(boundarySupplier.call(), "The boundary publisher supplied is null");
182+
boundary = ObjectHelper.requireNonNull(boundarySupplier.call(), "The boundary ObservableSource supplied is null");
183183
} catch (Throwable ex) {
184184
Exceptions.throwIfFatal(ex);
185185
cancelled = true;

src/main/java/io/reactivex/internal/operators/observable/ObservableDebounce.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void onNext(T t) {
8181
ObservableSource<U> p;
8282

8383
try {
84-
p = ObjectHelper.requireNonNull(debounceSelector.apply(t), "The publisher supplied is null");
84+
p = ObjectHelper.requireNonNull(debounceSelector.apply(t), "The ObservableSource supplied is null");
8585
} catch (Throwable e) {
8686
Exceptions.throwIfFatal(e);
8787
dispose();

src/main/java/io/reactivex/internal/operators/observable/ObservableDefer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public ObservableDefer(Callable<? extends ObservableSource<? extends T>> supplie
2929
public void subscribeActual(Observer<? super T> s) {
3030
ObservableSource<? extends T> pub;
3131
try {
32-
pub = ObjectHelper.requireNonNull(supplier.call(), "null publisher supplied");
32+
pub = ObjectHelper.requireNonNull(supplier.call(), "null ObservableSource supplied");
3333
} catch (Throwable t) {
3434
Exceptions.throwIfFatal(t);
3535
EmptyDisposable.error(t, s);

src/main/java/io/reactivex/internal/operators/observable/ObservableMapNotification.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void onNext(T t) {
8888
ObservableSource<? extends R> p;
8989

9090
try {
91-
p = ObjectHelper.requireNonNull(onNextMapper.apply(t), "The onNext publisher returned is null");
91+
p = ObjectHelper.requireNonNull(onNextMapper.apply(t), "The onNext ObservableSource returned is null");
9292
} catch (Throwable e) {
9393
Exceptions.throwIfFatal(e);
9494
actual.onError(e);
@@ -103,7 +103,7 @@ public void onError(Throwable t) {
103103
ObservableSource<? extends R> p;
104104

105105
try {
106-
p = ObjectHelper.requireNonNull(onErrorMapper.apply(t), "The onError publisher returned is null");
106+
p = ObjectHelper.requireNonNull(onErrorMapper.apply(t), "The onError ObservableSource returned is null");
107107
} catch (Throwable e) {
108108
Exceptions.throwIfFatal(e);
109109
actual.onError(e);
@@ -119,7 +119,7 @@ public void onComplete() {
119119
ObservableSource<? extends R> p;
120120

121121
try {
122-
p = ObjectHelper.requireNonNull(onCompleteSupplier.call(), "The onComplete publisher returned is null");
122+
p = ObjectHelper.requireNonNull(onCompleteSupplier.call(), "The onComplete ObservableSource returned is null");
123123
} catch (Throwable e) {
124124
Exceptions.throwIfFatal(e);
125125
actual.onError(e);

src/main/java/io/reactivex/observables/ConnectableObservable.java

+7-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
package io.reactivex.observables;
1515

1616
import io.reactivex.annotations.NonNull;
17-
import org.reactivestreams.Subscriber;
1817

1918
import io.reactivex.*;
2019
import io.reactivex.disposables.Disposable;
@@ -25,9 +24,9 @@
2524
import io.reactivex.plugins.RxJavaPlugins;
2625

2726
/**
28-
* A {@code ConnectableObservable} resembles an ordinary {@link Flowable}, except that it does not begin
27+
* A {@code ConnectableObservable} resembles an ordinary {@link Observable}, except that it does not begin
2928
* emitting items when it is subscribed to, but only when its {@link #connect} method is called. In this way you
30-
* can wait for all intended {@link Subscriber}s to {@link Flowable#subscribe} to the {@code Observable}
29+
* can wait for all intended {@link Observer}s to {@link Observable#subscribe} to the {@code Observable}
3130
* before the {@code Observable} begins emitting items.
3231
* <p>
3332
* <img width="640" height="510" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/publishConnect.png" alt="">
@@ -41,7 +40,7 @@ public abstract class ConnectableObservable<T> extends Observable<T> {
4140

4241
/**
4342
* Instructs the {@code ConnectableObservable} to begin emitting the items from its underlying
44-
* {@link Flowable} to its {@link Subscriber}s.
43+
* {@link Observable} to its {@link Observer}s.
4544
*
4645
* @param connection
4746
* the action that receives the connection subscription before the subscription to source happens
@@ -52,7 +51,7 @@ public abstract class ConnectableObservable<T> extends Observable<T> {
5251

5352
/**
5453
* Instructs the {@code ConnectableObservable} to begin emitting the items from its underlying
55-
* {@link Flowable} to its {@link Subscriber}s.
54+
* {@link Observable} to its {@link Observer}s.
5655
* <p>
5756
* To disconnect from a synchronous source, use the {@link #connect(Consumer)} method.
5857
*
@@ -79,18 +78,18 @@ public Observable<T> refCount() {
7978

8079
/**
8180
* Returns an Observable that automatically connects to this ConnectableObservable
82-
* when the first Subscriber subscribes.
81+
* when the first Observer subscribes.
8382
*
8483
* @return an Observable that automatically connects to this ConnectableObservable
85-
* when the first Subscriber subscribes
84+
* when the first Observer subscribes
8685
*/
8786
@NonNull
8887
public Observable<T> autoConnect() {
8988
return autoConnect(1);
9089
}
9190
/**
9291
* Returns an Observable that automatically connects to this ConnectableObservable
93-
* when the specified number of Subscribers subscribe to it.
92+
* when the specified number of Observers subscribe to it.
9493
*
9594
* @param numberOfSubscribers the number of subscribers to await before calling connect
9695
* on the ConnectableObservable. A non-positive value indicates

src/main/java/io/reactivex/subjects/SerializedSubject.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
import io.reactivex.plugins.RxJavaPlugins;
2121

2222
/**
23-
* Serializes calls to the Subscriber methods.
24-
* <p>All other Publisher and Subject methods are thread-safe by design.
23+
* Serializes calls to the Observer methods.
24+
* <p>All other Observable and Subject methods are thread-safe by design.
2525
*
2626
* @param <T> the item value type
2727
*/

src/test/java/io/reactivex/single/SingleSubscribeTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public void errorIsDisposed() {
232232
@Test
233233
public void biConsumerIsDisposedOnSuccess() {
234234
final Object[] result = { null, null };
235-
235+
236236
Disposable d = Single.just(1)
237237
.subscribe(new BiConsumer<Integer, Throwable>() {
238238
@Override
@@ -241,7 +241,7 @@ public void accept(Integer t1, Throwable t2) throws Exception {
241241
result[1] = t2;
242242
}
243243
});
244-
244+
245245
assertTrue("Not disposed?!", d.isDisposed());
246246
assertEquals(1, result[0]);
247247
assertNull(result[1]);
@@ -250,7 +250,7 @@ public void accept(Integer t1, Throwable t2) throws Exception {
250250
@Test
251251
public void biConsumerIsDisposedOnError() {
252252
final Object[] result = { null, null };
253-
253+
254254
Disposable d = Single.<Integer>error(new IOException())
255255
.subscribe(new BiConsumer<Integer, Throwable>() {
256256
@Override
@@ -259,7 +259,7 @@ public void accept(Integer t1, Throwable t2) throws Exception {
259259
result[1] = t2;
260260
}
261261
});
262-
262+
263263
assertTrue("Not disposed?!", d.isDisposed());
264264
assertNull(result[0]);
265265
assertTrue("" + result[1], result[1] instanceof IOException);

0 commit comments

Comments
 (0)