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

Incorrect Span behaviour #1641

Closed
yeyan opened this issue Oct 25, 2016 · 2 comments
Closed

Incorrect Span behaviour #1641

yeyan opened this issue Oct 25, 2016 · 2 comments

Comments

@yeyan
Copy link

yeyan commented Oct 25, 2016

java> List.of(1,1,2,2,1,1).span(x -> x == 1)
(List(1, 1), List(2, 2))
// It should (List(1, 1), List(2, 2, 1, 1)) The list is simply truncated here
java> List.of(1,1,2,2,4,4).span(x -> x == 1)
(List(1, 1), List(2, 2, 4, 4))

It seems it is using map behind the scene.
I am using version 2.0.2

@danieldietrich danieldietrich added this to the 2.1.0 milestone Oct 25, 2016
@danieldietrich
Copy link
Contributor

Thanks for reporting! I will investigate and fix it.

@danieldietrich
Copy link
Contributor

Iterator#takeWhile and Iterator#dropWhile are broken:

  1. They continue to apply the given Predicate, even if the test returned false
  2. null is used to indicate 'no more elements' but null is a valid element

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants