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

Make BeanDeserializerModifier/BeanSerializerModifier implement java.io.Serializable #4209

Closed
k163377 opened this issue Nov 18, 2023 · 3 comments
Labels
2.17 Issues planned at earliest for 2.17
Milestone

Comments

@k163377
Copy link
Contributor

k163377 commented Nov 18, 2023

Is your feature request related to a problem? Please describe.

The BeanDeserializerModifier does not currently implement Serializable.

On the other hand, this class is used as a field in SimpleModule which implements Serializable.
This means that if a simple implementation of BeanDeserializerModifier is used in a SimpleModule, the JDK serialization may cause unintended errors.

protected BeanDeserializerModifier _deserializerModifier = null;

Describe the solution you'd like

Either have BeanDeserializerModifier implement Serializable or provide a base class like SimpleBeanDeserializerModifier that implements Serializable as well as other supporting classes.

Usage example

No response

Additional context

No response

@k163377 k163377 added the to-evaluate Issue that has been received but not yet evaluated label Nov 18, 2023
@cowtowncoder cowtowncoder changed the title Implement Serializable with BeanDeserializerModifier. Make BeanDeserializerModifier implement java.io.Serializable Nov 20, 2023
@cowtowncoder
Copy link
Member

Hmmh. Interesting. Yes, at least for Jackson 2.x this would make sense. Same wrt BeanSerializerModifier.

@mukham12
Copy link
Contributor

@cowtowncoder,

To ensure clarity, is the solution as straightforward as incorporating implements Serializable into the BeanSerializerModifier class? If that's the case, I could submit a PR.

@cowtowncoder
Copy link
Member

@mukham12 I haven't had a look but I think that'd be it. So both BeanSerializerModifier and BeanDeserializerModifier. And against 2.17 branch (default).

mukham12 added a commit to mukham12/jackson-databind that referenced this issue Nov 21, 2023
@cowtowncoder cowtowncoder changed the title Make BeanDeserializerModifier implement java.io.Serializable Make BeanDeserializerModifier/BeanSerializerModifier implement java.io.Serializable Nov 23, 2023
@cowtowncoder cowtowncoder added 2.17 Issues planned at earliest for 2.17 and removed to-evaluate Issue that has been received but not yet evaluated labels Nov 23, 2023
@cowtowncoder cowtowncoder added this to the 2.17.0 milestone Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.17 Issues planned at earliest for 2.17
Projects
None yet
Development

No branches or pull requests

3 participants