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 2023/12/15 21:04:41 UTC

(commons-configuration) branch master updated: Use StandardCharsets instead of magic string

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 845914f2 Use StandardCharsets instead of magic string
     new d0b70165 Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-configuration
845914f2 is described below

commit 845914f281e194e66f9211085d2229cc0d8f30be
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Dec 15 16:04:12 2023 -0500

    Use StandardCharsets instead of magic string
---
 .../java/org/apache/commons/configuration2/io/TestFileLocator.java     | 3 ++-
 .../org/apache/commons/configuration2/io/TestFileLocatorUtils.java     | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/test/java/org/apache/commons/configuration2/io/TestFileLocator.java b/src/test/java/org/apache/commons/configuration2/io/TestFileLocator.java
index ed9c306f..e9b41bab 100644
--- a/src/test/java/org/apache/commons/configuration2/io/TestFileLocator.java
+++ b/src/test/java/org/apache/commons/configuration2/io/TestFileLocator.java
@@ -25,6 +25,7 @@ import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.mockito.Mockito.mock;
 
 import java.net.URL;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.commons.configuration2.ConfigurationAssert;
 import org.junit.jupiter.api.BeforeAll;
@@ -41,7 +42,7 @@ public class TestFileLocator {
     private static final String BASE_PATH = "/etc/test/path/";
 
     /** Constant for a test encoding. */
-    private static final String ENCODING = "utf-8";
+    private static final String ENCODING = StandardCharsets.UTF_8.name();
 
     /** A test URL. */
     private static URL sourceURL;
diff --git a/src/test/java/org/apache/commons/configuration2/io/TestFileLocatorUtils.java b/src/test/java/org/apache/commons/configuration2/io/TestFileLocatorUtils.java
index 6d512c01..a7bd3202 100644
--- a/src/test/java/org/apache/commons/configuration2/io/TestFileLocatorUtils.java
+++ b/src/test/java/org/apache/commons/configuration2/io/TestFileLocatorUtils.java
@@ -35,6 +35,7 @@ import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -56,7 +57,7 @@ public class TestFileLocatorUtils {
     private static final String BASE_PATH = "/etc/test/path/";
 
     /** Constant for a test encoding. */
-    private static final String ENCODING = "utf-8";
+    private static final String ENCODING = StandardCharsets.UTF_8.name();
 
     /** A test URL. */
     private static URL sourceURL;