Fix #3309: javalib stream limit methods now match Java 8 #3390
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #3309
The
limit()
methods in javalib Stream and DoubleStream classes now match the size and characteristicsreported by Java 8.
Please note well that sometime at least by Java 17, the behavior of those methods changed for
parallel ORDERED streams. The Java 17+ behavior is incompatible with Java 8.
Scala Native javalib describes itself as Java 8 (1.8). The behavior implemented here matches
that description but is likely to annoy people porting Java 17+ code to Scala Native.
Please see the Issue for a longer discussion.
The fix in this PR required making the
sorted()
methods return characteristicswhich better match a JVM.