Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8213326

(props) Properties.loadFromXML does not fully comply with the spec

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 12
    • core-libs
    • None
    • behavioral
    • minimal
    • Hide
      The proposed change will make the implementation of Properties.loadFromXML comply with the specification, thus reject any XML format that is not as specified in the javadoc for the Properties.loadFromXML method. Applications that use non-compliant documents will no longer work. While this is an incompatible behavior change, it is unlikely to break any normal application since the Properties XML documents generated by Properties.storeToXML are always compliant.
      Show
      The proposed change will make the implementation of Properties.loadFromXML comply with the specification, thus reject any XML format that is not as specified in the javadoc for the Properties.loadFromXML method. Applications that use non-compliant documents will no longer work. While this is an incompatible behavior change, it is unlikely to break any normal application since the Properties XML documents generated by Properties.storeToXML are always compliant.
    • Implementation

      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.

            joehw Joe Wang
            joehw Joe Wang
            Alan Bateman, Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: