logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1432042 - /logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
Date Fri, 11 Jan 2013 13:31:31 GMT
Author: ggregory
Date: Fri Jan 11 13:31:30 2013
New Revision: 1432042

URL: http://svn.apache.org/viewvc?rev=1432042&view=rev
Log:
Statement unnecessarily nested within else clause.

Modified:
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java?rev=1432042&r1=1432041&r2=1432042&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
Fri Jan 11 13:31:30 2013
@@ -217,16 +217,15 @@ public class MapMessage implements Multi
     public String getFormattedMessage(final String[] formats) {
         if (formats == null || formats.length == 0) {
             return asString();
-        } else {
-            for (final String format : formats) {
-                for (final MapFormat mapFormat : MapFormat.values()) {
-                    if (mapFormat.name().equalsIgnoreCase(format)) {
-                        return asString(mapFormat);
-                    }
+        }
+        for (final String format : formats) {
+            for (final MapFormat mapFormat : MapFormat.values()) {
+                if (mapFormat.name().equalsIgnoreCase(format)) {
+                    return asString(mapFormat);
                 }
             }
-            return asString();
         }
+        return asString();
 
     }
 



Mime
View raw message