-
Notifications
You must be signed in to change notification settings - Fork 168
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
Inconsistencies in SeqUtils.transform's Spliterator.characteristics() and Spliterator.getComparator() #311
Comments
Interesting observation. Indeed, perhaps the existing operation is too agressive. Would you mind explaining the rationale behind your version (the part about |
Well, as far as I understand,
|
Thanks for taking the time to explain this (and sorry again for my laziness here. jOOQ has been keeping me rather busy, recently). You made good points. If you're interested, I think this looks good for a PR. I think we could put your explanation there as a comment, too with a reference to this issue, so we'll still remember this in the future. |
Sure, I'll provide a PR. PS. As to response time, I'm absolutely fine with responses in the spirit of "eventual consistency" ;) |
Yeah. "Eventually", my inbox with notifications reaches zero, right? :) |
Heh, you're right - the analogy is flawed :) |
…characteristics()
Hm, I took a much closer look and I found the following:
return Seq.of(seed).concat(stream.map(t -> value[0] = function.apply(value[0], t))); (which seems safe unless someone calls |
I think I found some inconsistencies in
SeqUtils.transform
concerning the methodcharacteristics()
.We have:
But since in calculating the
characteristics
above we use bitwise AND (&
) withSpliterator.ORDERED
, thsSpliterator
will never reportSpliterator.SORTED
, and so the methodgetComparator
will never be called inStreamOpFlag.fromCharacteristics
:I think
characteristics()
should return something like this:which would mean "we preserve the original characteristics, adding
ORDERED
if absent, and removingSIZED
andSUBSIZED
if present".The text was updated successfully, but these errors were encountered: