File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
main/java/rx/internal/operators
test/java/rx/internal/operators Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package rx .internal .operators ;
17
17
18
- import java .nio .BufferOverflowException ;
19
18
import java .util .Queue ;
20
19
import java .util .concurrent .ConcurrentLinkedQueue ;
21
20
import java .util .concurrent .atomic .AtomicBoolean ;
24
23
import rx .Observable .Operator ;
25
24
import rx .Producer ;
26
25
import rx .Subscriber ;
26
+ import rx .exceptions .MissingBackpressureException ;
27
27
import rx .functions .Action0 ;
28
28
29
29
public class OperatorOnBackpressureBuffer <T > implements Operator <T , T > {
@@ -111,7 +111,7 @@ private boolean ensureCapacity() {
111
111
if (currCapacity <= 0 ) {
112
112
if (saturated .compareAndSet (false , true )) {
113
113
// ensure single completion contract
114
- child .onError (new BufferOverflowException ( ));
114
+ child .onError (new MissingBackpressureException ( "Overflowed buffer of " + OperatorOnBackpressureBuffer . this . capacity ));
115
115
unsubscribe ();
116
116
if (onOverflow != null ) {
117
117
onOverflow .call ();
Original file line number Diff line number Diff line change 28
28
import rx .Observer ;
29
29
import rx .Subscriber ;
30
30
import rx .Subscription ;
31
+ import rx .exceptions .MissingBackpressureException ;
31
32
import rx .functions .Action0 ;
32
33
import rx .observables .ConnectableObservable ;
33
34
import rx .observers .TestSubscriber ;
@@ -142,7 +143,7 @@ public void call() {
142
143
143
144
assertEquals (500 , ts .getOnNextEvents ().size ());
144
145
assertEquals (0 , ts .getOnNextEvents ().get (0 ).intValue ());
145
- assertTrue (ts .getOnErrorEvents ().get (0 ) instanceof BufferOverflowException );
146
+ assertTrue (ts .getOnErrorEvents ().get (0 ) instanceof MissingBackpressureException );
146
147
assertTrue (s .isUnsubscribed ());
147
148
148
149
}
You can’t perform that action at this time.
0 commit comments