-
Notifications
You must be signed in to change notification settings - Fork 122
ParameterNamesModule sets attributes via reflection after calling constructor #72
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
Comments
First of all: thank you for reporting this, and especially including version affected. |
Thanks for looking at this. Your intuition is correct, adding |
I think this is actually same as: FasterXML/jackson-databind#806 and the unfortunate part is that it is rather difficult to fix, at least for 2.x. What happens here, essentially, is that implicit detection of constructors occurs too late for naming strategy to be applied, which leads to name discrepancy. |
I don't think this is specific to parameter names module, and since there is matching issue for |
I noticed that parameter names module behaves very weird when using custom naming strategy.
When using SNAKE_CASE naming strategy (probably others too):
constructor is properly called with all the correct attributes
but afterwards the attributes are set second time via reflection which effectively skips any code that could potentially alter their values in the constructor.
The second set happens in
PropertyBasedCreator.build
becausebuffer.buffered()
is not empty but I don't know jackson internals so I'm not sure if it's ok or not.I've checked version 2.9.4.
Here's a test case reproducing the problem (and a runnable example with gradle):
The text was updated successfully, but these errors were encountered: