-
Notifications
You must be signed in to change notification settings - Fork 175
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
Issue #356 Demangling kotlin getter #383
Conversation
@cowtowncoder Are there performance considerations around this or tests I should run in that respect? |
* resolve the name of the property, if not given otherwise. | ||
*/ | ||
override fun findNameForSerialization(annotated: Annotated?): PropertyName? { | ||
if (annotated is AnnotatedMethod) { |
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.
Might want to add:
a.declaringClass.methods.any { it.name == "box-impl" }
to ensure that this is an inline class. Or declaredMethods. I always forget which is which.
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.
Hmm, I don't see any methods with box-impl
. The documentation on name mangling doesn't mention that name, but an earlier KEEP does. Do we need another unit test to show this behavior?
One problem with this approach: This could be resolved by instead overriding But it might be even better to use 2.12 introduced FasterXML/jackson-databind#2800 as this would open up much more efficient handling of all aspects of naming for a class -- a strategy instance is created (via .Provider) for given But perhaps the simplest way for now would be overriding |
@cowtowncoder Moved the checking to |
@elektro-wolle Would you sign the CLA for Jackson and email a scan/photo of the result to info at fasterxml dot com? https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf |
@dinomite That sounds like a good approach to me. |
Unfortunately, your gmail settings rejects the mail from my mailserver to your mail-address: |
Hmm, maybe there is something @cowtowncoder, but you can also just send it to me (drew@[my github username].net) and I'll get it on to Tatu. |
Looks like this didn't make it in to 2.12? Just tried updating our Kotlin 1.4 branch to 2.12 and the getters are still mangled. |
@efenderbosch Yes, I still need a CLA from @elektro-wolle |
@dinomite I've just resent the CLA to your address. |
Got the CLA and forwarded to Tatu. I'll get this merged today. |
Fixes issue found in #356, serialization of inline classes, using @elektro-wolle's contribution.