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

Remove XML interchange in java.management/javax/management/modelmbean/DescriptorSupport

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • core-svc
    • None
    • source, binary
    • low
    • Java API
    • SE

      Summary

      Remove the XML interchange feature in javax.management.modelmbean.DescriptorSupport. This means removing the constructor DescriptorSupport(String inStr) and the method toXMLString(), and removing the class javax.management.modelmbean.XMLParseException.

      Problem

      javax.management.modelmbean.DescriptorSupport has a constructor and a method which handle XML, which exist for historical reasons. These are unused in the JDK and have no practical known examples of usage.

      Nothing in the ordinary business of using JMX, creating MBeans, would guide a developer to use the XML interchange methods in javax.management.modelmbean.DescriptorSupport.

      Historical references such as the JMX 1.4 Specification do not discuss this XML interoperability.

      That document does discuss that ImmutableDescriptor and DescriptorSupport are two alternatives to use for holding Descriptor metadata. ImmutableDescriptor has a constructor taking a String which reads name=value fields, not XML. XML features in one of the classes is confusing.

      Comments in historical JCP documents [0] suggest XML interchange was not intended to be part of the specification, but was: "part of this implementation and not required by the JMX Specification".

      DescriptorSupport as it stands does not guarantee XML interchange, the toXMLString() method notes: "The format is not defined, but an implementation must ensure that the string returned by this method can be used to build an equivalent descriptor". That is, the XML parsing which may be incomplete or unreliable.

      The class javax.management.modelmbean.XMLParseException (distinct from but confusingly similar to XMLParseException.java in module java.xml) is redundant and it would have been an error for any code to use this class for its own purposes.

      XML parsing if required, would best be done by an independent implementation, not this class.

      The previous JBS issue for deprecation of this feature (JDK-8347433) is among the top Internet search results for this class name. Discounting copies of the API docs, that issue is almost the top result, other than JDK-6196560 from 2004.

      This feature should be removed.

      [0] https://jcp.org/aboutJava/communityprocess/maintenance/jsr003/jmx1.2-change-log.txt

      Solution

      Removal.

      Specification

      Remove the following from the class javax.management.modelmbean.DescriptorSupport

      • DescriptorSupport(String inStr) constructor

      • toXMLString() method

      Remove the class javax.management.modelmbean.XMLParseException

      Github reference: https://github.com/openjdk/jdk/pull/25697

            kevinw Kevin Walls
            kevinw Kevin Walls
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: