JDK-7193339 : Prepare system classes be defined by a non-null module loader
  • Type: Bug
  • Component: other-libs
  • Sub-Component: other
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-08-22
  • Updated: 2014-06-06
  • Resolved: 2012-09-05
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 8
8 b55Fixed
Related Reports
Relates :  
Relates :  
Description
The system classes are loaded and defined by the VM bootstrap class loader (null). 
In modular world, the system classes are modularized into multiple modules and many
of which will be loaded by its own (non-null) module loader.

The JDK implementation have the assumption that the defining class loader of
all system classes is null and this needs to be fixed to prepare for modularization.
Typical patterns are:

Class.forName(classname, false, null) should be changed to:
   Class.forName(classname, false, <loader of the current class>)

if (loader == null) condition check should be modified to check if the loader
is responsible for loading system classes.

Comments
verified in b74 http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d52081a08d11
04-02-2013

EVALUATION This CR is the first set of changes to prepare that defining class loader for system classes may be non-null in modular world.
22-08-2012