JDK support for VM to read classes from modules in a module library
mandy.chung at oracle.com
Wed May 16 13:39:20 PDT 2012
On 5/16/2012 12:07 PM, Jesse Glick wrote:
> On 05/16/2012 01:42 PM, Alan Bateman wrote:
>> [...In Properties] the workaround is to use the loader for the base
>> module to load
>> XMLUtils. Given that XMLUtil is currently in the jaxp module (and I
>> know this isn't quite right either as JAXP is a standalone technology
>> etc.) then I would think that
>> the Properties code will need to do a Class.forName on an exported
>> javax.xml type and use that loader (or alternative use jdk.jaxp).
> You have a module system now, why not clean this up and get rid of the
> reflection (and cyclic dependency)?
Right - there are opportunities in the jdk code for this kind of clean
up but not for this XMLUtils case unfortunately because JAXP is a
standalone technology  as Alan and I mention.
One can install a complete and newer implementation of JAXP to replace
the one that was provided in the original implementation of the Java
Platform. XMLUtils is our own implementation class or a service
interface that is implementation-specific as you propose. JAXP
provided by other vendor would not provide the XMLUtils service unless
it's part of the specification. Hence we probably have to move
sun.util.xml.XMLUtils back to the jdk.base module and it is fine since
it only uses the standard jaxp API.
More information about the jigsaw-dev