You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an instance where I only have access to a DeserializationConfig but then need the full DeserializationContext to call a method. Any suggestions about how I can get a context from a config or how I could refactor the code to store a context?
Since DeserializationContext is per-call (i.e. no stateful instance
created for each readValue()) but DeserializationConfig is not (it
is immutable already in 2.x), latter can not contain reference to
former, so that is unfortunately not possible.
I think I'd need to understand usage bit better -- could you create an
issue for jackson-databind, adding references from your link, so I
can have a look at it? AnnotationIntrospector is similar to DeserializationConfig and lacks access to DeserializationContext
(nor should expect one), but there should be a way to refactor things.
The text was updated successfully, but these errors were encountered:
ScalaAnnotationIntrospectorModule findValueInstantiator receives a DeserializationConfig and creates its own ValueInstantiator that makes a call that needs the full DeserializationContext -- calling StdValueInstantiator getFromObjectArguments (this is the method that seems to have changed recently)
I must have thought I have a reason to change argument from config to context, but I can not really remember what that would be now. Since it does not actually appear to be necessary, I reverted the change, rebuilt 3.0.0-SNAPSHOT, and will try recompiling other modules just to make sure.
Looks like ctxt was needed/used by Eclipse Collections, and the reason was that access to TypeDeserializers now requires DeserializationContext, not just DeserializationConfig.
There was a good reason (... that now escapes me) for that change, but unfortunately this can be problematic for creating ValueInstantiator. Need to resolve that, but I don't think ctxt should be passed via getFromObjectArguments()... at least until I figure out a solid reason.
I hope this allows making Scala module compile against 3.0 of databind (or at least closer)
https://groups.google.com/forum/#!topic/jackson-dev/q9U-ztM0QYA
I had this module compiling but a lot of tests were broken. There is 1 compile problem now (after a recent jackson-databind change).
https://travis-ci.org/github/FasterXML/jackson-module-scala/jobs/695451500
There is an instance where I only have access to a DeserializationConfig but then need the full DeserializationContext to call a method. Any suggestions about how I can get a context from a config or how I could refactor the code to store a context?
Response from @cowtowncoder
Since
DeserializationContext
is per-call (i.e. no stateful instancecreated for each
readValue()
) butDeserializationConfig
is not (itis immutable already in 2.x), latter can not contain reference to
former, so that is unfortunately not possible.
I think I'd need to understand usage bit better -- could you create an
issue for
jackson-databind
, adding references from your link, so Ican have a look at it? AnnotationIntrospector is similar to
DeserializationConfig
and lacks access toDeserializationContext
(nor should expect one), but there should be a way to refactor things.
The text was updated successfully, but these errors were encountered: