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

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

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 12
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      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.
    • Scope:
      Implementation

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: