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 d11bbf3 Inline single use local variable.
d11bbf3 is described below
commit d11bbf358791e1748a9671fbe04e7fa98f1615cc
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Aug 28 17:21:35 2026 -0400
Inline single use local variable.
---
src/main/java/org/apache/commons/xml/SecureXPath.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/xml/SecureXPath.java
b/src/main/java/org/apache/commons/xml/SecureXPath.java
index a8ec2a3..3310be7 100644
--- a/src/main/java/org/apache/commons/xml/SecureXPath.java
+++ b/src/main/java/org/apache/commons/xml/SecureXPath.java
@@ -23,7 +23,6 @@
import javax.xml.XMLConstants;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
@@ -67,8 +66,7 @@ final class SecureXPath implements XPath {
static Document parse(final InputSource source, final boolean
overrideDefaultParser) throws XPathExpressionException {
Objects.requireNonNull(source, "source");
try {
- final DocumentBuilderFactory factory =
SecureDocumentBuilderFactory.newNSInstance(overrideDefaultParser);
- return factory.newDocumentBuilder().parse(source);
+ return
SecureDocumentBuilderFactory.newNSInstance(overrideDefaultParser).newDocumentBuilder().parse(source);
} catch (final ParserConfigurationException | SAXException |
IOException e) {
throw new XPathExpressionException(e);
}