-
Bug
-
Resolution: Incomplete
-
P3
-
None
-
13
-
x86
-
os_x
ADDITIONAL SYSTEM INFORMATION :
This will potentially occur in any OS for code that was compiled against the older API.
A DESCRIPTION OF THE PROBLEM :
Previously it was possible to call java.nio.file.FileSystems.newFileSystem(Path path, ClassLoader loader) with the path to a ZIP file and a null ClassLoader argument, and it would work fine. JDK 13 introduced an overloaded method, which takes a Path and a Map. Unfortunately, the code which previously worked is now calling this new overload instead, and crashing with a NullPointerException when it tries to work with the null Map.
REGRESSION : Last worked in version 11.0.5
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create or find a ZIP file.
call java.nio.file.FileSystems.newFileSystem(new File("/path/of/file.zip").toPath(), null); under JDK 11 or earlier; it will work fine. Try it under JDK 13 and it crashes.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
An opened ZIP filesystem.
ACTUAL -
java.lang.NullPointerException:
java.nio.file.FileSystems.newFileSystem FileSystems.java: 436
java.nio.file.FileSystems.newFileSystem FileSystems.java: 524
jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem ZipFileSystemProvider.java: 136
CUSTOMER SUBMITTED WORKAROUND :
Finding and passing a non-null ClassLoader is a workaround that is backwards compatible with earlier JDKs, but this issue has already caused problems for my users, and will likely impact other projects using ZIP filesystems. Enhancing the new overload of the method to treat a null Map the same as an empty one would restore backwards compatibility with earlier releases.
FREQUENCY : always
This will potentially occur in any OS for code that was compiled against the older API.
A DESCRIPTION OF THE PROBLEM :
Previously it was possible to call java.nio.file.FileSystems.newFileSystem(Path path, ClassLoader loader) with the path to a ZIP file and a null ClassLoader argument, and it would work fine. JDK 13 introduced an overloaded method, which takes a Path and a Map. Unfortunately, the code which previously worked is now calling this new overload instead, and crashing with a NullPointerException when it tries to work with the null Map.
REGRESSION : Last worked in version 11.0.5
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create or find a ZIP file.
call java.nio.file.FileSystems.newFileSystem(new File("/path/of/file.zip").toPath(), null); under JDK 11 or earlier; it will work fine. Try it under JDK 13 and it crashes.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
An opened ZIP filesystem.
ACTUAL -
java.lang.NullPointerException:
java.nio.file.FileSystems.newFileSystem FileSystems.java: 436
java.nio.file.FileSystems.newFileSystem FileSystems.java: 524
jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem ZipFileSystemProvider.java: 136
CUSTOMER SUBMITTED WORKAROUND :
Finding and passing a non-null ClassLoader is a workaround that is backwards compatible with earlier JDKs, but this issue has already caused problems for my users, and will likely impact other projects using ZIP filesystems. Enhancing the new overload of the method to treat a null Map the same as an empty one would restore backwards compatibility with earlier releases.
FREQUENCY : always