Skip to content

Commit e43c914

Browse files
committed
Cleanup code style
1 parent 33f48fe commit e43c914

File tree

267 files changed

+4539
-1723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+4539
-1723
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1695,11 +1695,11 @@ Map the upstream signals onto some reactive type and relay its events to the dow
16951695

16961696
Availability:
16971697

1698-
- `Flowables.flatMap{Completable|Single|Maybe}`
1699-
- `Observables.flatMap{Completable|Single|Maybe}`
1698+
<!-- - `Flowables.flatMap{Completable|Single|Maybe}` -->
1699+
<!-- - `Observables.flatMap{Completable|Single|Maybe}` -->
17001700
- `Single`
17011701
- `SingleTransformers.flatMap` (use with `Single.compose()`)
1702-
- `Singles.flatMapSingle` (use with `Single.as()`)
1702+
- `Singles.flatMapCompletable` (use with `Single.as()`)
17031703
- `Singles.flatMapMaybe` (use with `Single.as()`)
17041704
- `Singles.flatMapObservable` (use with `Single.as()`)
17051705
- `Singles.flatMapFlowable` (use with `Single.as()`)

gradle/javadocStyleSheet.css

-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ code { color: #777; line-height: 1.286em; font-family: "Consolas", "Lucida Conso
1515
a { text-decoration: none; color: #16569A; /* also try #2E85ED, #0033FF, #6C93C6, #1D7BBE, #1D8DD2 */ }
1616
a:hover { text-decoration: underline; }
1717

18-
1918
table[border="1"] { border: 1px solid #ddd; }
2019
table[border="1"] td, table[border="1"] th { border: 1px solid #ddd; }
2120
table[cellpadding="3"] td { padding: 0.5em; }
@@ -47,7 +46,6 @@ h2.title { color: #c81f08; }
4746
text-decoration: underline;
4847
}
4948

50-
5149
/* Navigation bar fonts and colors */
5250
.NavBarCell1 { background-color:#E0E6DF; } /* Light mauve */
5351
.NavBarCell1Rev { background-color:#16569A; color:#FFFFFF} /* Dark Blue */

src/jmh/java/hu/akarnokd/rxjava2/FlatMapExPerf.java

-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ public void asyncAsync(Blackhole bh) {
174174
c.await(count * range);
175175
}
176176

177-
178177
@Benchmark
179178
public void syncSyncB(Blackhole bh) {
180179
PerfConsumer c = new PerfConsumer(bh);

src/main/java/hu/akarnokd/rxjava2/async/AsyncFlowable.java

-5
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,6 @@ public static <T> Future<Object> forEachFuture(
15751575
return forEachFuture(source, onNext, Functions.emptyConsumer(), Functions.EMPTY_ACTION, Schedulers.computation());
15761576
}
15771577

1578-
15791578
/**
15801579
* Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion
15811580
* or error through a Future.
@@ -1606,7 +1605,6 @@ public static <T> Future<Object> forEachFuture(
16061605
return forEachFuture(source, onNext, onError, Functions.EMPTY_ACTION, Schedulers.computation());
16071606
}
16081607

1609-
16101608
/**
16111609
* Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion
16121610
* or error through a Future.
@@ -1639,7 +1637,6 @@ public static <T> Future<Object> forEachFuture(
16391637
return forEachFuture(source, onNext, onError, onComplete, Schedulers.computation());
16401638
}
16411639

1642-
16431640
/**
16441641
* Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion
16451642
* or error through a Future, scheduled on the given scheduler.
@@ -1666,7 +1663,6 @@ public static <T> Future<Object> forEachFuture(
16661663
return forEachFuture(source, onNext, Functions.emptyConsumer(), Functions.EMPTY_ACTION, scheduler);
16671664
}
16681665

1669-
16701666
/**
16711667
* Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion
16721668
* or error through a Future, scheduled on the given Scheduler.
@@ -1695,7 +1691,6 @@ public static <T> Future<Object> forEachFuture(
16951691
return forEachFuture(source, onNext, onError, Functions.EMPTY_ACTION, scheduler);
16961692
}
16971693

1698-
16991694
/**
17001695
* Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion
17011696
* or error through a Future, scheduled on the given Scheduler.

src/main/java/hu/akarnokd/rxjava2/async/AsyncObservable.java

+3-9
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ private AsyncObservable() {
4141
throw new IllegalStateException("No instances!");
4242
}
4343

44-
4544
/**
4645
* Invokes the specified function asynchronously and returns an Observable that emits the result.
4746
* <p>
@@ -1472,7 +1471,6 @@ public static <T> Future<Object> forEachFuture(
14721471
return forEachFuture(source, onNext, Functions.emptyConsumer(), Functions.EMPTY_ACTION, Schedulers.computation());
14731472
}
14741473

1475-
14761474
/**
14771475
* Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion
14781476
* or error through a Future.
@@ -1501,7 +1499,6 @@ public static <T> Future<Object> forEachFuture(
15011499
return forEachFuture(source, onNext, onError, Functions.EMPTY_ACTION, Schedulers.computation());
15021500
}
15031501

1504-
15051502
/**
15061503
* Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion
15071504
* or error through a Future.
@@ -1532,7 +1529,6 @@ public static <T> Future<Object> forEachFuture(
15321529
return forEachFuture(source, onNext, onError, onComplete, Schedulers.computation());
15331530
}
15341531

1535-
15361532
/**
15371533
* Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion
15381534
* or error through a Future, scheduled on the given scheduler.
@@ -1557,7 +1553,6 @@ public static <T> Future<Object> forEachFuture(
15571553
return forEachFuture(source, onNext, Functions.emptyConsumer(), Functions.EMPTY_ACTION, scheduler);
15581554
}
15591555

1560-
15611556
/**
15621557
* Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion
15631558
* or error through a Future, scheduled on the given Scheduler.
@@ -1584,7 +1579,6 @@ public static <T> Future<Object> forEachFuture(
15841579
return forEachFuture(source, onNext, onError, Functions.EMPTY_ACTION, scheduler);
15851580
}
15861581

1587-
15881582
/**
15891583
* Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion
15901584
* or error through a Future, scheduled on the given Scheduler.
@@ -1641,7 +1635,7 @@ public void run() throws Exception {
16411635
}
16421636
}, new Consumer<Disposable>() {
16431637
@Override
1644-
public void accept(Disposable s) throws Exception {
1638+
public void accept(Disposable d) throws Exception {
16451639
}
16461640
});
16471641
d.lazySet(ls);
@@ -1710,8 +1704,8 @@ public void run() {
17101704

17111705
return new DisposableObservable<T>() {
17121706
@Override
1713-
protected void subscribeActual(Observer<? super T> s) {
1714-
subject.subscribe(s);
1707+
protected void subscribeActual(Observer<? super T> observer) {
1708+
subject.subscribe(observer);
17151709
}
17161710

17171711
@Override

src/main/java/hu/akarnokd/rxjava2/async/FlowableFromCallableNull.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ static final class CallableNullSubscription<T> extends DeferredScalarSubscriptio
7575

7676
private static final long serialVersionUID = -7088349936918117528L;
7777

78-
CallableNullSubscription(Subscriber<? super T> actual) {
79-
super(actual);
78+
CallableNullSubscription(Subscriber<? super T> downstream) {
79+
super(downstream);
8080
}
8181

8282
}

src/main/java/hu/akarnokd/rxjava2/async/ObservableFromCallableNull.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ final class ObservableFromCallableNull<T> extends Observable<T> implements Calla
3636
}
3737

3838
@Override
39-
protected void subscribeActual(Observer<? super T> s) {
40-
CallableNullDisposable<T> deferred = new CallableNullDisposable<T>(s);
41-
s.onSubscribe(deferred);
39+
protected void subscribeActual(Observer<? super T> observer) {
40+
CallableNullDisposable<T> deferred = new CallableNullDisposable<T>(observer);
41+
observer.onSubscribe(deferred);
4242

4343
if (!deferred.isDisposed()) {
4444

@@ -49,14 +49,14 @@ protected void subscribeActual(Observer<? super T> s) {
4949
} catch (Throwable ex) {
5050
Exceptions.throwIfFatal(ex);
5151
if (!deferred.isDisposed()) {
52-
s.onError(ex);
52+
observer.onError(ex);
5353
}
5454
return;
5555
}
5656

5757
if (!deferred.isDisposed()) {
5858
if (v == null) {
59-
s.onComplete();
59+
observer.onComplete();
6060
} else {
6161
deferred.complete(v);
6262
}
@@ -73,8 +73,8 @@ static final class CallableNullDisposable<T> extends DeferredScalarDisposable<T>
7373

7474
private static final long serialVersionUID = -7088349936918117528L;
7575

76-
CallableNullDisposable(Observer<? super T> actual) {
77-
super(actual);
76+
CallableNullDisposable(Observer<? super T> downstream) {
77+
super(downstream);
7878
}
7979

8080
}

src/main/java/hu/akarnokd/rxjava2/basetypes/BasicNonoSubscriber.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@
2525
*/
2626
abstract class BasicNonoSubscriber extends BasicEmptyQueueSubscription implements Subscriber<Object> {
2727

28-
protected final Subscriber<? super Void> actual;
28+
protected final Subscriber<? super Void> downstream;
2929

30-
protected Subscription s;
30+
protected Subscription upstream;
3131

32-
BasicNonoSubscriber(Subscriber<? super Void> actual) {
33-
this.actual = actual;
32+
BasicNonoSubscriber(Subscriber<? super Void> downstream) {
33+
this.downstream = downstream;
3434
}
3535

3636
@Override
3737
public void onSubscribe(Subscription s) {
38-
if (SubscriptionHelper.validate(this.s, s)) {
39-
this.s = s;
38+
if (SubscriptionHelper.validate(this.upstream, s)) {
39+
this.upstream = s;
4040

41-
actual.onSubscribe(this);
41+
downstream.onSubscribe(this);
4242
}
4343
}
4444

@@ -49,7 +49,7 @@ public final void onNext(Object t) {
4949

5050
@Override
5151
public void cancel() {
52-
s.cancel();
52+
upstream.cancel();
5353
}
5454

5555
}

src/main/java/hu/akarnokd/rxjava2/basetypes/BasicRefNonoSubscriber.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@
2828
abstract class BasicRefNonoSubscriber<R> extends BasicRefQueueSubscription<Void, R> implements Subscriber<Void> {
2929
private static final long serialVersionUID = -3157015053656142804L;
3030

31-
protected final Subscriber<? super Void> actual;
31+
protected final Subscriber<? super Void> downstream;
3232

33-
Subscription s;
33+
Subscription upstream;
3434

35-
BasicRefNonoSubscriber(Subscriber<? super Void> actual) {
36-
this.actual = actual;
35+
BasicRefNonoSubscriber(Subscriber<? super Void> downstream) {
36+
this.downstream = downstream;
3737
}
3838

3939
@Override
4040
public void onSubscribe(Subscription s) {
41-
if (SubscriptionHelper.validate(this.s, s)) {
42-
this.s = s;
41+
if (SubscriptionHelper.validate(this.upstream, s)) {
42+
this.upstream = s;
4343

44-
actual.onSubscribe(this);
44+
downstream.onSubscribe(this);
4545
}
4646
}
4747

@@ -52,7 +52,7 @@ public final void onNext(Void t) {
5252

5353
@Override
5454
public void cancel() {
55-
s.cancel();
55+
upstream.cancel();
5656
}
5757

5858
@Override

src/main/java/hu/akarnokd/rxjava2/basetypes/BasicRefQueueSubscription.java

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
*/
2929
abstract class BasicRefQueueSubscription<T, R> extends AtomicReference<R> implements QueueSubscription<T> {
3030

31-
3231
private static final long serialVersionUID = -6671519529404341862L;
3332

3433
@Override

src/main/java/hu/akarnokd/rxjava2/basetypes/BlockingGetSubscriber.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class BlockingGetSubscriber<T> extends CountDownLatch implements Subscribe
3535

3636
volatile boolean cancelled;
3737

38-
Subscription s;
38+
Subscription upstream;
3939

4040
T value;
4141
Throwable error;
@@ -46,8 +46,8 @@ final class BlockingGetSubscriber<T> extends CountDownLatch implements Subscribe
4646

4747
@Override
4848
public void onSubscribe(Subscription s) {
49-
if (SubscriptionHelper.validate(this.s, s)) {
50-
this.s = s;
49+
if (SubscriptionHelper.validate(this.upstream, s)) {
50+
this.upstream = s;
5151
if (cancelled) {
5252
s.cancel();
5353
} else {
@@ -74,7 +74,7 @@ public void onComplete() {
7474

7575
void dispose() {
7676
cancelled = true;
77-
Subscription a = s;
77+
Subscription a = upstream;
7878
if (a != null) {
7979
a.cancel();
8080
}

src/main/java/hu/akarnokd/rxjava2/basetypes/FuturePerhapsSubscriber.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@ final class FuturePerhapsSubscriber<T> extends CountDownLatch
3636
T value;
3737
Throwable error;
3838

39-
final AtomicReference<Subscription> s;
39+
final AtomicReference<Subscription> upstream;
4040

4141
FuturePerhapsSubscriber() {
4242
super(1);
43-
this.s = new AtomicReference<Subscription>();
43+
this.upstream = new AtomicReference<Subscription>();
4444
}
4545

4646
@Override
4747
public boolean cancel(boolean mayInterruptIfRunning) {
4848
for (;;) {
49-
Subscription a = s.get();
49+
Subscription a = upstream.get();
5050
if (a == this || a == SubscriptionHelper.CANCELLED) {
5151
return false;
5252
}
5353

54-
if (s.compareAndSet(a, SubscriptionHelper.CANCELLED)) {
54+
if (upstream.compareAndSet(a, SubscriptionHelper.CANCELLED)) {
5555
if (a != null) {
5656
a.cancel();
5757
}
@@ -63,7 +63,7 @@ public boolean cancel(boolean mayInterruptIfRunning) {
6363

6464
@Override
6565
public boolean isCancelled() {
66-
return SubscriptionHelper.isCancelled(s.get());
66+
return SubscriptionHelper.isCancelled(upstream.get());
6767
}
6868

6969
@Override
@@ -108,7 +108,7 @@ public T get(long timeout, TimeUnit unit) throws InterruptedException, Execution
108108

109109
@Override
110110
public void onSubscribe(Subscription s) {
111-
if (SubscriptionHelper.setOnce(this.s, s)) {
111+
if (SubscriptionHelper.setOnce(this.upstream, s)) {
112112
s.request(Long.MAX_VALUE);
113113
}
114114
}
@@ -121,13 +121,13 @@ public void onNext(T t) {
121121
@Override
122122
public void onError(Throwable t) {
123123
for (;;) {
124-
Subscription a = s.get();
124+
Subscription a = upstream.get();
125125
if (a == this || a == SubscriptionHelper.CANCELLED) {
126126
RxJavaPlugins.onError(t);
127127
return;
128128
}
129129
error = t;
130-
if (s.compareAndSet(a, this)) {
130+
if (upstream.compareAndSet(a, this)) {
131131
countDown();
132132
return;
133133
}
@@ -137,11 +137,11 @@ public void onError(Throwable t) {
137137
@Override
138138
public void onComplete() {
139139
for (;;) {
140-
Subscription a = s.get();
140+
Subscription a = upstream.get();
141141
if (a == this || a == SubscriptionHelper.CANCELLED) {
142142
return;
143143
}
144-
if (s.compareAndSet(a, this)) {
144+
if (upstream.compareAndSet(a, this)) {
145145
countDown();
146146
return;
147147
}

0 commit comments

Comments
 (0)