8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present

Alan Bateman Alan.Bateman at oracle.com
Wed Dec 5 18:58:19 UTC 2012

A while back [1], I brought up the issue of the Properties 
storeToXML/loadFromXML methods being problematic for our efforts to 
modularize the JDK and also the Compact Profiles effort. At the time I 
mentioned that we were thinking of including a small footprint XML 
parser that we could use in the base module (when JAXP is not present) 
and also use in the compact1 profile. The preparatory work to create a 
JDK-internal provider mechanism and the spec work to only require an 
implementation support UTF-8 and UTF-16 is already in jdk8, now it's 
time for the next step.

Joe Wang has taken the JSR-280 RI, which includes some code from SAX, 
and stripped it down so that it's reasonably small (less than 50k in a 
compressed rt.jar). We've hooked it up to Properties so that it works as 
a fallback when there isn't an XmlPropertiesProvider present. There's 
still a good bit of clean-up required and there's probably more that can 
be pulled out but it's at the point where we can start early review. To 
that end, the webrev with everything is here:


For tests then I've changed the LoadAndStoreXML test that I added 
recently to exercise the implementation. Otherwise, the implementation 
will only be used when testing the smallest profile (compact1, brewing 
in the jdk8/profiles forest) or when it gets pulled into the downstream 
jigsaw forest. Joe has some additional tests and we need to compare 
these with existing tests to see if it's worth converting them.

One issue that I'm still mulling over, as least for the profiles effort, 
is whether to only include the fallback provider in the smallest profile 
as it won't be used otherwise. If the eventual size isn't too 
significant then it might not be worth it of course.


More information about the core-libs-dev mailing list