Skip to content

Commit 17ff080

Browse files
committed
statically reference the plugin and mark as experimental
1 parent a57d4cd commit 17ff080

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/java/rx/exceptions/OnErrorThrowable.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ public static Throwable addValueAsLastCause(Throwable e, Object value) {
109109
public static class OnNextValue extends RuntimeException {
110110

111111
private static final long serialVersionUID = -3454462756050397899L;
112+
113+
private static final RxJavaErrorHandler ERROR_HANDLER = RxJavaPlugins.getInstance().getErrorHandler();
114+
112115
private final Object value;
113116

114117
/**
@@ -161,7 +164,7 @@ private static String renderValue(Object value){
161164
return ((Enum<?>) value).name();
162165
}
163166

164-
String pluggedRendering = RxJavaPlugins.getInstance().getErrorHandler().handleOnNextValueRendering(value);
167+
String pluggedRendering = ERROR_HANDLER.handleOnNextValueRendering(value);
165168
if (pluggedRendering != null) {
166169
return pluggedRendering;
167170
}

src/main/java/rx/plugins/RxJavaErrorHandler.java

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

1818
import rx.Observable;
1919
import rx.Subscriber;
20+
import rx.annotations.Experimental;
2021
import rx.exceptions.OnErrorThrowable;
2122

2223
/**
@@ -62,6 +63,7 @@ public void handleError(Throwable e) {
6263
* @param item the last emitted item, that caused the exception wrapped in {@link OnErrorThrowable.OnNextValue}.
6364
* @return a short {@link String} representation of the item if one is known for its type, or null for default.
6465
*/
66+
@Experimental
6567
public final String handleOnNextValueRendering(Object item) {
6668
try {
6769
return render(item);
@@ -83,6 +85,7 @@ public final String handleOnNextValueRendering(Object item) {
8385
* @param item the last emitted item, that caused the exception wrapped in {@link OnErrorThrowable.OnNextValue}.
8486
* @return a short {@link String} representation of the item if one is known for its type, or null for default.
8587
*/
88+
@Experimental
8689
protected String render (Object item) {
8790
//do nothing by default
8891
return null;

0 commit comments

Comments
 (0)