RFR: 8336843: Deprecate java.util.zip.ZipError for removal

Lance Andersen lancea at openjdk.org
Fri Aug 23 20:15:03 UTC 2024


On Tue, 20 Aug 2024 10:24:25 GMT, Eirik Bjørsnøs <eirbjo at openjdk.org> wrote:

> Please review this PR which suggests to deprecate the unused class `java.util.zip.ZipError` for removal.
> 
> The class has been unsed by OpenJDK since  the ZIP API was rewritten from native to Java in JDK 9.
> 
> I opted to not explain the reason for the deprecation in detail, but instead simply point to `ZipException` as an alternative. Should more explanation be desired, I could prepend that with a note saying that the class is unused since JDK 9.
> 
> A CSR for this API update has been drafted, I'll update the Specification section there once we reach a concensus on the deprecation note in this PR.
> 
> This deprecation was initially suggested here: https://mail.openjdk.org/pipermail/core-libs-dev/2024-June/125720.html

> There’s also [HMCL’s `org.jackhuang.hmcl.util.io.CompressingUtils`](https://github.com/HMCL-dev/HMCL/blob/95a1496389e6a8c2f51697706a20055a7952b8a5/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/CompressingUtils.java#L218-L220), which catches `ZipError` to convert it to a `ZipException` when run on **Java 8** ([this was also mentioned in the linked core‑libs‑dev discussion](https://mail.openjdk.org/pipermail/core-libs-dev/2024-June/125724.html)).

Yes that is true.  The difference there is that is due to the demo version of Zip FS and as of JDK 9, when Zip FS was supported, it did not throw ZipError

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20642#issuecomment-2307744487


More information about the core-libs-dev mailing list