-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b11
LauncherHelper.getMainClassFromJar takes a String as parameter corresponding to a jar file where the "Main-Class" attribute needs to be determined. It returns a Class reference.
However, it closes the jar file that the JDK has just spent time in opening and parsing (building CEN structure etc) :
at java.base/java.util.zip.ZipFile$Source.release(ZipFile.java:1482)
at java.base/java.util.zip.ZipFile$CleanableResource.run(ZipFile.java:804)
at java.base/jdk.internal.ref.CleanerImpl$PhantomCleanableRef.performCleanup(CleanerImpl.java:178)
at java.base/jdk.internal.ref.PhantomCleanable.clean(PhantomCleanable.java:133)
at java.base/java.util.zip.ZipFile$CleanableResource.clean(ZipFile.java:728)
at java.base/java.util.zip.ZipFile.close(ZipFile.java:837)
at java.base/sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:676)
at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:848)
at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:756)
The launcher process would benefit from a performance gain (avoid rebuilding the zip index) if the jar file remains opened. The Class returned is about to be loaded and the jar file will be opened again (with current code).
However, it closes the jar file that the JDK has just spent time in opening and parsing (building CEN structure etc) :
at java.base/java.util.zip.ZipFile$Source.release(ZipFile.java:1482)
at java.base/java.util.zip.ZipFile$CleanableResource.run(ZipFile.java:804)
at java.base/jdk.internal.ref.CleanerImpl$PhantomCleanableRef.performCleanup(CleanerImpl.java:178)
at java.base/jdk.internal.ref.PhantomCleanable.clean(PhantomCleanable.java:133)
at java.base/java.util.zip.ZipFile$CleanableResource.clean(ZipFile.java:728)
at java.base/java.util.zip.ZipFile.close(ZipFile.java:837)
at java.base/sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:676)
at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:848)
at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:756)
The launcher process would benefit from a performance gain (avoid rebuilding the zip index) if the jar file remains opened. The Class returned is about to be loaded and the jar file will be opened again (with current code).