You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rxjava-core/src/main/java/org/rx/reactive/Observable.java
+10-9Lines changed: 10 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
/**
2
2
* Copyright 2013 Netflix, Inc.
3
-
*
3
+
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
6
6
* You may obtain a copy of the License at
7
-
*
8
-
* http://www.apache.org/licenses/LICENSE-2.0
9
-
*
7
+
*
8
+
* http://www.apache.org/licenses/LICENSE-2.0
9
+
*
10
10
* Unless required by applicable law or agreed to in writing, software
11
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -136,9 +136,10 @@ public void onNext(Object args) {
136
136
}
137
137
138
138
@SuppressWarnings({ "rawtypes", "unchecked" })
139
-
publicSubscriptionsubscribe(finalObjectonNext) {
140
-
if (onNextinstanceofObserver) {
141
-
thrownewRuntimeException("Observers are not intended to be passed to this generic method. Your generic type is most likely wrong. This method is for dynamic code to send in closures.");
139
+
publicSubscriptionsubscribe(finalObjecto) {
140
+
if (oinstanceofObserver) {
141
+
// in case a dynamic language is not correctly handling the overloaded methods and we receive an Observer just forward to the correct method.
142
+
returnsubscribe((Observer) o);
142
143
}
143
144
returnsubscribe(newObserver() {
144
145
@@ -152,10 +153,10 @@ public void onError(Exception e) {
152
153
}
153
154
154
155
publicvoidonNext(Objectargs) {
155
-
if (onNext == null) {
156
+
if (o == null) {
156
157
thrownewRuntimeException("onNext must be implemented");
0 commit comments