This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/commons-xml.git
The following commit(s) were added to refs/heads/main by this push:
new 1a002eb Restrict XPathHardener.setOptionalFeature() to catch
XPathFactoryConfigurationException instead of Exception.
1a002eb is described below
commit 1a002eb715d91a86a41819ee782943ee9cbd4d80
Author: Gary Gregory <[email protected]>
AuthorDate: Wed Aug 26 13:27:50 2026 -0400
Restrict XPathHardener.setOptionalFeature() to catch
XPathFactoryConfigurationException instead of Exception.
---
src/main/java/org/apache/commons/xml/XPathHardener.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/xml/XPathHardener.java
b/src/main/java/org/apache/commons/xml/XPathHardener.java
index e582dae..fef394e 100644
--- a/src/main/java/org/apache/commons/xml/XPathHardener.java
+++ b/src/main/java/org/apache/commons/xml/XPathHardener.java
@@ -89,7 +89,7 @@ private static void setFeature(final XPathFactory factory,
final String feature,
private static void setOptionalFeature(final XPathFactory factory, final
String feature, final boolean value) {
try {
factory.setFeature(feature, value);
- } catch (final Exception e) {
+ } catch (final XPathFactoryConfigurationException e) {
// Ignored: the implementation does not recognize this feature.
}
}