sbt / zinc

Scala incremental compiler library, used by sbt and other build tools
Apache License 2.0
334 stars 120 forks source link

ZipCentralDir.java references java.util.zip.ZipError #1385

Closed eirbjo closed 1 week ago

eirbjo commented 3 weeks ago

problem

The class java.util.zip.ZipError has been unused in OpenJDK since JDK 9. Efforts are underway to mark this class as deprecated with the intention to eventually remove it in a future release.

This deprecation issue is being tracked here: https://bugs.openjdk.org/browse/JDK-8336843

To help minimize ecosystem impact, I'm reaching out to SBT because we identified that the ZipCentralDir.java file throws ZipError.

If the deprecation suggestion is accepted by OpenJDK in a future release, then this reference will cause a compiler warning. In a later release, the removal of the class will cause a compilation error.

Looking at the SBT code, it seems it would be more appropriate to throw java.util.zip.ZipException in these cases.

This issue is mostly a heads-up. If you want to take action now and remove/rewrite the referencing code, that would be great. Otherwise, you might start seeing compiler warnings about the deprecation in a not-so-far future..

Thanks!

eed3si9n commented 3 weeks ago

@eirbjo Thanks!

eed3si9n commented 1 week ago

I have two PRs for 1.x and 2.x: