-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Wrong getter/setter names for generated for certain corner cases #1129
Comments
Yes, I met the same issue when using fasterxml.jackson to generate xml from javabean, which has used the "@DaTa" And you can find the related doc from oracle about this: Please refer to below section:
I think it would be better to fix this bug asap, otherwise, some magic bug would be hard to found. |
In #757 this was dropped due to Java community being split on the topic. I still believe it is worth the hassle and could be fixed in the next major release. A better option might be to include a new The current workaround is to write your own getters and setters for fields related to this issue, to conform to the JavaBeans API Specification. |
There is a simpler workaround for Jackson: The new '@Jacksonize' annotation that is in the edge release, possibly with '@JsonProperty' / '@JsonGetter' on any fields still having issues. As for the whole bean naming issue: The whole point of it is that there is no single spec everyone adheres to. There is no such thing as 'strict' when doing that breaks half of the world. |
@anddero You can also add One of the maintainers already mentioned that they will accept a PR that changes this (unfortunately only without a config key to get back the current behaviour...). |
It seems, when you have a custom accessor like @Rawi01 So it is not even necessary to add those annotations to specific fields. |
Duplicate of #2693 |
Lombok generates non-valid getter names for certain corner cases of Java Bean specification.
Namely fields which have second letter uppercase like
xAxis
oriMessage
should becomesetxAxis(...)
andsetiMessage(...)
- not very intuitive but it seems to be that way. Lombok on the other hand generatessetXAxis(...)
andsetIMessage(...)
.This issue usually doesn't do much harm until you do something like deserialize object annotated via
@Data
through Jackson. In this case those fields remain unset because no setter with valid name exists for such fields.There is a blog post explaining this issue nicely.
The text was updated successfully, but these errors were encountered: