Skip to content
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

Merged
merged 1 commit into from
Sep 23, 2016
Merged

2.x: UnicastSubject fix onTerminate #4592

merged 1 commit into from
Sep 23, 2016

Conversation

vanniktech
Copy link
Collaborator

No description provided.

@@ -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."));
Copy link
Collaborator Author

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?

Copy link
Member

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.

Copy link
Collaborator Author

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.

@akarnokd akarnokd added the Bug label Sep 23, 2016
@akarnokd akarnokd added this to the 2.0 RC4 milestone Sep 23, 2016
@codecov-io
Copy link

Current coverage is 78.15% (diff: 66.66%)

Merging #4592 into 2.x will increase coverage by 0.10%

@@                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   

Powered by Codecov. Last update 7791076...53032a9

@akarnokd
Copy link
Member

Leave this as is and I'll think about it.

@akarnokd akarnokd merged commit d923f31 into ReactiveX:2.x Sep 23, 2016
@vanniktech vanniktech deleted the 2.x_UnicastSubject_fix_onTerminate branch September 23, 2016 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants