Skip to content

Commit 656648d

Browse files
BufferOverflowException -> MissingBackpressureException
1 parent 5a464e0 commit 656648d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/rx/internal/operators/OperatorOnBackpressureBuffer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package rx.internal.operators;
1717

18-
import java.nio.BufferOverflowException;
1918
import java.util.Queue;
2019
import java.util.concurrent.ConcurrentLinkedQueue;
2120
import java.util.concurrent.atomic.AtomicBoolean;
@@ -24,6 +23,7 @@
2423
import rx.Observable.Operator;
2524
import rx.Producer;
2625
import rx.Subscriber;
26+
import rx.exceptions.MissingBackpressureException;
2727
import rx.functions.Action0;
2828

2929
public class OperatorOnBackpressureBuffer<T> implements Operator<T, T> {
@@ -111,7 +111,7 @@ private boolean ensureCapacity() {
111111
if (currCapacity <= 0) {
112112
if (saturated.compareAndSet(false, true)) {
113113
// ensure single completion contract
114-
child.onError(new BufferOverflowException());
114+
child.onError(new MissingBackpressureException("Overflowed buffer of " + OperatorOnBackpressureBuffer.this.capacity));
115115
unsubscribe();
116116
if (onOverflow != null) {
117117
onOverflow.call();

src/test/java/rx/internal/operators/OperatorOnBackpressureBufferTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import rx.Observer;
2929
import rx.Subscriber;
3030
import rx.Subscription;
31+
import rx.exceptions.MissingBackpressureException;
3132
import rx.functions.Action0;
3233
import rx.observables.ConnectableObservable;
3334
import rx.observers.TestSubscriber;
@@ -142,7 +143,7 @@ public void call() {
142143

143144
assertEquals(500, ts.getOnNextEvents().size());
144145
assertEquals(0, ts.getOnNextEvents().get(0).intValue());
145-
assertTrue(ts.getOnErrorEvents().get(0) instanceof BufferOverflowException);
146+
assertTrue(ts.getOnErrorEvents().get(0) instanceof MissingBackpressureException);
146147
assertTrue(s.isUnsubscribed());
147148

148149
}

0 commit comments

Comments
 (0)