On Fri, Mar 27, 2020 at 2:28 PM Nakamura <[email protected]> wrote:

> Thanks, I filed a ticket here
> <https://github.com/FasterXML/jackson-module-scala/issues/445>, PJ is
> helping me out!  One other thing I noticed was that a Map we had previously
> been deserializing as a null is now being deserialized as an empty Map when
> it's not specified in the JSON.  Is that expected?  I think it's a nicer
> behavior, so I'm on board, but I didn't see that in the release notes, so I
> wanted to make sure it wasn't a bug.
>

Hmmh. I wouldn't think this should have changed by default, but there are
new settings that allow specifying this behavior, see:

https://medium.com/@cowtowncoder/jackson-2-9-features-b2a19029e9ff

(under "Null replacement/error/skipping (on deserialization")

so that incoming `null` can be replaced with "empty" value for type.

I am guessing that maybe this feature is somehow enabled by Scala module,
possibly to achieve something else (avoid NPEs?)

-+ Tatu +-




>
> On Fri, Mar 27, 2020 at 11:30 AM Tatu Saloranta <[email protected]>
> wrote:
>
>> On Thu, Mar 26, 2020 at 6:49 PM Nakamura <[email protected]> wrote:
>>
>>> Hi Tatu,
>>>
>>
>> Hello there!
>>
>>
>>>
>>> Long time listener, first time caller!  My company is hoping to get a
>>> bit closer to the bleeding edge with jackson, so I figured I'd take a stab
>>> at helping you test it out.
>>>
>>
>> Excellent, thank you for helping.
>>
>>
>>>
>>> Not sure where you want feedback, so I'm just going to reply for now.
>>> I'm currently on 2.9.10 and trying out 2.11.0.rc1, and so far I've run into
>>> a few issues.  I'll keep poking to see if any of the others are worth
>>> surfacing, but so far we have a strange NPE:
>>>
>>
>>>                      java.lang.NullPointerException: null
>>>                       at
>>> scala.collection.mutable.ArrayOps$ofRef$.length$extension(ArrayOps.scala:204)
>>>                       at
>>> scala.collection.mutable.ArrayOps$ofRef.length(ArrayOps.scala:204)
>>>                       at scala.collection.SeqLike.size(SeqLike.scala:108)
>>>                       at
>>> scala.collection.SeqLike.size$(SeqLike.scala:108)
>>>                       at
>>> scala.collection.mutable.ArrayOps$ofRef.size(ArrayOps.scala:198)
>>>                       at
>>> scala.collection.IndexedSeqLike.sizeHintIfCheap(IndexedSeqLike.scala:99)
>>>                       at
>>> scala.collection.IndexedSeqLike.sizeHintIfCheap$(IndexedSeqLike.scala:99)
>>>                       at
>>> scala.collection.mutable.ArrayOps$ofRef.sizeHintIfCheap(ArrayOps.scala:198)
>>>                       at
>>> scala.collection.mutable.Builder.sizeHint(Builder.scala:80)
>>>                       at
>>> scala.collection.mutable.Builder.sizeHint$(Builder.scala:79)
>>>                       at
>>> scala.collection.mutable.ArrayBuilder.sizeHint(ArrayBuilder.scala:25)
>>>                       at
>>> scala.collection.TraversableLike.builder$1(TraversableLike.scala:234)
>>>                       at
>>> scala.collection.TraversableLike.map(TraversableLike.scala:237)
>>>                       at
>>> scala.collection.TraversableLike.map$(TraversableLike.scala:231)
>>>                       at
>>> scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:198)
>>>                       at
>>> com.fasterxml.jackson.module.scala.introspect.ScalaAnnotationIntrospector$ScalaValueInstantiator.<init>(ScalaAnnotationIntrospectorModule.scala:129)
>>>                       at
>>> com.fasterxml.jackson.module.scala.introspect.ScalaAnnotationIntrospector$.findValueInstantiator(ScalaAnnotationIntrospectorModule.scala:159)
>>>                       at
>>> com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findValueInstantiator(BasicDeserializerFactory.java:231)
>>>                       at
>>> com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:220)
>>>                       at
>>> com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:143)
>>>                       at
>>> com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:414)
>>>                       at
>>> com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:349)
>>>                       at
>>> com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
>>>                       at
>>> com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
>>>                       at
>>> com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142)
>>>                       at
>>> com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:446)
>>>                       at
>>> com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.createContextual(CollectionDeserializer.java:183)
>>>                       at
>>> com.fasterxml.jackson.module.scala.deser.GenericFactoryDeserializerResolver$Deserializer.createContextual(GenericFactoryDeserializerResolver.scala:71)
>>>                       at
>>> com.fasterxml.jackson.module.scala.deser.GenericFactoryDeserializerResolver$Deserializer.createContextual(GenericFactoryDeserializerResolver.scala:62)
>>>                       at
>>> com.fasterxml.jackson.databind.DeserializationContext.handleSecondaryContextualization(DeserializationContext.java:684)
>>>                       at
>>> com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:484)
>>>                       at
>>> com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4621)
>>>                       at
>>> com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4400)
>>>                       at
>>> com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2745)
>>>
>>>
>> That does look strange.
>>
>>
>>> It looks like it's because of this line:
>>>
>>>
>>> https://github.com/FasterXML/jackson-module-scala/blob/master/src/main/scala/com/fasterxml/jackson/module/scala/introspect/ScalaAnnotationIntrospectorModule.scala#L128
>>>
>>>       val args = delegate.getFromObjectArguments(None.orNull)
>>>
>>> None.orNull always returns null, so we can probably replace this with
>>>
>>>       val args = delegate.getFromObjectArguments(null)
>>>
>>> for no change.  I'm somewhat stumped what else might be going on here
>>> though–I don't think we ever make a custom ValueInstantiator in our
>>> codebase, so I don't know how getFromObjectArguments could end up returning
>>> null.  Do you have any idea what might be going on?  I'll try moving to
>>> 2.10.3 too and will see if this is still an issue.
>>>
>>>
>> Could you please file an issue with same information for Scala module:
>>
>> https://github.com/FasterXML/jackson-module-scala/issues
>>
>> since it seems like it is triggered within that module. I can then work
>> with Scala module owners (I do not work on that module myself) to figure
>> out where changes/workaround is needed.
>>
>> Thank you!
>>
>> -+ Tatu +-
>>
>>
>>
>>> Best,
>>> Moses
>>>
>>>
>>> On Wed, Mar 25, 2020 at 2:45 PM Tatu Saloranta <[email protected]>
>>> wrote:
>>>
>>>> As some of you may have noticed, pre-release version 2.11.0.rc1 is now
>>>> out.
>>>> While it should be quite close to eventual 2.11.0, some things may
>>>> still change but my hope is that all compatibility-related changes are
>>>> in.
>>>>
>>>> The main goal for doing pre-release version(s) is to have one last
>>>> chance to find issues related to backwards compatibility with previous
>>>> minor versions. While we try to keep compatibility according to
>>>> Semantic Versioning guidelines, sometimes there are accidental changes
>>>> that violate this.
>>>> So we would like to find such issues before 2.11.0 is released,  and
>>>> fix issues where possible; or mitigate if they can not be; or at very
>>>> least document changes in behavior where change is actually
>>>> intentional.
>>>>
>>>> Changes included are detailed here:
>>>>
>>>> https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.11
>>>>
>>>> including section "Changes, Behavior", which included likeliest
>>>> changes that might affect your code. For this release there are so far
>>>> 3 things:
>>>>
>>>> 1. Default serialization ordering now considers @JsonProperty(index = )
>>>> 2. Avro format backend will change schema type indicated for `byte[]`,
>>>>  `java.util.UUID`
>>>> 3. Timezone offset in default java.util.Date, java.util.Calendar
>>>> serialization will now include colon (like +00:00) by default (see
>>>> databind#2643 below)
>>>>
>>>> But there may well be other unintended changes. We would like to hear
>>>> about unknown changes, as well as feedback on above-listed intentional
>>>> changes
>>>>
>>>> At this point I hope to spend at least 2 weeks, but no more than 4
>>>> weeks before releasing 2.11.0.
>>>> All feedback on this pre-release would be welcome: including "it seems
>>>> to work fine, no problem when switching 2.10.3" as well as reports
>>>> about issues found.
>>>>
>>>> Happy hacking,
>>>>
>>>> -+ Tatu +-
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "jackson-user" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/jackson-user/CAL4a10hJLpZ4QZe%2B8A0cF%2BdvcxAhtAYD-jxQy6YxLpTBGbH%2BoA%40mail.gmail.com
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "jackson-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jackson-user/CAEYWR9vNfYv8thSaE7K3omT0VsmDO-LanDz2craf_9hjnr6ngA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/jackson-user/CAEYWR9vNfYv8thSaE7K3omT0VsmDO-LanDz2craf_9hjnr6ngA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "jackson-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jackson-user/CAGrxA252M%3Dx_DLJ0X0VRY9KAURFEHKkZWj77e2iTMCP8DKh6Zg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jackson-user/CAGrxA252M%3Dx_DLJ0X0VRY9KAURFEHKkZWj77e2iTMCP8DKh6Zg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "jackson-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jackson-user/CAEYWR9uEp%3Dcw3qszjU8_EQFbxPfaMdY4RxgQLDVmnn%3DG0PzFXQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/jackson-user/CAEYWR9uEp%3Dcw3qszjU8_EQFbxPfaMdY4RxgQLDVmnn%3DG0PzFXQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jackson-user/CAGrxA26r%3D6%2BwGA%3DmmyDjMZnonLbtAMUBWLiqsDD%2B%3DNAhMwyz9g%40mail.gmail.com.

Reply via email to