This is an automated email from the ASF dual-hosted git repository.

garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-configuration.git


The following commit(s) were added to refs/heads/master by this push:
     new 166680b10 Inline single use local variable.
166680b10 is described below

commit 166680b1068ec94122b3282ef952f39619b7b474
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Sep 26 21:39:06 2026 +0000

    Inline single use local variable.
---
 .../commons/configuration2/TestXMLPropertiesConfiguration.java     | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/configuration2/TestXMLPropertiesConfiguration.java
 
b/src/test/java/org/apache/commons/configuration2/TestXMLPropertiesConfiguration.java
index 62bbff031..f1dcac9f8 100644
--- 
a/src/test/java/org/apache/commons/configuration2/TestXMLPropertiesConfiguration.java
+++ 
b/src/test/java/org/apache/commons/configuration2/TestXMLPropertiesConfiguration.java
@@ -26,7 +26,6 @@ import java.io.File;
 import java.net.URL;
 
 import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.Result;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerFactory;
@@ -74,8 +73,7 @@ public class TestXMLPropertiesConfiguration {
         assertThrows(NullPointerException.class, () -> new 
XMLPropertiesConfiguration(null));
         // Normal case
         final URL location = 
ConfigurationAssert.getTestURL(TEST_PROPERTIES_FILE);
-        final DocumentBuilderFactory dbFactory = 
SecureDocumentBuilderFactory.newInstance();
-        final DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        final DocumentBuilder dBuilder = 
SecureDocumentBuilderFactory.newInstance().newDocumentBuilder();
         dBuilder.setEntityResolver((publicId, systemId) -> new 
InputSource(getClass().getClassLoader().getResourceAsStream("properties.dtd")));
         final File file = new File(location.toURI());
         final Document doc = dBuilder.parse(file);
@@ -103,8 +101,7 @@ public class TestXMLPropertiesConfiguration {
         final File saveFile = newFile("test2.properties.xml", tempFolder);
 
         // save as DOM into saveFile
-        final DocumentBuilderFactory dbFactory = 
SecureDocumentBuilderFactory.newInstance();
-        final DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        final DocumentBuilder dBuilder = 
SecureDocumentBuilderFactory.newInstance().newDocumentBuilder();
         final Document document = dBuilder.newDocument();
         conf.save(document, document);
         final TransformerFactory tFactory = 
SecureTransformerFactory.newInstance();

Reply via email to