logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1501477 - in /logging/log4j/log4j2/trunk: core/src/main/java/org/apache/logging/log4j/core/appender/ core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/ core/src/main/java/org/apache/logging/log4j/core/appender/routing/ core...
Date Tue, 09 Jul 2013 19:23:43 GMT
Author: ggregory
Date: Tue Jul  9 19:23:43 2013
New Revision: 1501477

URL: http://svn.apache.org/r1501477
Log:
More refactoring using Booleans API and plain Boolean API.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastFileAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastRollingFileAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSQueueAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SMTPAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
    logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
Tue Jul  9 19:23:43 2013
@@ -30,6 +30,7 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginAttr;
 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.Loader;
 import org.apache.logging.log4j.core.layout.PatternLayout;
 import org.apache.logging.log4j.util.PropertiesUtil;
@@ -96,8 +97,8 @@ public final class ConsoleAppender<T ext
             Layout<S> l = (Layout<S>) PatternLayout.createLayout(null, null,
null, null, null);
             layout = l;
         }
-        final boolean isFollow = follow == null ? false : Boolean.valueOf(follow);
-        final boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
+        final boolean isFollow = Boolean.parseBoolean(follow);
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
         final Target target = t == null ? Target.SYSTEM_OUT : Target.valueOf(t);
         return new ConsoleAppender<S>(name, layout, filter, getManager(isFollow, target,
layout), handleExceptions);
     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastFileAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastFileAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastFileAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastFileAppender.java
Tue Jul  9 19:23:43 2013
@@ -29,6 +29,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.layout.PatternLayout;
 import org.apache.logging.log4j.core.net.Advertiser;
 
@@ -132,13 +133,10 @@ public final class FastFileAppender<T ex
             @PluginAttr("advertiseURI") final String advertiseURI,
             @PluginConfiguration final Configuration config) {
 
-        final boolean isAppend = append == null ? true : Boolean.valueOf(append);
-        final boolean isFlush = immediateFlush == null ? true : Boolean
-                .valueOf(immediateFlush);
-        final boolean handleExceptions = suppress == null ? true : Boolean
-                .valueOf(suppress);
-        final boolean isAdvertise = advertise == null ? false : Boolean
-                .valueOf(advertise);
+        final boolean isAppend = Booleans.parseBoolean(append, true);
+        final boolean isFlush = Booleans.parseBoolean(immediateFlush, true);
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
+        final boolean isAdvertise = Boolean.parseBoolean(advertise);
 
         if (name == null) {
             LOGGER.error("No name provided for FileAppender");

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastRollingFileAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastRollingFileAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastRollingFileAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FastRollingFileAppender.java
Tue Jul  9 19:23:43 2013
@@ -34,6 +34,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.layout.PatternLayout;
 import org.apache.logging.log4j.core.net.Advertiser;
 
@@ -157,14 +158,10 @@ public final class FastRollingFileAppend
             @PluginAttr("advertiseURI") final String advertiseURI,
             @PluginConfiguration final Configuration config) {
 
-        final boolean isAppend = append == null ? true : Boolean
-                .valueOf(append);
-        final boolean handleExceptions = suppress == null ? true : Boolean
-                .valueOf(suppress);
-        final boolean isFlush = immediateFlush == null ? true : Boolean
-                .valueOf(immediateFlush);
-        final boolean isAdvertise = advertise == null ? false : Boolean
-                .valueOf(advertise);
+        final boolean isAppend = Booleans.parseBoolean(append, true);
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
+        final boolean isFlush = Booleans.parseBoolean(immediateFlush, true);
+        final boolean isAdvertise = Boolean.parseBoolean(advertise);
 
         if (name == null) {
             LOGGER.error("No name provided for FileAppender");

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
Tue Jul  9 19:23:43 2013
@@ -28,6 +28,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.layout.PatternLayout;
 import org.apache.logging.log4j.core.net.Advertiser;
 
@@ -109,18 +110,18 @@ public final class FileAppender<T extend
                                               @PluginAttr("advertiseURI") final String advertiseURI,
                                               @PluginConfiguration final Configuration config)
{
 
-        final boolean isAppend = append == null ? true : Boolean.parseBoolean(append);
-        final boolean isLocking = locking == null ? false : Boolean.parseBoolean(locking);
-        boolean isBuffered = bufferedIO == null ? true : Boolean.parseBoolean(bufferedIO);
-        final boolean isAdvertise = advertise == null ? false : Boolean.parseBoolean(advertise);
+        final boolean isAppend = Booleans.parseBoolean(append, true);
+        final boolean isLocking = Boolean.parseBoolean(locking);
+        boolean isBuffered = Booleans.parseBoolean(bufferedIO, true);
+        final boolean isAdvertise = Boolean.parseBoolean(advertise);
         if (isLocking && isBuffered) {
             if (bufferedIO != null) {
                 LOGGER.warn("Locking and buffering are mutually exclusive. No buffering will
occur for " + fileName);
             }
             isBuffered = false;
         }
-        final boolean isFlush = immediateFlush == null ? true : Boolean.parseBoolean(immediateFlush);
-        final boolean handleExceptions = suppress == null ? true : Boolean.parseBoolean(suppress);
+        final boolean isFlush = Booleans.parseBoolean(immediateFlush, true);
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
 
         if (name == null) {
             LOGGER.error("No name provided for FileAppender");

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSQueueAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSQueueAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSQueueAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSQueueAppender.java
Tue Jul  9 19:23:43 2013
@@ -25,6 +25,7 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginAttr;
 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.layout.SerializedLayout;
 import org.apache.logging.log4j.core.net.JMSQueueManager;
 
@@ -97,7 +98,7 @@ public final class JMSQueueAppender<T ex
             LOGGER.error("No name provided for JMSQueueAppender");
             return null;
         }
-        final boolean handleExceptions = suppress == null ? true : Boolean.parseBoolean(suppress);
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
         final JMSQueueManager manager = JMSQueueManager.getJMSQueueManager(factoryName, providerURL,
urlPkgPrefixes,
             securityPrincipalName, securityCredentials, factoryBindingName, queueBindingName,
userName, password);
         if (manager == null) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/JMSTopicAppender.java
Tue Jul  9 19:23:43 2013
@@ -25,6 +25,7 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginAttr;
 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.layout.SerializedLayout;
 import org.apache.logging.log4j.core.net.JMSTopicManager;
 
@@ -98,7 +99,7 @@ public final class JMSTopicAppender<T ex
             LOGGER.error("No name provided for JMSQueueAppender");
             return null;
         }
-        final boolean handleExceptions = suppress == null ? true : Boolean.parseBoolean(suppress);
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
         final JMSTopicManager manager = JMSTopicManager.getJMSTopicManager(factoryName, providerURL,
urlPkgPrefixes,
             securityPrincipalName, securityCredentials, factoryBindingName, topicBindingName,
userName, password);
         if (manager == null) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
Tue Jul  9 19:23:43 2013
@@ -33,6 +33,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.layout.PatternLayout;
 import org.apache.logging.log4j.core.net.Advertiser;
 
@@ -139,11 +140,11 @@ public final class RollingFileAppender<T
                                               @PluginAttr("advertiseURI") final String advertiseURI,
                                               @PluginConfiguration final Configuration config)
{
 
-        final boolean isAppend = append == null ? true : Boolean.parseBoolean(append);
-        final boolean handleExceptions = suppress == null ? true : Boolean.parseBoolean(suppress);
-        final boolean isBuffered = bufferedIO == null ? true : Boolean.parseBoolean(bufferedIO);
-        final boolean isFlush = immediateFlush == null ? true : Boolean.parseBoolean(immediateFlush);
-        final boolean isAdvertise = advertise == null ? false : Boolean.parseBoolean(advertise);
+        final boolean isAppend = Booleans.parseBoolean(append, true);
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
+        final boolean isBuffered = Booleans.parseBoolean(bufferedIO, true);
+        final boolean isFlush = Booleans.parseBoolean(immediateFlush, true);
+        final boolean isAdvertise = Boolean.parseBoolean(advertise);
         if (name == null) {
             LOGGER.error("No name provided for FileAppender");
             return null;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SMTPAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SMTPAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SMTPAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SMTPAppender.java
Tue Jul  9 19:23:43 2013
@@ -27,6 +27,7 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginElement;
 import org.apache.logging.log4j.core.config.plugins.PluginFactory;
 import org.apache.logging.log4j.core.filter.ThresholdFilter;
+import org.apache.logging.log4j.core.helpers.Booleans;
 import org.apache.logging.log4j.core.helpers.Integers;
 import org.apache.logging.log4j.core.layout.HTMLLayout;
 import org.apache.logging.log4j.core.net.SMTPManager;
@@ -129,9 +130,9 @@ public final class SMTPAppender<T extend
             return null;
         }
 
-        final boolean isHandleExceptions = suppressExceptions == null ? true : Boolean.parseBoolean(suppressExceptions);
+        final boolean isHandleExceptions = Booleans.parseBoolean(suppressExceptions, true);
         final int smtpPort = Integers.parseInt(smtpPortNum); 
-        final boolean isSmtpDebug = smtpDebug == null ? false : Boolean.parseBoolean(smtpDebug);
+        final boolean isSmtpDebug = Boolean.parseBoolean(smtpDebug);
         final int bufferSize = bufferSizeNum == null ? DEFAULT_BUFFER_SIZE : Integer.valueOf(bufferSizeNum);
 
         if (layout == null) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
Tue Jul  9 19:23:43 2013
@@ -28,6 +28,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.Integers;
 import org.apache.logging.log4j.core.layout.SerializedLayout;
 import org.apache.logging.log4j.core.net.AbstractSocketManager;
@@ -101,10 +102,10 @@ public class SocketAppender<T extends Se
                                                 @PluginAttr("advertise") final String advertise,
                                                 @PluginConfiguration final Configuration
config) {
 
-        boolean isFlush = immediateFlush == null ? true : Boolean.parseBoolean(immediateFlush);
-        final boolean isAdvertise = advertise == null ? false : Boolean.parseBoolean(advertise);
-        final boolean handleExceptions = suppress == null ? true : Boolean.parseBoolean(suppress);
-        final boolean fail = immediateFail == null ? true : Boolean.parseBoolean(immediateFail);
+        boolean isFlush = Booleans.parseBoolean(immediateFlush, true);
+        final boolean isAdvertise = Boolean.parseBoolean(advertise);
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
+        final boolean fail = Booleans.parseBoolean(immediateFail, true);
         final int reconnectDelay = Integers.parseInt(delay);
         final int port = Integers.parseInt(portNum);
         if (layout == null) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
Tue Jul  9 19:23:43 2013
@@ -26,6 +26,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.Integers;
 import org.apache.logging.log4j.core.layout.LoggerFields;
 import org.apache.logging.log4j.core.layout.RFC5424Layout;
@@ -122,12 +123,12 @@ public class SyslogAppender<T extends Se
                                                 @PluginElement("LoggerFields") final LoggerFields
loggerFields,
                                                 @PluginAttr("advertise") final String advertise)
{
 
-        final boolean isFlush = immediateFlush == null ? true : Boolean.parseBoolean(immediateFlush);
-        final boolean handleExceptions = suppress == null ? true : Boolean.parseBoolean(suppress);
+        final boolean isFlush = Booleans.parseBoolean(immediateFlush, true);
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
         final int reconnectDelay = Integers.parseInt(delay);
-        final boolean fail = immediateFail == null ? true : Boolean.parseBoolean(immediateFail);
+        final boolean fail = Booleans.parseBoolean(immediateFail, true);
         final int port = Integers.parseInt(portNum);
-        final boolean isAdvertise = advertise == null ? false : Boolean.parseBoolean(advertise);
+        final boolean isAdvertise = Boolean.parseBoolean(advertise);
         @SuppressWarnings("unchecked")
         final Layout<S> layout = (Layout<S>) (RFC5424.equalsIgnoreCase(format)
?
             RFC5424Layout.createLayout(facility, id, ein, includeMDC, mdcId, mdcPrefix, eventPrefix,
includeNL,

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
Tue Jul  9 19:23:43 2013
@@ -33,6 +33,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;
 
 /**
  * This Appender allows the logging event to be manipulated before it is processed by other
Appenders.
@@ -111,8 +112,7 @@ public final class RewriteAppender<T ext
                                           @PluginElement("rewritePolicy") final RewritePolicy
rewritePolicy,
                                           @PluginElement("filter") final Filter filter) {
 
-        final boolean handleExceptions = suppress == null ? true : Boolean.parseBoolean(suppress);
-
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
         if (name == null) {
             LOGGER.error("No name provided for RewriteAppender");
             return null;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
Tue Jul  9 19:23:43 2013
@@ -34,6 +34,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;
 
 /**
  * This Appender "routes" between various Appenders, some of which can be references to
@@ -184,8 +185,7 @@ public final class RoutingAppender<T ext
                                           @PluginElement("rewritePolicy") final RewritePolicy
rewritePolicy,
                                           @PluginElement("filters") final Filter filter)
{
 
-        final boolean handleExceptions = suppress == null ? true : Boolean.parseBoolean(suppress);
-
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
         if (name == null) {
             LOGGER.error("No name provided for RoutingAppender");
             return null;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
Tue Jul  9 19:23:43 2013
@@ -325,7 +325,7 @@ public final class HTMLLayout extends Ab
         final FontSize fs = FontSize.getFontSize(fontSize);
         fontSize = fs.getFontSize();
         final String headerSize = fs.larger().getFontSize();
-        final boolean info = locationInfo == null ? false : Boolean.parseBoolean(locationInfo);
+        final boolean info = Boolean.parseBoolean(locationInfo);
         if (title == null) {
             title = DEFAULT_TITLE;
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
Tue Jul  9 19:23:43 2013
@@ -36,6 +36,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.Charsets;
 import org.apache.logging.log4j.core.helpers.Integers;
 import org.apache.logging.log4j.core.helpers.NetUtils;
@@ -554,8 +555,8 @@ public final class RFC5424Layout extends
         }
         final Facility f = Facility.toFacility(facility, Facility.LOCAL0);
         final int enterpriseNumber = Integers.parseInt(ein, DEFAULT_ENTERPRISE_NUMBER);
-        final boolean isMdc = includeMDC == null ? true : Boolean.parseBoolean(includeMDC);
-        final boolean includeNewLine = includeNL == null ? false : Boolean.parseBoolean(includeNL);
+        final boolean isMdc = Booleans.parseBoolean(includeMDC, true);
+        final boolean includeNewLine = Boolean.parseBoolean(includeNL);
         final Map<String, String> loggerFieldValues = loggerFields == null ? null :
loggerFields.getMap();
         if (mdcId == null) {
             mdcId = DEFAULT_MDCID;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java
Tue Jul  9 19:23:43 2013
@@ -157,7 +157,7 @@ public class SyslogLayout extends Abstra
                                             @PluginAttr("newLineEscape") final String escapeNL,
                                             @PluginAttr("charset") final String charsetName)
{
         final Charset charset = Charsets.getSupportedCharset(charsetName);
-        final boolean includeNewLine = includeNL == null ? false : Boolean.parseBoolean(includeNL);
+        final boolean includeNewLine = Boolean.parseBoolean(includeNL);
         final Facility f = Facility.toFacility(facility, Facility.LOCAL0);
         return new SyslogLayout(f, includeNewLine, escapeNL, charset);
     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
Tue Jul  9 19:23:43 2013
@@ -282,9 +282,9 @@ public class XMLLayout extends AbstractS
                                          @PluginAttr("complete") final String complete,
                                          @PluginAttr("charset") final String charsetName)
{
         final Charset charset = Charsets.getSupportedCharset(charsetName, Charsets.UTF_8);
-        final boolean info = locationInfo == null ? false : Boolean.parseBoolean(locationInfo);
-        final boolean props = properties == null ? false : Boolean.parseBoolean(properties);
-        final boolean comp = complete == null ? false : Boolean.parseBoolean(complete);
+        final boolean info = Boolean.parseBoolean(locationInfo);
+        final boolean props = Boolean.parseBoolean(properties);
+        final boolean comp = Boolean.parseBoolean(complete);
         return new XMLLayout(info, props, comp, charset);
     }
 }

Modified: logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java?rev=1501477&r1=1501476&r2=1501477&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
(original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
Tue Jul  9 19:23:43 2013
@@ -28,6 +28,7 @@ import org.apache.logging.log4j.core.con
 import org.apache.logging.log4j.core.config.plugins.PluginAttr;
 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.layout.RFC5424Layout;
 
 /**
@@ -179,8 +180,8 @@ public final class FlumeAppender<T exten
 
         final boolean embed = embedded != null ? Boolean.parseBoolean(embedded) :
             (agents == null || agents.length == 0) && properties != null &&
properties.length > 0;
-        final boolean handleExceptions = suppress == null ? true : Boolean.parseBoolean(suppress);
-        final boolean compress = compressBody == null ? true : Boolean.parseBoolean(compressBody);
+        final boolean handleExceptions = Booleans.parseBoolean(suppress, true);
+        final boolean compress = Booleans.parseBoolean(compressBody, true);
         ManagerType managerType;
         if (type != null) {
             if (embed && embedded != null) {



Mime
View raw message