JDK-8193802 : NullPointerException from JarFileSystem.getVersionMap()
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 9.0.1,10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: generic
  • Submitted: 2017-12-19
  • Updated: 2022-02-24
  • Resolved: 2018-01-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 11
10.0.2Fixed 11 b01Fixed
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION : 
javac 9.0.1 

ADDITIONAL OS VERSION INFORMATION : 
Microsoft Windows [Version 10.0.15063] 

An exception has occurred in the compiler (9). Please file a bug against the Java compiler via the Java bug reporting page 
(http://bugreport.java.com) after checking the Bug Database 
(http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you. 
java.lang.NullPointerException 
at 
jdk.zipfs/jdk.nio.zipfs.JarFileSystem.getVersionMap(JarFileSystem.java:137) 
at 
jdk.zipfs/jdk.nio.zipfs.JarFileSystem.createVersionedLinks(JarFileSystem.java:112) 
at jdk.zipfs/jdk.nio.zipfs.JarFileSystem.<init>(JarFileSystem.java:85) 
at 
jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:134) 
at 
jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer.<init>(JavacFileManager.java:517) 
at 
jdk.compiler/com.sun.tools.javac.file.JavacFileManager.getContainer(JavacFileManager.java:319) 
at 
jdk.compiler/com.sun.tools.javac.file.JavacFileManager.list(JavacFileManager.java:715) 
at 
jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:722) 
at 
jdk.compiler/com.sun.tools.javac.code.ClassFinder.scanUserPaths(ClassFinder.java:655) 
at 
jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:526) 
at 
jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:293) 
at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:633) 
at 
jdk.compiler/com.sun.tools.javac.code.Symbol$PackageSymbol.members(Symbol.java:1120) 
at 
jdk.compiler/com.sun.tools.javac.code.Symtab.listPackageModules(Symtab.java:810) 
at 
jdk.compiler/com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:344) 
at 
jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:529) 
at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:285) 
at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:300) 
at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:570) 
at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:554) 
at 
jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1052) 
at 
jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:923) 
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:302) 
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:162) 
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) 
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43) 
Comments
Downstream issue for Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1557375
08-05-2018

Fix Request: This bug crashes the compiler for multi-versioned jars which do not include any version specific classes (directory /META-INF/versions in the jar does not exist). Risk is rather minimal as the fix is an added null check and the code hasn't changed otherwise.
08-05-2018

URL: http://hg.openjdk.java.net/jdk/jdk/rev/554cb38e0caf User: sherman Date: 2018-01-31 22:26:20 +0000
31-01-2018

getVersionMap() to return a empty map instead of throwing a NPE if there is actually no any version entry.
03-01-2018