On Wed, Aug 15, 2018 at 5:05 AM, Lyubomyr Shaydariv
<
lyubomyr....@gmail.com> wrote:
> Thanks for the reply, Tatu.
>
> Unfortunately, 2.6.7 works exactly the same like 2.6.3 does. However, if I
> switch to 2.9.6 (and I hope I'll migrate the project I work at too), the
> output is slightly different: `class com.sun.proxy.$Proxy0`. The assertion
> error is never thrown though.
Hmmh. Looking at that, although I am not familiar with usage of Proxy
instances, it seems to me that
behavior here makes sense -- nothing in code is triggering any of
accessors so no exception is thrown.
Usage of Proxy here does not actually matter, as databind is not
really (nor needs to be) aware of its use.
Shouldn't code try to call `getName()` to trigger exception or something?
All Jackson does is invoke `deserialize()` method, which invokes
creation of proxied instance. But since
custom deserializes are expected to handle all actual deserialization
logic, including reading of JSON value
and setting values of Java object created, there is no other action.
I am guessing you might be expecting that only instance was created,
and then Jackson would handle content,
call setters, in which case exception would be expected. This is
possible using `ValueInstantiator` handler, although
bit more work. But plain `JsonDeserializer` delegates all work from databind.
I hope this makes sense.
-+ 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
jackson-user...@googlegroups.com.
> To post to this group, send email to
jackso...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.