Skip to content

java.time.Instant argument saving and loading on JDK 21 seems to be different on macOS vs Ubuntu #2591

Closed Answered by vinaysshenoy
vinaysshenoy asked this question in Q&A
Discussion options

You must be logged in to vote

Seems like the issue was related to this: https://stackoverflow.com/questions/52029920/localdatetime-now-has-different-levels-of-precision-on-windows-and-mac-machine

Not sure why this specifically started happening right now, though, since I was previously on JDK 17 which should have been using the system clock precision and run into the same issues. For now, I created a fixed precision clock to use in tests to generate timestamps:

val wallClock by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
  Clock.tickMillis(ZoneOffset.UTC)
}

Closing this for now since it was not related to JDBI. But if anyone has any idea why this happened specifically with the change to JDK 21, would love to hear it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@stevenschlansker
Comment options

Answer selected by vinaysshenoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants