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

Make Future receive NoSuchElementException when the BlockingObservable is empty #1337

Merged
merged 1 commit into from
Jun 12, 2014

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Jun 8, 2014

Now Future.get will return null if there is a single null in the BlockingObservable, or it is empty. People cannot distinguish between these two cases.

This PR has 2 breaking changes:

  • Throw an NoSuchElementException rather than returning null when the BlockingObservable is empty.
  • Change the exception from IllegalStateException to IllegalArgumentException when the BlockingObservable emits more than one items. This is because I used single directly.

@zsxwing zsxwing changed the title Future wil receive NoSuchElementException when the BlockingObservable is empty Make Future receive NoSuchElementException when the BlockingObservable is empty Jun 8, 2014
@cloudbees-pull-request-builder

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

@cloudbees-pull-request-builder

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

@cloudbees-pull-request-builder

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

benjchristensen added a commit that referenced this pull request Jun 12, 2014
Make Future receive NoSuchElementException when the BlockingObservable is empty
@benjchristensen benjchristensen merged commit d56959d into ReactiveX:master Jun 12, 2014
@zsxwing zsxwing deleted the fix-toFuture branch June 13, 2014 03:42
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.

3 participants