RFR: 8336843: Deprecate java.util.zip.ZipError for removal [v2]

Lance Andersen lancea at openjdk.org
Tue Aug 27 19:09:04 UTC 2024


On Tue, 27 Aug 2024 15:51:24 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
>
> Eirik Bjørsnøs has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Extend the deprecation note to mention that the error became obsolete in JDK 9 and to mention that code may be updated to catch the super class InternalError

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

> 32:  * error when running on JDK 8 or earlier releases may catch
> 33:  * the parent {@link InternalError} instead.
> 34:  * @author  Dave Bristor

As mentioned in an earlier PR comment, the verbiage regarding 


 * Code needing to catch this
 * error when running on JDK 8 or earlier releases may catch
 * the parent {@link InternalError} instead.


Should be in an RN for the JDK release that this PR is approved for, not the proposed javadoc.  Additionally, an RN could  be added  to a future JDK 8 update release after the PR is committed to mainline.

The javadoc should be focused on the current JDK release, not the prior history of this Class


I would suggest something similar to:



 * @deprecated ZipError is deprecated and subject to removal in a
 *  future release. This class is obsolete. Use  {@link ZipException} instead.


or 


 * @deprecated ZipError is deprecated and subject to removal in a
 *  future release. This Error is obsolete and no longer thrown. Use  {@link ZipException} instead.

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

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


More information about the core-libs-dev mailing list