JDK-8213326 : (props) Properties.loadFromXML does not fully comply with the spec
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.util
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 12
  • Submitted: 2018-11-02
  • Updated: 2018-12-21
  • Resolved: 2018-11-30
Related Reports
CSR :  
Description
Summary
-------

Enhance the underlying XML parser to make the loadFromXML implementation comply with the Properties' specification.

Problem
-------

The underlying small footprint XML parser for the loadFromXML function may accept XML documents that are not compliant with the specification of the Properties.loadFromXML method. This may result in inconsistent file format generated by the Properties.storeToXML.

Solution
--------

Improve the small footprint parser to allow the implementation to be compliant with the specification. The parser and handler implementation shall reject non-compliant XML documents by throwing the InvalidPropertiesFormatException as specified by the Properties.loadFromXML method.

Documents created by Properties.storeToXML: no change. Properties.loadFromXML shall have no problem reading the files.

Documents not created by Properties.storeToXML: any documents that contain DTD not in the format as specified in Properties.loadFromXML will be rejected. This means the DTD shall be exactly as the follows:

         <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">

Specification
-------------

No changes needed to the specification.

Comments
Moving to Approved.
30-11-2018

Hi Joe, I added details to the Solution section on what will be accepted or not. Thanks.
29-11-2018

[~joehw] can you give some more detail categorizing the XML documents that will no longer be accepted after this change?
29-11-2018