File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
rxjava-core/src/main/java/rx/operators Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -111,17 +111,22 @@ public Object error(Throwable e) {
111
111
* @throws NullPointerException
112
112
* if the {@link Observer} is null.
113
113
*/
114
+ @ SuppressWarnings ("unchecked" )
114
115
public void accept (Observer <? super T > o , Object n ) {
115
- switch (kind (n )) {
116
- case OnNext :
117
- o .onNext (getValue (n ));
118
- break ;
119
- case OnCompleted :
116
+ if (n == ON_COMPLETED_SENTINEL ) {
120
117
o .onCompleted ();
121
- break ;
122
- case OnError :
123
- o .onError (getError (n ));
124
- break ;
118
+ } else
119
+ if (n == ON_NEXT_NULL_SENTINEL ) {
120
+ o .onNext (null );
121
+ } else
122
+ if (n != null ) {
123
+ if (n .getClass () == OnErrorSentinel .class ) {
124
+ o .onError (((OnErrorSentinel )n ).e );
125
+ } else {
126
+ o .onNext ((T )n );
127
+ }
128
+ } else {
129
+ throw new IllegalArgumentException ("The lite notification can not be null" );
125
130
}
126
131
}
127
132
You can’t perform that action at this time.
0 commit comments