RFR: 8276141: XPathFactory set/getProperty method [v2]
Joe Wang
joehw at openjdk.java.net
Fri Nov 5 20:25:11 UTC 2021
On Fri, 5 Nov 2021 17:08:02 GMT, Joe Wang <joehw at openjdk.org> wrote:
>> 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?
Roger also suggested changing to IAE. I've just pushed a change to IAE. Thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6215
More information about the core-libs-dev
mailing list