Skip to content

Commit a2416ca

Browse files
author
Shivang Shah
committed
Making RxPlugins reset() public
Discussions found here: #2297 Adding @experimental tag because exposing reset() could be dangerous Adding javadocs for `reset()` API. Explicitly mentioning how caution is advised when using `reset()` API. Also mentioning links to detailed discussions on github issue.
1 parent e804172 commit a2416ca

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import java.util.*;
1919
import java.util.concurrent.atomic.AtomicReference;
20+
import rx.annotations.Experimental;
2021

2122
/**
2223
* Registry for plugin implementations that allows global override and handles the retrieval of correct
@@ -65,8 +66,18 @@ public static RxJavaPlugins getInstance() {
6566
/* package accessible for unit tests */RxJavaPlugins() {
6667

6768
}
68-
69-
/* package accessible for unit tests */void reset() {
69+
70+
/**
71+
* Reset {@code RxJavaPlugins} instance
72+
* <p>
73+
* This API is experimental. Resetting the plugins is dangerous
74+
* during application runtime and also bad code could invoke it in
75+
* the middle of an application life-cycle and really break applications
76+
* if not used cautiously. For more detailed discussions:
77+
* * @see <a href="https://github.com/ReactiveX/RxJava/issues/2297">Make RxJavaPlugins.reset() public</a>
78+
*/
79+
@Experimental
80+
public void reset() {
7081
INSTANCE.errorHandler.set(null);
7182
INSTANCE.observableExecutionHook.set(null);
7283
INSTANCE.singleExecutionHook.set(null);

0 commit comments

Comments
 (0)