-
Notifications
You must be signed in to change notification settings - Fork 116
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
Unexpected ValueInstantiationException if register ParameterNamesModule #157
Comments
I minimize the test, It caused by add method
|
_
_ So it looks like if you don't use Lombok it is working?
Since this doesn't appear to be related to the jackson-modules-java8, it might be better if moved to jackson-databind, where there are other Lombok-related issues. |
Also note that test must NOT use Lombok: it needs to reproduce it with code as it would be after Lombok has done its processing. However: since parameter-names module is the reason for triggering, I think issue should stay here. |
It's nothing about lombok, It's caused by
|
That is good (that is not Lombok-specific), what I meant is simply that the reproduction should be complete without reference. |
I can not reproduce the issue: modified test passes as expected with 2.10.1 |
Please try this
|
I find that the test only failed with eclipse (v4.13.0 verified) compiler.
https://github.com/FasterXML/jackson-databind/blob/2.10/src/main/java/com/fasterxml/jackson/databind/deser/std/FactoryBasedEnumDeserializer.java#L138 |
One key question is whether parameter name information is (or is not) included. But I would recommend using this:
in case of 1-argument creator method, as well as
to ensure that proper interpretation is used. |
|
@quaff 1-argument creator is special because there are 2 different ways to understand it, and there is no way to reliably determine what user might mean. Basically:
could either match JSON Integer value like
and if so, would be delegated: first bound to OR it could match JSON Object with one property,
Things get more complicated if The reason other constructors are not problematic is that "delegating" version can not be considered as there are multiple values. In case of 1-argument case with no explicit This does not necessarily explain all confusion (for example, int vs String), but hopefully helps with one part. |
@quaff One more note, as per your earlier mention:
That actually explains one thing: if you have At this point I think solution is that you should indicate |
I'm deserialize COSE key, every thing works fine with version
2.10.1
, but failed withParameterNamesModule
registered since I want object immutable, I'm not sure this is same as #123.here is simple test project pname.zip
The text was updated successfully, but these errors were encountered: