logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1501394 - in /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core: async/AsyncLoggerConfig.java config/LoggerConfig.java
Date Tue, 09 Jul 2013 17:23:32 GMT
Author: ggregory
Date: Tue Jul  9 17:23:32 2013
New Revision: 1501394

URL: http://svn.apache.org/r1501394
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/async/AsyncLoggerConfig.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java?rev=1501394&r1=1501393&r2=1501394&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
Tue Jul  9 17:23:32 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.status.StatusLogger;
 
 /**
@@ -175,8 +176,7 @@ public class AsyncLoggerConfig extends L
             level = Level.ERROR;
         }
         final String name = loggerName.equals("root") ? "" : loggerName;
-        final boolean additive = additivity == null ? true : Boolean
-                .parseBoolean(additivity);
+        final boolean additive = Booleans.parseBoolean(additivity, true);
 
         return new AsyncLoggerConfig(name, appenderRefs, filter, level,
                 additive, properties, config, includeLocation(includeLocation));
@@ -212,8 +212,7 @@ public class AsyncLoggerConfig extends L
                         levelName);
                 level = Level.ERROR;
             }
-            final boolean additive = additivity == null ? true : Boolean
-                    .parseBoolean(additivity);
+            final boolean additive = Booleans.parseBoolean(additivity, true);
 
             return new AsyncLoggerConfig(LogManager.ROOT_LOGGER_NAME,
                     appenderRefs, filter, level, additive, properties, config,

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java?rev=1501394&r1=1501393&r2=1501394&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
Tue Jul  9 17:23:32 2013
@@ -43,6 +43,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.AbstractFilterable;
+import org.apache.logging.log4j.core.helpers.Booleans;
 import org.apache.logging.log4j.core.helpers.Constants;
 import org.apache.logging.log4j.core.helpers.Loader;
 import org.apache.logging.log4j.core.helpers.Strings;
@@ -471,8 +472,7 @@ public class LoggerConfig extends Abstra
             level = Level.ERROR;
         }
         final String name = loggerName.equals("root") ? "" : loggerName;
-        final boolean additive = additivity == null ? true : Boolean
-                .parseBoolean(additivity);
+        final boolean additive = Booleans.parseBoolean(additivity, true);
 
         return new LoggerConfig(name, appenderRefs, filter, level, additive,
                 properties, config, includeLocation(includeLocation));
@@ -514,8 +514,7 @@ public class LoggerConfig extends Abstra
                         levelName);
                 level = Level.ERROR;
             }
-            final boolean additive = additivity == null ? true : Boolean
-                    .parseBoolean(additivity);
+            final boolean additive = Booleans.parseBoolean(additivity, true);
 
             return new LoggerConfig(LogManager.ROOT_LOGGER_NAME, appenderRefs,
                     filter, level, additive, properties, config,



Mime
View raw message