JDK-6612680 : Remove classloader dependency on jkernel
  • Type: Enhancement
  • Component: deploy
  • Sub-Component: deployment_toolkit
  • Affected Version: 6u5,6u10
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,windows
  • CPU: generic
  • Submitted: 2007-10-03
  • Updated: 2011-02-18
  • Resolved: 2011-02-18
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 7
7 b74Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
java.lang.ClassLoader and sun.misc.Launcher have explicit dependencies on the Kernel code.  While the performance impact of this is minimal (the calls basically amount to nops when the JRE is complete), it's still undesirable.

We should restructure this so there is e.g. a system property that controls how these classes delegate, and then have the launcher set this system property to point to the relevant Kernel code when running in a Kernel environment.

Comments
EVALUATION Note that Kernel has also been completely removed from JDK 7
18-02-2011

SUGGESTED FIX Changeset: c499401bc138 Author: mchung Date: 2009-10-05 18:15 -0700 URL: http://hg.openjdk.java.net/jdk7/tl/jdk/rev/c499401bc138 6612680: Remove classloader dependency on jkernel Summary: Add a new sun.misc.BootClassLoaderHook that DownloadManager will implement Reviewed-by: alanb, forax, igor ! make/sun/jkernel/Makefile ! src/share/classes/java/awt/color/ICC_Profile.java ! src/share/classes/java/lang/ClassLoader.java ! src/share/classes/java/util/zip/ZipEntry.java ! src/share/classes/sun/jkernel/DownloadManager.java + src/share/classes/sun/misc/BootClassLoaderHook.java ! src/share/classes/sun/misc/Launcher.java ! src/share/classes/sun/misc/VM.java ! src/share/native/sun/misc/VM.c
06-10-2009

EVALUATION To eliminate the static dependency on jkernel, this fix adds a boot classloader hook interface that is invoked in the ClassLoader findClass, getSystemResource, and other methods. The hook is null by default. The jkernel VM will call the static DownloadManager.setBootClassLoaderHook() method and only the jkernel environment will have a non-null boot class loader hook. Since jkernel is a separate build including the bundles and VM, the jkernel VM is a reasonable place to inject the DownloadManager as the boot class loader hook (see 6888880). This fix depends on 6888880 for jkernel to work.
06-10-2009