Skip to content
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

Fixed mapping failure when private companion object is named #438

Merged
merged 2 commits into from May 6, 2021

Conversation

k163377
Copy link
Contributor

@k163377 k163377 commented May 2, 2021

Currently, when retrieving a companion object from a field, the name is used for comparison.

val companionField = possibleCompanion.java.enclosingClass.fields.firstOrNull { it.name == "Companion" }

On the other hand, you can name the companion object as follows.
In this case, the field name in the compilation result will not be Companion.

companion object Named {

}

This causes the mapping to fail.

We fixed this in PR.

Question

I would like to submit a CLA, but is it enough to fill in Your name and Email?
Also, where should I submit it?

I'm not familiar with English or submitting the CLA, so I don't know what to do.
If you could tell me how to do it, I would be very grateful.

Thank you.

@cowtowncoder
Copy link
Member

You can find CLA document here:

https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf

and the process is usually so that you will print the document, fill in name and other fields, sign; then scan it (or take a photo with phone), and finally send that to info at fasterxml dot com address.
This needs to be done just once before the first contribution gets merged.

@cowtowncoder
Copy link
Member

Also: while this looks like a relatively simple fix, it might be safer against 2.13 branch, just in case.

@dinomite WDYT?

@k163377
Copy link
Contributor Author

k163377 commented May 4, 2021

@cowtowncoder I think I probably could have done it, so please check.

@k163377 k163377 changed the base branch from 2.12 to 2.13 May 6, 2021 10:10
@k163377
Copy link
Contributor Author

k163377 commented May 6, 2021

@dinomite @cowtowncoder
Fixed the base to 2.13 according to the comment.
#408 (comment)

Copy link
Member

@dinomite dinomite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I'll get this merged shortly.

@dinomite dinomite merged commit 303c1c7 into FasterXML:2.13 May 6, 2021
@cowtowncoder cowtowncoder added the 2.13 Issue affecting version 2.13 label May 8, 2021
@cowtowncoder cowtowncoder added this to the 2.13.0 milestone May 8, 2021
@cowtowncoder cowtowncoder changed the title Fixed mapping failure when private companion object is nammed. Fixed mapping failure when private companion object is named May 8, 2021
@cowtowncoder
Copy link
Member

quick note: thank you everyone for handling this quickly; I filed the CLA in the meantime and will update release notes (https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.13/ and release-notes/VERSION-2.x)

cowtowncoder added a commit that referenced this pull request May 8, 2021
@dinomite
Copy link
Member

dinomite commented May 9, 2021

@cowtowncoder Thanks for getting the notes!

@k163377 k163377 deleted the fix_on_named_companion branch May 16, 2021 05:18
@k163377 k163377 mentioned this pull request Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.13 Issue affecting version 2.13
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants