Skip to content

Making RxPlugins reset() public #3820

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
Apr 29, 2016
Merged
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
15 changes: 13 additions & 2 deletions src/main/java/rx/plugins/RxJavaPlugins.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import rx.annotations.Experimental;

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

}

/* package accessible for unit tests */void reset() {

/**
* Reset {@code RxJavaPlugins} instance
* <p>
* This API is experimental. Resetting the plugins is dangerous
* during application runtime and also bad code could invoke it in
* the middle of an application life-cycle and really break applications
* if not used cautiously. For more detailed discussions:
* * @see <a href="https://github.com/ReactiveX/RxJava/issues/2297">Make RxJavaPlugins.reset() public</a>
*/
@Experimental
public void reset() {
INSTANCE.errorHandler.set(null);
INSTANCE.observableExecutionHook.set(null);
INSTANCE.singleExecutionHook.set(null);
Expand Down