logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1566194 - /logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
Date Sun, 09 Feb 2014 03:21:10 GMT
Author: ggregory
Date: Sun Feb  9 03:21:09 2014
New Revision: 1566194

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

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

Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java?rev=1566194&r1=1566193&r2=1566194&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
Sun Feb  9 03:21:09 2014
@@ -142,11 +142,9 @@ public class ParameterizedMessage implem
         }
         final int argsCount = countArgumentPlaceholders(messagePattern);
         int resultArgCount = arguments.length;
-        if (argsCount < arguments.length) {
-            if (throwable == null && arguments[arguments.length - 1] instanceof Throwable)
{
-                throwable = (Throwable) arguments[arguments.length - 1];
-                resultArgCount--;
-            }
+        if (argsCount < arguments.length && throwable == null && arguments[arguments.length
- 1] instanceof Throwable) {
+            throwable = (Throwable) arguments[arguments.length - 1];
+            resultArgCount--;
         }
         argArray = new Object[resultArgCount];
         for (int i = 0; i < resultArgCount; ++i) {



Mime
View raw message