JDK-8266559 : XPathEvaluationResult.XPathResultType.NODESET maps to incorrect type
  • Type: Bug
  • Component: xml
  • Sub-Component: javax.xml.xpath
  • Affected Version: 17
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-05-05
  • Updated: 2021-06-07
  • Resolved: 2021-06-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b25Fixed
Related Reports
CSR :  
Relates :  
Description
The spec for XPathEvaluationResult.XPathResultType.NODESET 
https://docs.oracle.com/en/java/javase/16/docs/api/java.xml/javax/xml/xpath/XPathEvaluationResult.XPathResultType.html#NODESET
says:

> "The XPath 1.0 NodeSet data type. Maps to org.w3c.dom.NodeList."

However for OpenJDK implementation the following returns null:

   XPathResultType.getQNameType(org.w3c.dom.NodeList.class)

While BTW for NODE OpenJDK implementation matches the spec and works as expected:

  XPathResultType.getQNameType(Node.class) returns XPathConstants.NODE

Comments
Changeset: 7530c00b Author: Joe Wang <joehw@openjdk.org> Date: 2021-06-02 04:57:30 +0000 URL: https://git.openjdk.java.net/jdk/commit/7530c00b33aac8918841dbae4d928956b60c261f
02-06-2021

It's been also noticed that the following is not correct: ================================ NODE public static final XPathEvaluationResult.XPathResultType NODE The XPath 1.0 NodeSet data type. ================================ It is Node data type, not NodeSet
05-05-2021