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 620090d  Fix bad merge.
620090d is described below

commit 620090dcc8a36745c9a957e3e054b781f773ca39
Author: Gary Gregory <[email protected]>
AuthorDate: Wed Aug 26 12:58:53 2026 -0400

    Fix bad merge.
---
 .../org/apache/commons/xml/FallbackIgnoreURIResolver.java     | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/xml/FallbackIgnoreURIResolver.java 
b/src/main/java/org/apache/commons/xml/FallbackIgnoreURIResolver.java
index ee26340..debd391 100644
--- a/src/main/java/org/apache/commons/xml/FallbackIgnoreURIResolver.java
+++ b/src/main/java/org/apache/commons/xml/FallbackIgnoreURIResolver.java
@@ -20,6 +20,7 @@
 import java.util.function.Supplier;
 
 import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.FactoryConfigurationError;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.transform.Source;
 import javax.xml.transform.TransformerException;
@@ -52,10 +53,11 @@ final class FallbackIgnoreURIResolver implements 
URIResolver {
      * Backing for the default ignore outcome. Consumers parse the resolved 
{@link Source}, and an empty character stream is not a well-formed XML document
      * (XSLTC rejects it for {@code document()} and for an ignored {@code 
xsl:include}/{@code xsl:import}), so the default supplier answers with a 
well-formed
      * empty document that evaluates to no content. It is never mutated, so 
one instance serves every resolution.
+     *
+     * @see #newEmptyDocument()
      */
-    private static final Document EMPTY_DOCUMENT;
+    private static final Document EMPTY_DOCUMENT = newEmptyDocument();
 
-    static {
     /**
      * Creates a new empty document.
      *
@@ -66,10 +68,9 @@ final class FallbackIgnoreURIResolver implements URIResolver 
{
      */
     private static Document newEmptyDocument() {
         try {
-            EMPTY_DOCUMENT = 
DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+            return 
DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
         } catch (final ParserConfigurationException e) {
-            // Checked exceptions cannot escape static initialization; a 
FactoryConfigurationError from newInstance() already can and propagates as-is.
-            throw new ExceptionInInitializerError(e);
+            throw new HardeningException("A DocumentBuilder cannot be created 
which satisfies the configuration requested.", e);
         }
     }
 

Reply via email to