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-configuration.git


The following commit(s) were added to refs/heads/master by this push:
     new 65a7b5c9 Use constant instead of magic string
65a7b5c9 is described below

commit 65a7b5c90b4b65a64ce1f6262ac95079f4330b8c
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Dec 10 12:53:58 2023 -0500

    Use constant instead of magic string
---
 .../org/apache/commons/configuration2/XMLPropertiesConfiguration.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/commons/configuration2/XMLPropertiesConfiguration.java
 
b/src/main/java/org/apache/commons/configuration2/XMLPropertiesConfiguration.java
index a4baf705..645ee6c7 100644
--- 
a/src/main/java/org/apache/commons/configuration2/XMLPropertiesConfiguration.java
+++ 
b/src/main/java/org/apache/commons/configuration2/XMLPropertiesConfiguration.java
@@ -20,6 +20,7 @@ package org.apache.commons.configuration2;
 import java.io.PrintWriter;
 import java.io.Reader;
 import java.io.Writer;
+import java.nio.charset.StandardCharsets;
 import java.util.Iterator;
 import java.util.List;
 
@@ -64,10 +65,11 @@ import org.xml.sax.helpers.DefaultHandler;
  * @since 1.1
  */
 public class XMLPropertiesConfiguration extends BaseConfiguration implements 
FileBasedConfiguration, FileLocatorAware {
+
     /**
      * The default encoding (UTF-8 as specified by 
https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html)
      */
-    public static final String DEFAULT_ENCODING = "UTF-8";
+    public static final String DEFAULT_ENCODING = 
StandardCharsets.UTF_8.name();
 
     /**
      * Default string used when the XML is malformed

Reply via email to