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

Fix #3309: javalib stream limit methods now match Java 8 #3390

Conversation

LeeTibbert
Copy link
Contributor

Fix #3309

The limit() methods in javalib Stream and DoubleStream classes now match the size and characteristics
reported 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 characteristics
which better match a JVM.

@LeeTibbert LeeTibbert added component:javalib backport candidate PR which might be backported into previous major release of SN labels Jul 15, 2023
@LeeTibbert
Copy link
Contributor Author

Interesting failure: failed Check CLA. Time to renew my subscription and/or bona fides, I guess.

@WojciechMazur WojciechMazur merged commit eb2caf7 into scala-native:main Jul 17, 2023
77 checks passed
WojciechMazur pushed a commit to WojciechMazur/scala-native that referenced this pull request Sep 1, 2023
…cala-native#3390)

* Fix scala-native#3309: javalib stream limit methods now match Java 8

* Fix OR syntax for Scala 2

* Address second round of Scala 2 type issues

* limit() tests should use known AnyRef, not spooky conversions

(cherry picked from commit eb2caf7)
WojciechMazur pushed a commit that referenced this pull request Sep 4, 2023
* Fix #3309: javalib stream limit methods now match Java 8

* Fix OR syntax for Scala 2

* Address second round of Scala 2 type issues

* limit() tests should use known AnyRef, not spooky conversions

(cherry picked from commit eb2caf7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport candidate PR which might be backported into previous major release of SN component:javalib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

javalib Stream & DoubleSteam limit() methods have defects.
2 participants