diff options
author | Ville Koskela <ville@koskelafamily.com> | 2020-04-28 21:21:07 -0700 |
---|---|---|
committer | Tatu Saloranta <tsaloranta@gmail.com> | 2020-05-02 09:47:03 -0700 |
commit | 9a70c0e133cbf287f86b4138264494553a987429 (patch) | |
tree | 1a81a3c2ef16609493dc195e0cef5802cab58b32 /src/main/java/com/fasterxml | |
parent | d9b8e7beb11f2a66ba3ed1745bff66e44905b06a (diff) | |
download | jackson-databind-9a70c0e133cbf287f86b4138264494553a987429.tar.gz |
Added test demonstrating issue 2486.
Diffstat (limited to 'src/main/java/com/fasterxml')
-rw-r--r-- | src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBase.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBase.java b/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBase.java index 4a15bfbcb..98139a5bc 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBase.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBase.java @@ -212,7 +212,25 @@ public abstract class BeanDeserializerBase _injectables = (injectables == null || injectables.isEmpty()) ? null : injectables.toArray(new ValueInjector[injectables.size()]); _objectIdReader = builder.getObjectIdReader(); + + // If you check for canCreateFromInt() below which appears to be the equivalent + // of the existing canCreateUsingArrayDelegate() it also causes the included + // test testPOJOWithPrimitiveCreatorFromObjectRepresentation() to break in the + // same way as the test testPOJOWithArrayCreatorFromObjectRepresentation() which + // I assert is failing because of the call to canCreateUsingArrayDelegate() below. + // + // Removing the call to canCreateUsingArrayDelegate() below allows the test + // testPOJOWithArrayCreatorFromObjectRepresentation() to pass and interestingly + // all existing tests continue to pass. I somehow doubt that it's that simple. + // + // Specifically, it seems to me that the vanilla-ness of the deserialization can + // only be determined once the structure of the incoming JSON can be compared to + // what creator methods exist. For example, if there is an array delegate and we + // are asked to deserialize from an array then it's not vanilla. However, if we + // are asked to deserialize from an object then it's vanilla (subject to no other + // non-vanilla-ness being present). _nonStandardCreation = (_unwrappedPropertyHandler != null) + //|| _valueInstantiator.canCreateFromInt() || _valueInstantiator.canCreateUsingDelegate() || _valueInstantiator.canCreateUsingArrayDelegate() // new in 2.7 || _valueInstantiator.canCreateFromObjectWith() |