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

commit 4d65cfeedb984aff934170881d2895f84df83ccc
Author: Gary Gregory <[email protected]>
AuthorDate: Wed Aug 26 09:58:05 2026 -0400

    Extract constant.
---
 .../java/org/apache/commons/xml/FallbackIgnoreEntityResolver2.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/commons/xml/FallbackIgnoreEntityResolver2.java 
b/src/main/java/org/apache/commons/xml/FallbackIgnoreEntityResolver2.java
index 676f3a5..0b7b774 100644
--- a/src/main/java/org/apache/commons/xml/FallbackIgnoreEntityResolver2.java
+++ b/src/main/java/org/apache/commons/xml/FallbackIgnoreEntityResolver2.java
@@ -55,6 +55,8 @@
  */
 class FallbackIgnoreEntityResolver2 extends DefaultHandler2 {
 
+    private static final byte[] EMPTY = new byte[0];
+
     /**
      * Resolves {@code systemId} against {@code baseURI}.
      *
@@ -114,7 +116,7 @@ protected InputSource onUnresolved(final String name, final 
String publicId, fin
         if (HardeningException.throwOnUnresolved()) {
             throw new SAXException(HardeningException.forbidden(name, null, 
publicId, systemId, baseURI));
         }
-        final InputSource empty = new InputSource(new ByteArrayInputStream(new 
byte[0]));
+        final InputSource empty = new InputSource(new 
ByteArrayInputStream(EMPTY));
         empty.setPublicId(publicId);
         empty.setSystemId(absolutize(baseURI, systemId));
         return empty;

Reply via email to