logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1479689 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Charsets.java
Date Mon, 06 May 2013 19:48:33 GMT
Author: ggregory
Date: Mon May  6 19:47:59 2013
New Revision: 1479689

URL: http://svn.apache.org/r1479689
Log:
Use a private constant instead of a magic string.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Charsets.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Charsets.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Charsets.java?rev=1479689&r1=1479688&r2=1479689&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Charsets.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Charsets.java
Mon May  6 19:47:59 2013
@@ -25,6 +25,8 @@ import org.apache.logging.log4j.status.S
  */
 public final class Charsets {
 
+    private static final String UTF_8 = "UTF-8";
+
     private Charsets() {
     }
 
@@ -44,7 +46,7 @@ public final class Charsets {
             }
         }
         if (charset == null) {
-            charset = Charset.isSupported("UTF-8") ? Charset.forName("UTF-8") : Charset.defaultCharset();
+            charset = Charset.isSupported(UTF_8) ? Charset.forName(UTF_8) : Charset.defaultCharset();
             if (charsetName != null) {
                 StatusLogger.getLogger().error("Charset " + charsetName + " is not supported
for layout, using " +
                     charset.displayName());



Mime
View raw message