logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1501378 - in /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core: appender/rolling/TimeBasedTriggeringPolicy.java async/AsyncLoggerConfig.java filter/RegexFilter.java
Date Tue, 09 Jul 2013 17:02:19 GMT
Author: ggregory
Date: Tue Jul  9 17:02:18 2013
New Revision: 1501378

URL: http://svn.apache.org/r1501378
Log:
The pattern 'str != null && Boolean.parseBoolean(str)' is the same as just 'Boolean.parseBoolean(str)'
because Boolean.parseBoolean(String) checks for null.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
    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/filter/RegexFilter.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java?rev=1501378&r1=1501377&r2=1501378&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
Tue Jul  9 17:02:18 2013
@@ -82,7 +82,7 @@ public final class TimeBasedTriggeringPo
     public static TimeBasedTriggeringPolicy createPolicy(@PluginAttr("interval") final String
interval,
                                                          @PluginAttr("modulate") final String
modulate) {
         final int increment = Integers.parseInt(interval, 1);
-        final boolean mod = modulate == null ? false : Boolean.parseBoolean(modulate);
+        final boolean mod = Boolean.parseBoolean(modulate);
         return new TimeBasedTriggeringPolicy(increment, mod);
     }
 }

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=1501378&r1=1501377&r2=1501378&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:02:18 2013
@@ -184,9 +184,6 @@ public class AsyncLoggerConfig extends L
 
     // Note: for asynchronous loggers, includeLocation default is FALSE
     protected static boolean includeLocation(final String includeLocationConfigValue) {
-        if (includeLocationConfigValue == null) {
-            return false;
-        }
         return Boolean.parseBoolean(includeLocationConfigValue);
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java?rev=1501378&r1=1501377&r2=1501378&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java
Tue Jul  9 17:02:18 2013
@@ -113,7 +113,7 @@ public final class RegexFilter extends A
             LOGGER.error("A regular expression must be provided for RegexFilter");
             return null;
         }
-        final boolean raw = useRawMsg == null ? false : Boolean.parseBoolean(useRawMsg);
+        final boolean raw = Boolean.parseBoolean(useRawMsg);
         Pattern pattern;
         try {
             pattern = Pattern.compile(regex);



Mime
View raw message