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

Serde of LocalDateTime reduces precision and overflows long #284

Closed
chrishowell opened this issue Oct 17, 2022 · 0 comments
Closed

Serde of LocalDateTime reduces precision and overflows long #284

chrishowell opened this issue Oct 17, 2022 · 0 comments
Assignees
Labels
status: in progress status: pr submitted A pull request has been submitted for the issue type: bug Something isn't working

Comments

@chrishowell
Copy link

Expected Behavior

  1. LocalDateTime.MIN & .MAX should be serdeable
  2. LocalDateTime.now() should be equal to the serialisation and deserialisation.

Actual Behaviour

  1. long overflow
    i.m.http.server.RouteExecutor - Unexpected error occurred: long overflow java.lang.ArithmeticException: long overflow at java.base/java.lang.Math.multiplyExact(Math.java:1004) at java.base/java.lang.Math.multiplyExact(Math.java:980) at java.base/java.time.Instant.toEpochMilli(Instant.java:1236) at io.micronaut.serde.support.serdes.LocalDateTimeSerde.serializeWithoutFormat(LocalDateTimeSerde.java:57)
  2. 2022-10-17T21:45:21.328137 vs 2022-10-17T21:45:21.328

Steps To Reproduce

A simple reactive controller and integration test, mock a service response to the controller and produce a LocalDateTime.MAX/MIN/now(), test equality with what is produced by the test's ReactiveHttpClient.

Environment Information

No response

Example Application

No response

Version

3.8.0-SNAPSHOT

@graemerocher graemerocher added the type: bug Something isn't working label Oct 18, 2022
@graemerocher graemerocher self-assigned this Nov 2, 2022
@graemerocher graemerocher added status: pr submitted A pull request has been submitted for the issue status: in progress labels Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in progress status: pr submitted A pull request has been submitted for the issue type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants