-
CSR
-
Resolution: Approved
-
P2
-
None
-
minimal
-
Docs only, no incompatibility.
-
Java API
-
SE
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
XPathEvaluationResult.XPathResultType.NODESET
Corrected the mapping class as being
XPathNodes
. Fixed a typo to the javadoc forNODE
toNODE
instead ofNODESET
.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.
- NUMBER
evaluateExpression
methods in XPath and XPathExpressionAdd 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.
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
- csr of
-
JDK-8266559 XPathEvaluationResult.XPathResultType.NODESET maps to incorrect type
-
- Resolved
-