logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1566207 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/Charsets.java
Date Sun, 09 Feb 2014 03:45:54 GMT
Author: ggregory
Date: Sun Feb  9 03:45:53 2014
New Revision: 1566207

URL: http://svn.apache.org/r1566207
Log:
PMD: These nested if statements could be combined.

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

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/Charsets.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/Charsets.java?rev=1566207&r1=1566206&r2=1566207&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/Charsets.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/Charsets.java
Sun Feb  9 03:45:53 2014
@@ -54,10 +54,8 @@ public final class Charsets {
      */
     public static Charset getSupportedCharset(final String charsetName, final Charset defaultCharset)
{
         Charset charset = null;
-        if (charsetName != null) {
-            if (Charset.isSupported(charsetName)) {
-                charset = Charset.forName(charsetName);
-            }
+        if (charsetName != null && Charset.isSupported(charsetName)) {
+            charset = Charset.forName(charsetName);
         }
         if (charset == null) {
             charset = defaultCharset;



Mime
View raw message