@Test public void onCompleteFailure() { AtomicReference<Throwable> onError = new AtomicReference<Throwable>(); try { OBSERVER_ONCOMPLETED_FAIL(onError).onComplete(); fail("expects exception to be thrown"); } catch (Exception e) { assertNull(onError.get()); assertTrue(e instanceof SafeSubscriberTestException); assertEquals("onCompleteFail", e.getMessage()); } }
@Override public void onComplete() { if (done) { return; } done = true; if (s == null) { onCompleteNoSubscription(); return; } try { actual.onComplete(); } catch (Throwable e) { Exceptions.throwIfFatal(e); RxJavaPlugins.onError(e); } }
SafeSubscriber implements FlowableSubscriber<T>, Subscription { @Override public void onComplete() { if (done) { return; } done = true; if (s == null) { onCompleteNoSubscription(); return; } try { actual.onComplete(); } catch (Throwable e) { Exceptions.throwIfFatal(e); RxJavaPlugins.onError(e); } } }
SafeSubscriber implements FlowableSubscriber<T>, Subscription { @Override public void onComplete() { if (done) { return; } done = true; if (s == null) { onCompleteNoSubscription(); return; } try { actual.onComplete(); } catch (Throwable e) { Exceptions.throwIfFatal(e); RxJavaPlugins.onError(e); } } SafeSubscriber(Subscriber<? super T> actual); }
SafeSubscriber implements FlowableSubscriber<T>, Subscription { @Override public void onComplete() { if (done) { return; } done = true; if (s == null) { onCompleteNoSubscription(); return; } try { actual.onComplete(); } catch (Throwable e) { Exceptions.throwIfFatal(e); RxJavaPlugins.onError(e); } } SafeSubscriber(Subscriber<? super T> actual); @Override void onSubscribe(Subscription s); @Override void onNext(T t); @Override void onError(Throwable t); @Override void onComplete(); @Override void request(long n); @Override void cancel(); }
SafeSubscriber implements FlowableSubscriber<T>, Subscription { @Override public void onComplete() { if (done) { return; } done = true; if (s == null) { onCompleteNoSubscription(); return; } try { actual.onComplete(); } catch (Throwable e) { Exceptions.throwIfFatal(e); RxJavaPlugins.onError(e); } } SafeSubscriber(Subscriber<? super T> actual); @Override void onSubscribe(Subscription s); @Override void onNext(T t); @Override void onError(Throwable t); @Override void onComplete(); @Override void request(long n); @Override void cancel();  }