java.util.zip.ZipError seems unused
Lance Andersen
lance.andersen at oracle.com
Sun Jun 30 21:40:33 UTC 2024
The code you point to below is leveraging ZipFS, which provided as a demo in JDK 8 and was not a supported part of Java until JDK 9 at which point ZipFS did not use ZipError.
So I understand your point but we also need to keep in mind that demo != supported as we consider the eventual removal of this class.
On Jun 30, 2024, at 10:18 AM, Glavo <zjx001202 at gmail.com> wrote:
I am the maintainer of HMCL and we need to catch ZipError in our program because our program needs to be compatible with Java 8:
https://github.com/HMCL-dev/HMCL/blob/85b68ad135267bc33e03c3624b1bced9b7804c39/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/CompressingUtils.java#L218-L220
I'd love to see it deprecated, but I'm sure there are some use cases for it, so please evaluate the risks carefully.
Glavo
On Sun, Jun 30, 2024 at 5:42 PM Eirik Bjørsnøs <eirbjo at gmail.com<mailto:eirbjo at gmail.com>> wrote:
Hi!
The java.util.zip.ZipError class seems unused in OpenJDK. I assume this is legacy from the native ZIP implementation in Java 8.
This exception class extends InternalError and seems to have been added in Java 6 to help compatibility with existing code catching InternalError (JDK-4615343)
This change also introduced the TestZipError test, which verified that ZipError was thrown while enumerating a ZIP file which was changed after being opened. The reimplementation of the ZIP implementation to Java (JDK-8145260) updated this test to expect a ZipException instead of the ZipError.
Given that this class has now fallen out of use in OpenJDK, should we:
1: Deprecate it
2: Deprecate it for removal
3: Do nothing, keeping it around has a low cost
4: Something else
It would also be useful if someone with access to a large code corpus could search for usages of this class so we could assess compatibility concerns of removing it.
Thanks,
Eirik.
[oracle_sig_logo.gif]
Lance Andersen | Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20240630/55d66dd5/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oracle_sig_logo.gif
Type: image/gif
Size: 658 bytes
Desc: oracle_sig_logo.gif
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20240630/55d66dd5/oracle_sig_logo-0001.gif>
More information about the core-libs-dev
mailing list