You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/06/21 11:50:28 UTC

[commons-io] branch master updated: Inline single constant reference to other constant

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 950fc0a4 Inline single constant reference to other constant
950fc0a4 is described below

commit 950fc0a47428d64dfb01c62099af30ea30de6cb9
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jun 21 07:50:22 2022 -0400

    Inline single constant reference to other constant
---
 src/main/java/org/apache/commons/io/output/XmlStreamWriter.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/output/XmlStreamWriter.java b/src/main/java/org/apache/commons/io/output/XmlStreamWriter.java
index 0dcdd871..4b3ba09e 100644
--- a/src/main/java/org/apache/commons/io/output/XmlStreamWriter.java
+++ b/src/main/java/org/apache/commons/io/output/XmlStreamWriter.java
@@ -26,7 +26,6 @@ import java.io.StringWriter;
 import java.io.Writer;
 import java.util.Locale;
 import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.input.XmlStreamReader;
@@ -39,9 +38,8 @@ import org.apache.commons.io.input.XmlStreamReader;
  * @since 2.0
  */
 public class XmlStreamWriter extends Writer {
-    private static final int BUFFER_SIZE = IOUtils.DEFAULT_BUFFER_SIZE;
 
-    static final Pattern ENCODING_PATTERN = XmlStreamReader.ENCODING_PATTERN;
+    private static final int BUFFER_SIZE = IOUtils.DEFAULT_BUFFER_SIZE;
 
     private final OutputStream out;
 
@@ -140,7 +138,7 @@ public class XmlStreamWriter extends Writer {
                 final int xmlPrologEnd = xmlProlog.indexOf("?>");
                 if (xmlPrologEnd > 0) {
                     // ok, full XML prolog written: let's extract encoding
-                    final Matcher m = ENCODING_PATTERN.matcher(xmlProlog.substring(0,
+                    final Matcher m = XmlStreamReader.ENCODING_PATTERN.matcher(xmlProlog.substring(0,
                             xmlPrologEnd));
                     if (m.find()) {
                         encoding = m.group(1).toUpperCase(Locale.ROOT);