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

Failed copy(): IonValueMapper does not override copy() #497

Closed
mr-robert opened this issue Jun 5, 2024 · 5 comments
Closed

Failed copy(): IonValueMapper does not override copy() #497

mr-robert opened this issue Jun 5, 2024 · 5 comments
Milestone

Comments

@mr-robert
Copy link

mr-robert commented Jun 5, 2024

When calling .copy() on instance of IonValueMapper, I expect to get a new IonValueMapper with the same configuration. However, instead I get this expection.

I am using 2.12 but I checked the source of the latest version on github, and I do not see this method overridden.

I think that as this class is provided by Jackson themselves, they should provide the implementation of the overridden .copy() in IonValueMapper.

@cowtowncoder
Copy link
Member

cowtowncoder commented Jun 6, 2024

@mr-robert You are absolutely correct: this method should be overridden by format-specific ObjectMapper subtypes. Exception is there to avoid case of caller accidentally getting an instance of super type -- but since ObjectMapper is concrete type, copy() method cannot be left as abstract. So it's not an optimal situation wrt ensuring implementation.

@cowtowncoder cowtowncoder changed the title Failed copy(): com.fasterxml.jackson.dataformat.ion.ionvalue.IonValueMapper (version: 2.12.7) does not override copy() Failed copy(): IonValueMapper does not override copy() Jun 7, 2024
@cowtowncoder cowtowncoder modified the milestones: 2.17.0, 2.17.2 Jun 7, 2024
@mr-robert
Copy link
Author

Thanks for this. I just ran into a similar issue, wondering if it should be fixed as well when using IonValueMapper.builder(...) methods, there is no overload in IonValueMapper, therefore the modules IonValueModule and EnumAsIonSymbolModule do not get attached if creating a mapper using IonValueMapper.builder(...) methods.

@cowtowncoder
Copy link
Member

cowtowncoder commented Aug 13, 2024

@mr-robert Could you file a separate issue for that, if you think it should be addressed?

Although to be honest, I am not 100% sure I follow: in 2.x, Builders simply wrap around ObjectMapper instances (like IonObjectMapper) so behavior should be similar.
IonValueModule and EnumAsIonSymbolModule do not seem to be added if construction IonObjectMapper directly either?

@mr-robert
Copy link
Author

Created #509

@cowtowncoder
Copy link
Member

Ahhhh... IonVALUEMapper, not IonObjectMapper (which has overrides). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants