Skip to content

Commit 0a07ac1

Browse files
authored
2.x: cleanup based on IntelliJ 2017.1 inspections (#5222)
* 2.x: cleanup based on IntelliJ 2017.1 inspections * Restore indexed for-loop and make other loops indexed as well.
1 parent 3f6e570 commit 0a07ac1

40 files changed

+223
-279
lines changed

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

Lines changed: 59 additions & 59 deletions
Large diffs are not rendered by default.

src/main/java/io/reactivex/FlowableEmitter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ public interface FlowableEmitter<T> extends Emitter<T> {
3333

3434
/**
3535
* Sets a Disposable on this emitter; any previous Disposable
36-
* or Cancellation will be unsubscribed/cancelled.
36+
* or Cancellation will be disposed/cancelled.
3737
* @param s the disposable, null is allowed
3838
*/
3939
void setDisposable(@Nullable Disposable s);
4040

4141
/**
4242
* Sets a Cancellable on this emitter; any previous Disposable
43-
* or Cancellation will be unsubscribed/cancelled.
43+
* or Cancellation will be disposed/cancelled.
4444
* @param c the cancellable resource, null is allowed
4545
*/
4646
void setCancellable(@Nullable Cancellable c);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ public static <T> Maybe<T> fromCallable(final Callable<? extends T> callable) {
660660
* return value of the {@link Future#get} method of that object, by passing the object into the {@code from}
661661
* method.
662662
* <p>
663-
* <em>Important note:</em> This Maybe is blocking; you cannot unsubscribe from it.
663+
* <em>Important note:</em> This Maybe is blocking; you cannot dispose it.
664664
* <p>
665665
* Unlike 1.x, cancelling the Maybe won't cancel the future. If necessary, one can use composition to achieve the
666666
* cancellation effect: {@code futureMaybe.doOnDispose(() -> future.cancel(true));}.
@@ -696,7 +696,7 @@ public static <T> Maybe<T> fromFuture(Future<? extends T> future) {
696696
* Unlike 1.x, cancelling the Maybe won't cancel the future. If necessary, one can use composition to achieve the
697697
* cancellation effect: {@code futureMaybe.doOnCancel(() -> future.cancel(true));}.
698698
* <p>
699-
* <em>Important note:</em> This Maybe is blocking on the thread it gets subscribed on; you cannot unsubscribe from it.
699+
* <em>Important note:</em> This Maybe is blocking on the thread it gets subscribed on; you cannot dispose it.
700700
* <dl>
701701
* <dt><b>Scheduler:</b></dt>
702702
* <dd>{@code fromFuture} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -2036,7 +2036,7 @@ public final T blockingGet(T defaultValue) {
20362036
* The operator subscribes only when the first downstream subscriber subscribes and maintains
20372037
* a single subscription towards this Maybe.
20382038
* <p>
2039-
* <em>Note:</em> You sacrifice the ability to unsubscribe from the origin when you use the {@code cache}.
2039+
* <em>Note:</em> You sacrifice the ability to dispose the origin when you use the {@code cache}.
20402040
* <dl>
20412041
* <dt><b>Scheduler:</b></dt>
20422042
* <dd>{@code cache} does not operate by default on a particular {@link Scheduler}.</dd>

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

Lines changed: 53 additions & 53 deletions
Large diffs are not rendered by default.

src/main/java/io/reactivex/Scheduler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public Disposable schedulePeriodicallyDirect(@NonNull Runnable run, long initial
199199
* size thread pool:
200200
*
201201
* <pre>
202-
* Scheduler limitSched = Schedulers.computation().when(workers -> {
202+
* Scheduler limitScheduler = Schedulers.computation().when(workers -> {
203203
* // use merge max concurrent to limit the number of concurrent
204204
* // callbacks two at a time
205205
* return Completable.merge(Flowable.merge(workers), 2);
@@ -217,7 +217,7 @@ public Disposable schedulePeriodicallyDirect(@NonNull Runnable run, long initial
217217
* subscription to the second.
218218
*
219219
* <pre>
220-
* Scheduler limitSched = Schedulers.computation().when(workers -> {
220+
* Scheduler limitScheduler = Schedulers.computation().when(workers -> {
221221
* // use merge max concurrent to limit the number of concurrent
222222
* // Flowables two at a time
223223
* return Completable.merge(Flowable.merge(workers, 2));
@@ -230,7 +230,7 @@ public Disposable schedulePeriodicallyDirect(@NonNull Runnable run, long initial
230230
* bucket algorithm).
231231
*
232232
* <pre>
233-
* Scheduler slowSched = Schedulers.computation().when(workers -> {
233+
* Scheduler slowScheduler = Schedulers.computation().when(workers -> {
234234
* // use concatenate to make each worker happen one at a time.
235235
* return Completable.concat(workers.map(actions -> {
236236
* // delay the starting of the next worker by 1 second.
@@ -254,7 +254,7 @@ public <S extends Scheduler & Disposable> S when(@NonNull Function<Flowable<Flow
254254
/**
255255
* Sequential Scheduler for executing actions on a single thread or event loop.
256256
* <p>
257-
* Unsubscribing the {@link Worker} cancels all outstanding work and allows resource cleanup.
257+
* Disposing the {@link Worker} cancels all outstanding work and allows resource cleanup.
258258
*/
259259
public abstract static class Worker implements Disposable {
260260
/**

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ public static <T> Single<T> fromCallable(final Callable<? extends T> callable) {
457457
* value of the {@link Future#get} method of that object, by passing the object into the {@code from}
458458
* method.
459459
* <p>
460-
* <em>Important note:</em> This Single is blocking; you cannot unsubscribe from it.
460+
* <em>Important note:</em> This Single is blocking; you cannot dispose it.
461461
* <dl>
462462
* <dt><b>Scheduler:</b></dt>
463463
* <dd>{@code fromFuture} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -486,7 +486,7 @@ public static <T> Single<T> fromFuture(Future<? extends T> future) {
486486
* the return value of the {@link Future#get} method of that object, by passing the object into the
487487
* {@code from} method.
488488
* <p>
489-
* <em>Important note:</em> This {@code Single} is blocking; you cannot unsubscribe from it.
489+
* <em>Important note:</em> This {@code Single} is blocking; you cannot dispose it.
490490
* <dl>
491491
* <dt><b>Scheduler:</b></dt>
492492
* <dd>{@code fromFuture} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -519,7 +519,7 @@ public static <T> Single<T> fromFuture(Future<? extends T> future, long timeout,
519519
* the return value of the {@link Future#get} method of that object, by passing the object into the
520520
* {@code from} method.
521521
* <p>
522-
* <em>Important note:</em> This {@code Single} is blocking; you cannot unsubscribe from it.
522+
* <em>Important note:</em> This {@code Single} is blocking; you cannot dispose it.
523523
* <dl>
524524
* <dt><b>Scheduler:</b></dt>
525525
* <dd>You specify the {@link Scheduler} where the blocking wait will happen.</dd>

src/main/java/io/reactivex/exceptions/CompositeException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public final class CompositeException extends RuntimeException {
4949
*/
5050
public CompositeException(Throwable... exceptions) {
5151
this(exceptions == null ?
52-
Arrays.asList(new NullPointerException("exceptions was null")) : Arrays.asList(exceptions));
52+
Collections.singletonList(new NullPointerException("exceptions was null")) : Arrays.asList(exceptions));
5353
}
5454

5555
/**
@@ -129,7 +129,7 @@ public synchronized Throwable getCause() { // NOPMD
129129
chain.initCause(e);
130130
} catch (Throwable t) { // NOPMD
131131
// ignore
132-
// the javadocs say that some Throwables (depending on how they're made) will never
132+
// the JavaDocs say that some Throwables (depending on how they're made) will never
133133
// let me call initCause without blowing up even if it returns null
134134
}
135135
chain = getRootCause(chain);

src/main/java/io/reactivex/internal/fuseable/SimplePlainQueue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* Override of the SimpleQueue interface with no throws Exception on poll().
2020
*
21-
* @param <T> the value type to enqueue and dequeue, not null
21+
* @param <T> the value type to offer and poll, not null
2222
*/
2323
public interface SimplePlainQueue<T> extends SimpleQueue<T> {
2424

src/main/java/io/reactivex/internal/fuseable/SimpleQueue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* A minimalist queue interface without the method bloat of java.util.Collection and java.util.Queue.
2020
*
21-
* @param <T> the value type to enqueue and dequeue, not null
21+
* @param <T> the value type to offer and poll, not null
2222
*/
2323
public interface SimpleQueue<T> {
2424

src/main/java/io/reactivex/internal/operators/completable/CompletableAmb.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void subscribeActual(final CompletableObserver s) {
4848
sources = b;
4949
}
5050
sources[count++] = element;
51-
};
51+
}
5252
} catch (Throwable e) {
5353
Exceptions.throwIfFatal(e);
5454
EmptyDisposable.error(e, s);

0 commit comments

Comments
 (0)