Skip to content

Conversation

ekrich
Copy link
Owner

@ekrich ekrich commented Jan 10, 2025

No description provided.

@ekrich
Copy link
Owner Author

ekrich commented Jan 10, 2025

Java 21 is presenting an off by one error versus Java 17. It looks like the relavent issue is here:
https://bugs.openjdk.org/browse/JDK-8307466

with a better explanation here:
https://bugs.openjdk.org/browse/JDK-8307578

This also should be tested and fixed.
https://bugs.openjdk.org/browse/JDK-8273369

Release note wording:
https://bugs.openjdk.org/browse/JDK-8307790

[error] Test org.scalajs.testsuite.javalib.time.InstantTest.until failed: java.lang.AssertionError: 
expected:<84756266270854> but was:<84756266270853>, took 0.001 sec
[error]     at org.scalajs.testsuite.javalib.time.InstantTest.until(InstantTest.scala:402)
[error]     at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[error]     at java.lang.reflect.Method.invoke(Method.java:580)
[error]     ...

Test is as follows:

val somePositiveInstant = Instant.ofEpochMilli(928392983942L)
  val someNegativeInstant = Instant.ofEpochSecond(-83827873287L, 88936253)
assertEquals(84756266270854L,
        someNegativeInstant.until(somePositiveInstant, MILLIS))

@ekrich ekrich merged commit 093900f into main Jan 16, 2025
2 checks passed
@ekrich ekrich deleted the topic/ci branch January 16, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant