RFR: 8276141: XPathFactory set/getProperty method [v2]
Joe Wang
joehw at openjdk.java.net
Fri Nov 5 17:11:15 UTC 2021
On Fri, 5 Nov 2021 11:02:37 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Joe Wang has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add default impl; Add tests.
>
> src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java line 412:
>
>> 410: *
>> 411: * @throws XPathFactoryConfigurationException if the property name is not
>> 412: * recognized
>
> Are you sure XPathFactoryConfigurationException is the right exception here? This exception suggests "a configuration error in a XPathFactory environment". I would expect something like IllegalArgumentException here.
Agree, IAE would have been more appropriate. The only reason I went with XCE was consistency among the XPath API. It's unfortunate it has not been consistent among the XML libs. The DOM/StAX/XSLT went with IAE, SAX/Validation SAXNotRecognizedException and SAXNotSupportedException, and then XPath XCE which was designed for config error. But if we don't plan to fix XPathFactory::set/getFeature, should we go with sth different for the property methods?
-------------
PR: https://git.openjdk.java.net/jdk/pull/6215
More information about the core-libs-dev
mailing list