RFR: JDK-8302281 - ImageIO objects should implement AutoClosable
Markus KARG
duke at openjdk.org
Sat Feb 11 18:24:21 UTC 2023
ImageIO objects, like ImageReader, ImageWrite, ImageInputStream and ImageOutputStream, should implement AutoClosable.
There is a risk of keeping resources opened longer than needed (or even run into a resource leak with long running processes) as the user cannot use try-with-resources currently. The fact that there is a `dispose()` method to be called is easily missed, as people tend to look for `close()`.
This is not a big change, but it is useful for those working with ImageIO.
-------------
Commit messages:
- Implements AutoCloseable
Changes: https://git.openjdk.org/jdk/pull/12098/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12098&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8302281
Stats: 20 lines in 3 files changed: 14 ins; 0 del; 6 mod
Patch: https://git.openjdk.org/jdk/pull/12098.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/12098/head:pull/12098
PR: https://git.openjdk.org/jdk/pull/12098
More information about the client-libs-dev
mailing list