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

XPathEvaluationResult.XPathResultType.NODESET maps to incorrect type

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P2
    • Resolution: Approved
    • Fix Version/s: 17
    • Component/s: xml
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Docs only, no incompatibility.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Makes a correction to XPathEvaluationResult.XPathResultType.NODESET mapping. Clarifies the supported types for the evaluateExpression methods.

      Problem

      During the development of the XPath enhancement (JDK-8054196), the representation of NODESET had evolved into a new class XPathNodes because of the lack of Iterable in the NodeList it originally mapped to. The specification of the Enum mapping in XPathEvaluationResult.XPathResultType however, was mistakenly left unchanged.

      Furthermore, in parts of the specification, that is, the evaluateExpression methods in XPath and XPathExpression, it was not clearly indicated what are valid class types for the type parameter.

      Solution

      Fix the javadoc for XPathEvaluationResult.XPathResultType.NODESET to state that it maps to XPathNodes.

      Add documentation in the class type definitions and evaluateExpression methods to explain the differences between the old QName and new Class type mappings. Add links from the type parameter for the evaluateExpression method to the class type definitions.

      Specification

      1. XPathEvaluationResult.XPathResultType.NODESET

        Corrected the mapping class as being XPathNodes. Fixed a typo to the javadoc for NODE to NODE instead of NODESET.

      2. Package summary

        Add the following to section 3.3 Enum types:

        There are two differences in between the Enum and QName mappings:

        • NUMBER
          In the QName mapping, NUMBER was mapped to a double data type, while in the Enum mapping, it is expanded to support Double, Integer and Long.

        • NODESET
          In the QName mapping, NODESET was mapped to a NodeList, while in the Enum mapping, it is XPathNodes.
      3. evaluateExpression methods in XPath and XPathExpression

        Add a statement to indicate the valid types as those listed in section 3.2 Class types in the package summary.


      specdiff 01: http://cr.openjdk.java.net/~joehw/jdk17/8266559/specdiff_01/overview-summary.html

      spec 01 (useful for verifying the links): http://cr.openjdk.java.net/~joehw/jdk17/8266559/spec_01/

      Attached: 8266559_spec_01.zip, 8266559_specdiff_01.zip


      Update 02: updated item 2. Package summary.

      1. Package summary

        Add the following to section 3.3 Enum types:

        Note the differences between the Enum and QName mappings:

        • NUMBER
          The Enum mapping for NUMBER supports Double, Integer and Long.

        • NODESET
          The Enum mapping for NODESET is XPathNodes instead of NodeList in the QName mapping.

      specdiff 02: http://cr.openjdk.java.net/~joehw/jdk17/8266559/specdiff_02/overview-summary.html

      spec 02: http://cr.openjdk.java.net/~joehw/jdk17/8266559/spec_02/

      Attached: 8266559_spec_02.zip, 8266559_specdiff_02.zip

        Attachments

        1. 8266559_spec_01.zip
          111 kB
        2. 8266559_spec_02.zip
          111 kB
        3. 8266559_specdiff_01.zip
          47 kB
        4. 8266559_specdiff_02.zip
          47 kB

          Issue Links

            Activity

              People

              Assignee:
              joehw Joe Wang
              Reporter:
              dbessono Dmitry Bessonov
              Reviewed By:
              Lance Andersen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: