Thank you. I have logged the issue here:
https://github.com/FasterXML/jackson-databind/issues/1395
On Monday, 3 October 2016 04:33:17 UTC+2, Tatu Saloranta wrote:
>
> I can't say for sure either; could you please file a bug at
> `jackson-databind`, including sample code in issue itself?
>
> I suspect this has to do with the special treatment that a small number of
> "natural" types (long/Long, boolean/Boolean, String, double/Double) require
> with polymorphic typing (basically: no type info is to ever be used nor
> expected -- this is an optimization for common case of String values), but
> since you are not customizing handling in any way, it should just work, as
> far as I can see.
>
> One thing I would suggest as a general thing, is to follow one simple
> rule: never use generic types as the root value -- instead, use a Bean type
> with no type parameters, or, if you do want to use Collection/Map, create a
> fully typed, non-generic subtype. For example, in this case using type like:
>
> public class StringObjectMap
> extends HashMap<String,Object> { }
>
> might avoid issues. The problem with generic types is that due to Java
> type erasure, serializer has no access to type information if you pass a
> HashMap instance -- it is seen as `HashMap<?,?>` at runtime, regardless of
> what source code indicates (as this only translates to cast; underlying
> class, HashMap.class, is same for all instances).
>
> Anyway, this seems like a possible bug.
>
> -+ Tatu +-
>
>
> On Fri, Sep 30, 2016 at 1:48 AM, Anton van Aswegen <[email protected]
> <javascript:>> wrote:
>
>> I hit a roadblock while trying to use Jackson. Please see this issue
>> logged on Stack Overflow:
>>
>>
>> http://stackoverflow.com/questions/39773266/deserialize-primitive-long-field-while-using-typeresolverbuilder-of-jackson
>>
>> I have no idea if it is a bug or if I am doing something wrong. Any help
>> will be appreciated.
>>
>> - Anton -
>>
>>
>> --
>> 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] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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 post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.