logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1501398 - in /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core: appender/db/jpa/JPAAppender.java appender/db/nosql/NoSQLAppender.java layout/PatternLayout.java
Date Tue, 09 Jul 2013 17:35:44 GMT
Author: ggregory
Date: Tue Jul  9 17:35:43 2013
New Revision: 1501398

URL: http://svn.apache.org/r1501398
Log:
The expression 'str == null || !Boolean.parseBoolean(str)' is the same as '!Boolean.parseBoolean(str)'
because !Boolean.parseBoolean(String) checks for nulls.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppender.java?rev=1501398&r1=1501397&r2=1501398&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JPAAppender.java
Tue Jul  9 17:35:43 2013
@@ -83,7 +83,7 @@ public final class JPAAppender extends A
             bufferSizeInt = 0;
         }
 
-        final boolean handleExceptions = suppressExceptions == null || !Boolean.parseBoolean(suppressExceptions);
+        final boolean handleExceptions = !Boolean.parseBoolean(suppressExceptions);
 
         try {
             @SuppressWarnings("unchecked")

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLAppender.java?rev=1501398&r1=1501397&r2=1501398&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/nosql/NoSQLAppender.java
Tue Jul  9 17:35:43 2013
@@ -82,7 +82,7 @@ public final class NoSQLAppender extends
             bufferSizeInt = 0;
         }
 
-        final boolean handleExceptions = suppressExceptions == null || !Boolean.parseBoolean(suppressExceptions);
+        final boolean handleExceptions = !Boolean.parseBoolean(suppressExceptions);
 
         final String managerName = "noSqlManager{ description=" + name + ", bufferSize="
+ bufferSizeInt
                 + ", provider=" + provider + " }";

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java?rev=1501398&r1=1501397&r2=1501398&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
Tue Jul  9 17:35:43 2013
@@ -213,7 +213,7 @@ public final class PatternLayout extends
                                              @PluginAttr("charset") final String charsetName,
                                              @PluginAttr("suppressExceptions") final String
suppressExceptions) {
         final Charset charset = Charsets.getSupportedCharset(charsetName);
-        final boolean handleExceptions = suppressExceptions == null || !Boolean.parseBoolean(suppressExceptions);
+        final boolean handleExceptions = !Boolean.parseBoolean(suppressExceptions);
         return new PatternLayout(config, replace, pattern == null ? DEFAULT_CONVERSION_PATTERN
: pattern, charset,
                 handleExceptions);
     }



Mime
View raw message