Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Yasson » Pb marshalling Optional<java.util.Date> attribute(Pb marshalling Optional<java.util.Date> attribute)
Pb marshalling Optional<java.util.Date> attribute [message #1751012] Tue, 03 January 2017 16:26 Go to next message
Jean-Francois James is currently offline Jean-Francois JamesFriend
Messages: 5
Registered: December 2016
Junior Member
Hi,

First off, happy new year to the Yasson team.
I've done another small test using a class with an Optional<java.util.Date> attribute. It seems that there is a marshalling error on it. When calling jsonb.toJson a JsonbException is thrown (see comment in my attached code).
In the spec, it is mentionned that implementations MUST support binding of standard Java date/time classes including java.util.Date (chapter 3.5).
Is it a bug or a bad usage from me?
Re: Pb marshalling Optional<java.util.Date> attribute [message #1751066 is a reply to message #1751012] Wed, 04 January 2017 09:27 Go to previous messageGo to next message
Ehsan Zaery Moghaddam is currently offline Ehsan Zaery MoghaddamFriend
Messages: 8
Registered: December 2016
Junior Member

Hi Jean-Francis

You're right. Seems it's a bug Sad . I'll take a look at it and put it in issues list.

Thanks
Re: Pb marshalling Optional<java.util.Date> attribute [message #1751078 is a reply to message #1751066] Wed, 04 January 2017 10:37 Go to previous messageGo to next message
Jean-Francois James is currently offline Jean-Francois JamesFriend
Messages: 5
Registered: December 2016
Junior Member
Thank you. Nice to help you.
Re: Pb marshalling Optional<java.util.Date> attribute [message #1751111 is a reply to message #1751078] Wed, 04 January 2017 14:42 Go to previous messageGo to next message
Ehsan Zaery Moghaddam is currently offline Ehsan Zaery MoghaddamFriend
Messages: 8
Registered: December 2016
Junior Member

Just as a workaround, if you set the visibility of the inner class (i.e. Person) to public, you'll not get this error. It's not related to the Optional field. I've to investigate more to see if still this is a bug or it's something that is not going to be supported by the API.
Re: Pb marshalling Optional<java.util.Date> attribute [message #1751383 is a reply to message #1751012] Mon, 09 January 2017 15:54 Go to previous message
Dmitry Kornilov is currently offline Dmitry KornilovFriend
Messages: 9
Registered: June 2014
Junior Member
According to the spec [3.7.1] only public and protected nested classes are supported. As I see you have package private (default) access in your sample.
Previous Topic:Using Yasson within JavaEE (JAX-RS)
Next Topic:Null OptionalInt deseralized as null
Goto Forum:
  


Current Time: Sun Jun 24 21:03:54 GMT 2018

Powered by FUDForum. Page generated in 0.01662 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top