logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1501419 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
Date Tue, 09 Jul 2013 18:14:42 GMT
Author: ggregory
Date: Tue Jul  9 18:14:42 2013
New Revision: 1501419

URL: http://svn.apache.org/r1501419
Log:
Refactor duplicate code in the API Boolean.parseBoolean(String, boolean), which also checks
for empty strings in addition to nulls.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java?rev=1501419&r1=1501418&r2=1501419&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
Tue Jul  9 18:14:42 2013
@@ -32,6 +32,7 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginConfiguration;
 import org.apache.logging.log4j.core.config.plugins.PluginElement;
 import org.apache.logging.log4j.core.config.plugins.PluginFactory;
+import org.apache.logging.log4j.core.helpers.Booleans;
 import org.apache.logging.log4j.core.helpers.Constants;
 
 /**
@@ -214,7 +215,7 @@ public final class FailoverAppender<T ex
             retryIntervalMillis = DEFAULT_INTERVAL_SECONDS * Constants.MILLIS_IN_SECONDS;
         }
 
-        final boolean handleExceptions = suppress == null ? true : Boolean.parseBoolean(suppress);
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
 
         return new FailoverAppender<S>(name, filter, primary, failovers, retryIntervalMillis,
config, handleExceptions);
     }



Mime
View raw message