Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Fix the bug that BlockingObservable.singleOrDefault doesn't call unsubscribe#1260

Merged
benjchristensen merged 1 commit intoReactiveX:masterfrom
zsxwing:bo-singleOrDefault-bug
May 27, 2014
Merged

Fix the bug that BlockingObservable.singleOrDefault doesn't call unsubscribe#1260
benjchristensen merged 1 commit intoReactiveX:masterfrom
zsxwing:bo-singleOrDefault-bug

Conversation

@zsxwing
Copy link
Member

@zsxwing zsxwing commented May 25, 2014

BlockingObservable.singleOrDefault doesn't call unsubscribe when throws IllegalArgumentException("Sequence contains too many elements"). testSingleOrDefaultUnsubscribe proves this bug.

@cloudbees-pull-request-builder

RxJava-pull-requests #1156 SUCCESS
This pull request looks good

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to map with the identity function here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because o is Observable<? extends T> and I cannot call singleOrDefault(T) on it directly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that mean that XXXOrDefault have to be covariant as well :-(

public T singleOrDefault(T defaultValue)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Observable<T> singleOrDefault(T defaultValue) also need to

However, I cannot write <U super T> Observable<U> singleOrDefault(U defaultValue) in Java :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This covariance stuff is insane.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-)

benjchristensen added a commit that referenced this pull request May 27, 2014
@benjchristensen benjchristensen merged commit a34cba2 into ReactiveX:master May 27, 2014
@zsxwing zsxwing deleted the bo-singleOrDefault-bug branch May 27, 2014 09:41
@benjchristensen benjchristensen mentioned this pull request Jun 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants