Skip to content

Commit 5a381a2

Browse files
zsxwingbenjchristensen
authored andcommitted
Use EmptyObserver instead of Subscribers.empty()
onError should be ignored after unsubscribe is called.
1 parent f7a59af commit 5a381a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import rx.Observer;
2222
import rx.Subscriber;
2323
import rx.functions.Action0;
24+
import rx.observers.EmptyObserver;
2425
import rx.observers.Subscribers;
2526
import rx.subjects.Subject;
2627
import rx.subscriptions.Subscriptions;
@@ -50,6 +51,9 @@
5051
*/
5152
public class BufferUntilSubscriber<T> extends Subject<T, T> {
5253

54+
@SuppressWarnings("rawtypes")
55+
private final static Observer EMPTY_OBSERVER = new EmptyObserver();
56+
5357
/**
5458
* @warn create() undescribed
5559
* @return
@@ -92,7 +96,7 @@ public void call(final Subscriber<? super T> s) {
9296
s.add(Subscriptions.create(new Action0() {
9397
@Override
9498
public void call() {
95-
state.observerRef = Subscribers.empty();
99+
state.observerRef = EMPTY_OBSERVER;
96100
}
97101
}));
98102
boolean win = false;

0 commit comments

Comments
 (0)