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

Misinterpretation of allowed format at converting JSR310 Date and Time to String. #747

Closed
yoshikawaa opened this issue Mar 14, 2019 · 4 comments · Fixed by #754
Closed

Comments

@yoshikawaa
Copy link

Whats your runtime?

  • Dozer version: 6.4.1
  • OS version: CentOS 7.4
  • JDK version: 1.8.x

Whats the problem?

I copied with converting from JSR310 ZonedDateTime to String.
I defined date-format based on the pattern allowed by DateTimeFormatter.
But pattern V not allowed and got IllegallArgumentException.

<field>
    <a>zonedDateTimeObject</a>
    <b date-format="uuuu/MM/dd HH:mm:ss.SSSZZZZZ'['VV']'">stringObject</b>
</field>

u is also interpreted as the day of the week, not the year, and is allowed as a result.

Observed Results:

It seems the bug of allowed format interpretation.
If destination is String object, Actually SimpleDateFormat is used to validate date-format instead of DateTimeFormatter.

Please look these classes.

Expected Results:

When converting from JSR310 Date and Time to String, should use DateTimeFormatter to validate date-format.

Link to GitHub repo with Unit test

none.

@kazuki43zoo
Copy link
Contributor

@garethahealy Thanks for merging my PR! When are you planning to release 6.5?

@yoshikawaa
Copy link
Author

I'm happy that this problem is fixed, thanks @kazuki43zoo @garethahealy !

@garethahealy
Copy link
Collaborator

@kazuki43zoo ; theres an outstanding java11 build problem:

I'd like to wait until i've had some feedback on this. If its going to take a while to fix, i'll release soon - next week or so.

@kazuki43zoo
Copy link
Contributor

@garethahealy Thank you for reaction!! I can wait to fix build error on JDK 11 :D

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 a pull request may close this issue.

3 participants