Skip to content

Commit dde2c0e

Browse files
committed
Fix code style
1 parent e0122a4 commit dde2c0e

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12696,10 +12696,12 @@ public final Flowable<T> onBackpressureLatest() {
1269612696
* <dd>{@code onBackpressureReduce} does not operate by default on a particular {@link Scheduler}.</dd>
1269712697
* </dl>
1269812698
* @param reducer the bi-function to call when there is more than one non-emitted value to downstream,
12699-
* the first argument of the bi-function is previous item and the second one is currently emitting from upstream
12699+
* the first argument of the bi-function is previous item and the second one is currently
12700+
* emitting from upstream
1270012701
* @return the new {@code Flowable} instance
1270112702
* @throws NullPointerException if {@code reducer} is {@code null}
1270212703
* @since 3.0.9 - experimental
12704+
* @see #onBackpressureReduce(Supplier, BiFunction)
1270312705
*/
1270412706
@Experimental
1270512707
@CheckReturnValue
@@ -12732,11 +12734,13 @@ public final Flowable<T> onBackpressureReduce(@NonNull BiFunction<T, T, T> reduc
1273212734
* <dt><b>Scheduler:</b></dt>
1273312735
* <dd>{@code onBackpressureReduce} does not operate by default on a particular {@link Scheduler}.</dd>
1273412736
* </dl>
12737+
* @param <R> the aggregate type emitted when the downstream requests more items
1273512738
* @param supplier the factory to call to create new item of type R to pass it as the first argument to {@code reducer}.
12736-
* It is called when previous returned value by {@code reducer} already sent to downstream or the very first update from upstream received.
12739+
* It is called when previous returned value by {@code reducer} already sent to
12740+
* downstream or the very first update from upstream received.
1273712741
* @param reducer the bi-function to call to reduce excessive updates which downstream is not ready to receive.
12738-
* The first argument of type R is the object returned by {@code supplier} or result of previous {@code reducer} invocation.
12739-
* The second argument of type T is the current update from upstream.
12742+
* The first argument of type R is the object returned by {@code supplier} or result of previous
12743+
* {@code reducer} invocation. The second argument of type T is the current update from upstream.
1274012744
* @return the new {@code Flowable} instance
1274112745
* @throws NullPointerException if {@code supplier} or {@code reducer} is {@code null}
1274212746
* @see #onBackpressureReduce(BiFunction)

src/main/java/io/reactivex/rxjava3/internal/operators/flowable/AbstractBackpressureThrottlingSubscriber.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import io.reactivex.rxjava3.core.FlowableSubscriber;
1717
import io.reactivex.rxjava3.internal.subscriptions.SubscriptionHelper;
1818
import io.reactivex.rxjava3.internal.util.BackpressureHelper;
19-
import org.reactivestreams.Publisher;
2019
import org.reactivestreams.Subscriber;
2120
import org.reactivestreams.Subscription;
2221

@@ -26,13 +25,15 @@
2625

2726
/**
2827
* Abstract base class for operators that throttle excessive updates from upstream in case if
29-
* downstream {@link Subscriber} is not ready to receive updates
28+
* downstream {@link Subscriber} is not ready to receive updates.
3029
*
3130
* @param <T> the upstream value type
3231
* @param <R> the downstream value type
3332
*/
3433
abstract class AbstractBackpressureThrottlingSubscriber<T, R> extends AtomicInteger implements FlowableSubscriber<T>, Subscription {
3534

35+
private static final long serialVersionUID = -5050301752721603566L;
36+
3637
final Subscriber<? super R> downstream;
3738

3839
Subscription upstream;
@@ -60,7 +61,7 @@ public void onSubscribe(Subscription s) {
6061
}
6162

6263
@Override
63-
abstract public void onNext(T t);
64+
public abstract void onNext(T t);
6465

6566
@Override
6667
public void onError(Throwable t) {

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableOnBackpressureReduceTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ public void synchronousDrop() {
8787
ts.assertValues(1, 2);
8888

8989
source.onNext(3);
90-
source.onNext(4);//3 + 4 + 50 == 57
91-
source.onNext(5);//57 + 5 + 50 == 112
92-
source.onNext(6);//112 + 6 + 50 == 168
90+
source.onNext(4); //3 + 4 + 50 == 57
91+
source.onNext(5); //57 + 5 + 50 == 112
92+
source.onNext(6); //112 + 6 + 50 == 168
9393

9494
ts.request(2);
9595

@@ -100,7 +100,7 @@ public void synchronousDrop() {
100100
ts.assertValues(1, 2, 168, 7);
101101

102102
source.onNext(8);
103-
source.onNext(9);//8 + 9 + 50 == 67
103+
source.onNext(9); //8 + 9 + 50 == 67
104104
source.onComplete();
105105

106106
ts.request(1);

0 commit comments

Comments
 (0)