RFR: 8377049: (zipfs) ZipException in ZipFileSystemProvider.newFileSystem() is swallowed
Jaikiran Pai
jpai at openjdk.org
Tue Feb 10 10:55:57 UTC 2026
On Tue, 10 Feb 2026 10:32:46 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Can I please get a review of this change which proposes to improve the exception reported by `jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(...)` methods when a `ZipException` occurs for invalid ZIP files? This addresses https://bugs.openjdk.org/browse/JDK-8377049.
>>
>> As noted in that issue the file whose `ZipException` wasn't being propagated was a JMOD file. The change here will now propagate the `ZipException` for JMOD files similar to ZIP and JAR files. The comments in that JBS issue has additional discussion about this change.
>>
>> A new jtreg test has been introduced to verify this change.
>
> src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java line 125:
>
>> 123: // file. for others, raise a UnsupportedOperationException.
>> 124: String fname = path.getFileName().toString();
>> 125: // JMOD files are expected to have (case sensitive) .jmod extension
>
> I don't think this is strictly true but unlikely that there are JMOD files with the extension in upper case.
Hello Alan, I came to that conclusion based on what I see in `JmodArchive` https://github.com/openjdk/jdk/blob/master/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JmodArchive.java#L78 which rejects any file that doesn't have a case sensitive `.jmod` extension.
Would you prefer if we did a case insensitive check in this exception block like we do for ZIP and JAR files?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29646#discussion_r2787239673
More information about the core-libs-dev
mailing list