-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow @JsonAnySetter on Creator constructors #4366
Conversation
This reverts commit 94540f8.
src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/databind/deser/impl/PropertyValueBuffer.java
Outdated
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
Outdated
Show resolved
Hide resolved
|
||
// [databind#562]: Respect @JsonAnySetter in @JsonCreator | ||
// check if we have anySetter Param | ||
AnnotationIntrospector ai = _context.getAnnotationIntrospector(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alas, this is not acceptable from performance perspective: all annotation introspection must occur when constructing deserializers and related handlers. It should be possible to change handling to keep track of information about existence of "any setter", instead of trying to introspect for every deserialization call.
Impressive. I am bit hesitant to consider this as one more thing before work on Property Introspection rewrite, but no harm in figuring out how this could work. Added some notes. |
I concur. And also in the issue #562, this feature is to get included in 3.x. So I think we can safely consider this feature only after Property Introspection rewrite.
Thankssss! I will keep them updated |
This reverts commit 6a892f8.
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
Outdated
Show resolved
Hide resolved
Add quick check before iteration start
…m/jackson-databind into 562-jsonanysetter-test
WDYT, @cowtowncoder ? |
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/databind/deser/CreatorProperty.java
Outdated
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerFactory.java
Outdated
Show resolved
Hide resolved
Ok. I am still struggling with this; reading again. It is improving, but I am still worried about added complexity. But at the same time this IS a VERY highly voted feature (that is, #562 is) So it'd be great to be able to somehow simplify handling. Not sure how to, tho, so I need to keep on re-reading code. Aside from that, some missing things:
|
I totally agree. Current implementation is both complex and scattered around places. I will probably start isolating the any-setter logics first, maybe to a class, then will read through your comments and add suggested missing parts. thnx @cowtowncoder PS: Reviews applied first. |
Temporarily closing this in favor of #4558 where I added |
resolves #562