-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
2.x: UnicastSubject fix onTerminate #4592
2.x: UnicastSubject fix onTerminate #4592
Conversation
@@ -184,7 +191,7 @@ public void onNext(T t) { | |||
return; | |||
} | |||
if (t == null) { | |||
onError(new NullPointerException()); | |||
onError(new NullPointerException("onNext called with null. Null values are generally not allowed in 2.x operators and sources.")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not this throw immediately rather than trying to go through onError?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the spec mandates throwing on null input and I think the Processor TCK also expects it. I thought signalling NPE is more graceful with Subjects and FlowableProcessors and shuts down the streams as well whereas a thrown NPE may leave everybody hanging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright I'll leave the decision up to you. I'd prefer the fail early approach however delegating it down the stream also works. If you want me to change it I'll do so in a follow up PR.
Current coverage is 78.15% (diff: 66.66%)@@ 2.x #4592 diff @@
==========================================
Files 552 552
Lines 36247 36254 +7
Methods 0 0
Messages 0 0
Branches 5594 5595 +1
==========================================
+ Hits 28293 28335 +42
+ Misses 5944 5913 -31
+ Partials 2010 2006 -4
|
Leave this as is and I'll think about it. |
No description provided.