-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Deduction of supertypes #3300
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
base: 2.13
Are you sure you want to change the base?
Deduction of supertypes #3300
Conversation
// Pre-sorted fingerprints means the _first_ item may be a supertype... | ||
BitSet supertypeFields = candidates.get(0); | ||
|
||
// bitset is mutable, must take a copy :( ThreadLocal? |
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.
I'm not in love with this method being part of the live processing. Have a sneaking feeling I've missed some logic reduction here
I wish I could give good feedback here, but unfortunately I don't really know the area well enough. Just not sure where to get that feedback; mailing lists are often black holes / void into which I can yell questions and not get many answers. |
Ok. I'm still thinking on it myself but am coming around to the idea that honouring |
FYI This is PR is not abandoned. Additional thought : incorporate required properties |
To discuss: Alternative implementation of #3289 allowing supertypes to be selected.
In this form it is very lenient:
@JsonSubTypes
@JsonSubTypes
)As seen from changes to the tests, it's actually fairly hard to get this code to fallback to
defaultImpl
ifAnimal
is non-abstract. This represents a change in behaviour.h3. FAIL_ON_UNKNOWN_PROPERTIES
Notably the code remains unaware of
FAIL_ON_UNKNOWN_PROPERTIES
so{a,x}
will resolve subtype asAnimal
but then fail on propertyx
. This is quite easy to resolve but is a policy that needs clarifying - should{a,x}
fail deduction and usedefaultImpl
or deduce Animal and fail via further-downstream error handling?