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 #3308, #3350: better reporting of javalib stream & spliterator characteristics #3354

Conversation

LeeTibbert
Copy link
Contributor

@LeeTibbert LeeTibbert commented Jun 28, 2023

  1. Fix javalib ArrayList#spliterator should report ORDERED characteristic. #3350: spliterator returned by javalib ArrayList#spliterator now matches a JVM by reporting the
    ORDERED characteristic.

  2. Fix javalib BaseStream.unordered() method is hard broken. #3308: the javalib stream returned by the unordered method on Stream or DoubleStream
    with an ORDERED stream argument now returns characteristics matching a JVM. ORDERED
    is not present. Only the DISTINCT and SORTED characteristics, if present, are passed along to
    the new stream.

The first fix is used to test the second fix and visa versa.

Note: The spliterator returned by ArrayList#spliterator now binds later, as part of the first
tryAdvance(). No attempt is made to detect ConcurrentModification, but the later
binding should narrow the window of vulnerability. Here "Best Effort" is zero effort.

@LeeTibbert LeeTibbert added component:javalib backport candidate PR which might be backported into previous major release of SN labels Jun 28, 2023
@LeeTibbert LeeTibbert changed the title Fix #3307, #3350: better reporting of javalib stream & splitertor characteristics Fix #3308, #3350: better reporting of javalib stream & splitertor characteristics Jun 28, 2023
@LeeTibbert
Copy link
Contributor Author

One failing test looks like a Windows intermittent failure, unrelated to the substance of this PR

[info] Running run/build-library-dynamic
 [info] [launcher] getting org.scala-sbt sbt 1.5.8  (this may take some time)...
 [info] [launcher] getting Scala 2.12.14 (for sbt)...
[info] 
Error:  x run/build-library-dynamic 
sbt.internal.scripted.TestException: {line -1}  Reload for scripted batch execution failed.
	at sbt.scriptedtest.ScriptedTests.$anonfun$runBatchedTests$5(ScriptedTests.scala:229)

@LeeTibbert LeeTibbert changed the title Fix #3308, #3350: better reporting of javalib stream & splitertor characteristics Fix #3308, #3350: better reporting of javalib stream & spliterator characteristics Jun 29, 2023
@WojciechMazur WojciechMazur merged commit 40ef9b4 into scala-native:main Jun 29, 2023
76 of 77 checks passed
WojciechMazur pushed a commit to WojciechMazur/scala-native that referenced this pull request Sep 1, 2023
… stream & splitertor characteristics (scala-native#3354)

(cherry picked from commit 40ef9b4)
WojciechMazur pushed a commit that referenced this pull request Sep 4, 2023
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.

None yet

2 participants