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

Chen Liang liach at openjdk.org
Sat Aug 24 15:39: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

src/java.base/share/classes/java/util/zip/ZipError.java line 29:

> 27: 
> 28: /**
> 29:  * Signals that an unrecoverable error has occurred.

I recommend updating this description to indicate it was a bridge for users that handled InternalErrors thrown for input zip format errors.

src/java.base/share/classes/java/util/zip/ZipError.java line 30:

> 28: /**
> 29:  * Signals that an unrecoverable error has occurred.
> 30:  * @deprecated Use {@link ZipException} instead.

We should probably talk about how this is no longer created by the reference implementation since JDK 9 (and JDK 8's zipfs is really a demo). Should we note that we might functionally disable the constructor first?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20642#discussion_r1729996156
PR Review Comment: https://git.openjdk.org/jdk/pull/20642#discussion_r1729997361


More information about the core-libs-dev mailing list