Inline single constant reference to other constant
MODIFY
src/main/java/org/apache/commons/io/output/XmlStreamWriter.java
src/main/java/org/apache/commons/io/output/XmlStreamWriter.java
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;
* @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 @@ private void detectEncoding(final char[] cbuf, final int off, final int len)
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);

Inline single constant reference to other constant