RFR: 8377049: (zipfs) ZipException in ZipFileSystemProvider.newFileSystem() is swallowed

Alan Bateman alanb at openjdk.org
Tue Feb 10 11:02:26 UTC 2026


On Tue, 10 Feb 2026 10:52:30 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> 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?

TBH, I don't think the zip provider should know anything about JMOD files, it's just unfortunate that javac relies on this to access JMOD files. I need to think about this more as it might be that the right thing is to include a simple file system provider in jdk.compiler for javac to be able to access the contents of a JMOD file as a file system.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29646#discussion_r2787276808


More information about the core-libs-dev mailing list