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

Support AutoCloseable with SerializationFeature.CLOSE_CLOSEABLE #2382

Closed
Logic-32 opened this issue Jul 17, 2019 · 3 comments
Closed

Support AutoCloseable with SerializationFeature.CLOSE_CLOSEABLE #2382

Logic-32 opened this issue Jul 17, 2019 · 3 comments
Labels
3.0 Issue planned for initial 3.0 release

Comments

@Logic-32
Copy link

The documentation for SerializationFeature.CLOSE_CLOSEABLE clearly indicates that it only closes Closeables as of 2.9.9.1. Can it be updated to close AutoCloseables as well?

Ref:

if (config.isEnabled(SerializationFeature.CLOSE_CLOSEABLE) && (value instanceof Closeable)) {

@cowtowncoder
Copy link
Member

Sounds reasonable since starting with 2.8 Java 7 features (and AutoCloseable was added in Java 7) may be used in jackson-databind.

But just to play it safe, I think this should go in 2.10 (2.10.0.pr1 is due out soon anyway).

@cowtowncoder
Copy link
Member

Hmmh. Actually, due to added throwing of regular Exception, need to spend bit more time on figuring out intricasies here, so won't be quite as easy as I thought.

@cowtowncoder cowtowncoder added 2.12 and removed 2.10 labels Apr 7, 2020
@cowtowncoder cowtowncoder added 2.13 and removed 2.12 labels Oct 27, 2020
@cowtowncoder cowtowncoder added 2.14 and removed 2.13 labels Jul 15, 2021
@cowtowncoder cowtowncoder removed the 2.14 label Mar 2, 2024
@cowtowncoder cowtowncoder added the 3.0 Issue planned for initial 3.0 release label Dec 5, 2024
@cowtowncoder cowtowncoder changed the title Support AutoCloseable with CLOSE_CLOSEABLE feature Support AutoCloseable with SerializationFeature.CLOSE_CLOSEABLE Dec 6, 2024
cowtowncoder added a commit that referenced this issue Dec 6, 2024
cowtowncoder added a commit that referenced this issue Dec 6, 2024
@cowtowncoder
Copy link
Member

Implemented for 3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 Issue planned for initial 3.0 release
Projects
None yet
Development

No branches or pull requests

2 participants