Skip to content

Commit a93a672

Browse files
committed
exclude rx.internal.
exclude RxJavaErrorHandlerDefault by deleting it.
1 parent a1aca70 commit a93a672

File tree

4 files changed

+10
-33
lines changed

4 files changed

+10
-33
lines changed

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ dependencies {
1212
testCompile 'org.mockito:mockito-core:1.8.5'
1313
}
1414

15+
javadoc {
16+
exclude "**/rx/internal/**"
17+
}
18+

src/main/java/rx/plugins/RxJavaErrorHandlerDefault.java

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/main/java/rx/plugins/RxJavaPlugins.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public static RxJavaPlugins getInstance() {
5555
INSTANCE.schedulersHook.set(null);
5656
}
5757

58+
static final RxJavaErrorHandler DEFAULT_ERROR_HANDLER = new RxJavaErrorHandler() {
59+
};
60+
5861
/**
5962
* Retrieves an instance of {@link RxJavaErrorHandler} to use based on order of precedence as defined in
6063
* {@link RxJavaPlugins} class header.
@@ -70,7 +73,7 @@ public RxJavaErrorHandler getErrorHandler() {
7073
Object impl = getPluginImplementationViaProperty(RxJavaErrorHandler.class);
7174
if (impl == null) {
7275
// nothing set via properties so initialize with default
73-
errorHandler.compareAndSet(null, RxJavaErrorHandlerDefault.getInstance());
76+
errorHandler.compareAndSet(null, DEFAULT_ERROR_HANDLER);
7477
// we don't return from here but call get() again in case of thread-race so the winner will always get returned
7578
} else {
7679
// we received an implementation from the system property so use it

src/test/java/rx/plugins/RxJavaPluginsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package rx.plugins;
1717

1818
import static org.junit.Assert.assertEquals;
19+
import static org.junit.Assert.assertSame;
1920
import static org.junit.Assert.assertTrue;
2021
import static org.junit.Assert.fail;
2122

@@ -41,7 +42,7 @@ public void resetAfter() {
4142
@Test
4243
public void testErrorHandlerDefaultImpl() {
4344
RxJavaErrorHandler impl = new RxJavaPlugins().getErrorHandler();
44-
assertTrue(impl instanceof RxJavaErrorHandlerDefault);
45+
assertSame(RxJavaPlugins.DEFAULT_ERROR_HANDLER, impl);
4546
}
4647

4748
@Test

0 commit comments

Comments
 (0)