Skip to content

2.x: fix CallbackCompletableObserver calling onError, ResourceX wording #5240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ public void onComplete() {
onComplete.run();
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
onError(ex);
return;
RxJavaPlugins.onError(ex);
}
lazySet(DisposableHelper.DISPOSED);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* <p>All pre-implemented final methods are thread-safe.
*
* <p>Use the protected {@link #dispose()} to dispose the sequence from within an
* <p>Use the public {@link #dispose()} method to dispose the sequence from within an
* {@code onNext} implementation.
*
* <p>Like all other consumers, {@code DefaultObserver} can be subscribed only once.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* <p>Override the protected {@link #onStart()} to perform initialization when this
* {@code ResourceCompletableObserver} is subscribed to a source.
*
* <p>Use the protected {@link #dispose()} to dispose the sequence externally and release
* <p>Use the public {@link #dispose()} method to dispose the sequence externally and release
* all resources.
*
* <p>To release the associated resources, one has to call {@link #dispose()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* <p>Override the protected {@link #onStart()} to perform initialization when this
* {@code ResourceMaybeObserver} is subscribed to a source.
*
* <p>Use the protected {@link #dispose()} to dispose the sequence externally and release
* <p>Use the public {@link #dispose()} method to dispose the sequence externally and release
* all resources.
*
* <p>To release the associated resources, one has to call {@link #dispose()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* <p>Override the protected {@link #onStart()} to perform initialization when this
* {@code ResourceSingleObserver} is subscribed to a source.
*
* <p>Use the protected {@link #dispose()} to dispose the sequence externally and release
* <p>Use the public {@link #dispose()} method to dispose the sequence externally and release
* all resources.
*
* <p>To release the associated resources, one has to call {@link #dispose()}
Expand Down
28 changes: 17 additions & 11 deletions src/test/java/io/reactivex/completable/CompletableTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2566,18 +2566,24 @@ public void run() { }

@Test(timeout = 5000)
public void subscribeTwoCallbacksCompleteThrows() {
final AtomicReference<Throwable> err = new AtomicReference<Throwable>();
normal.completable.subscribe(new Action() {
@Override
public void run() { throw new TestException(); }
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable e) {
err.set(e);
}
});
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
final AtomicReference<Throwable> err = new AtomicReference<Throwable>();
normal.completable.subscribe(new Action() {
@Override
public void run() { throw new TestException(); }
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable e) {
err.set(e);
}
});

Assert.assertTrue(String.valueOf(err.get()), err.get() instanceof TestException);
Assert.assertNull(err.get());
TestHelper.assertUndeliverable(errors, 0, TestException.class);
} finally {
RxJavaPlugins.reset();
}
}

@Test(timeout = 5000)
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/reactivex/schedulers/TimedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void toStringOf() {

assertEquals("Timed[time=5, unit=SECONDS, value=1]", t1.toString());
}

@Test(expected = NullPointerException.class)
public void timeUnitNullFail() throws Exception {
new Timed<Integer>(1, 5, null);
Expand Down