-
Notifications
You must be signed in to change notification settings - Fork 34
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
Record deserialisation with instance methods fails #172
Comments
Thank you for reporting this @Giovds. Definitely challenging to have minimal-change implementation for Record deserialization... it is bit fragile to say the least. |
Fixed in 2.18 branch for 2.18.2; should be testable with 2.18.2-SNAPSHOT (added a test but just in case). |
Awesome work! I’ll give it a swing once I’m able to 💪 |
Ok: due to code being bit... minimalistic.. I wouldn't be surprised if you couldn't find other problems still. Eagerly awaiting bug reports :) |
Somewhat late response. I've been able to test it on my repository. It seems to work as expected. 👍 |
@Giovds better late than never :) Thank you for confirmation. |
The deserialisation now works for plain records, as fixed with #167.
However, I've slightly changed my implementation of my record to move some logic for calculating the time into a record instance method. Deserialisation with instance methods fails, as it tries to access a field that does not exist.
The
final List<POJODefinition.Prop> rawProps = beanDef.getProperties();
contains adateTime
property which is declared in the record as instance method. When you get theFoundDependency.class
declared fields it is not there, as it is a derived value and not a constructor parameter. It does however work (as expected) for static instance methods.Test case slightly modified to replicate the issue:
The text was updated successfully, but these errors were encountered: