logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1432558 - in /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core: appender/ appender/rolling/helper/ appender/routing/ filter/ impl/ layout/ pattern/
Date Sun, 13 Jan 2013 05:31:51 GMT
Author: ggregory
Date: Sun Jan 13 05:31:50 2013
New Revision: 1432558

URL: http://svn.apache.org/viewvc?rev=1432558&view=rev
Log:
Remove unnecessary parentheses.

Modified:
    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/rolling/helper/FileRenameAction.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/TimeFilter.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.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/pattern/DatePatternConverter.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FileDatePatternConverter.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LoggerPatternConverter.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MDCPatternConverter.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MapPatternConverter.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NamePatternConverter.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java

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=1432558&r1=1432557&r2=1432558&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
Sun Jan 13 05:31:50 2013
@@ -106,7 +106,7 @@ public class SyslogAppender extends Sock
         final boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
         final int reconnectDelay = delay == null ? 0 : Integer.parseInt(delay);
         final int port = portNum == null ? 0 : Integer.parseInt(portNum);
-        final Layout layout = (RFC5424.equalsIgnoreCase(format)) ?
+        final Layout layout = RFC5424.equalsIgnoreCase(format) ?
             RFC5424Layout.createLayout(facility, id, ein, includeMDC, mdcId, includeNL, escapeNL,
appName,
                 msgId, excludes, includes, required, charsetName, exceptionPattern, config)
:
             SyslogLayout.createLayout(facility, includeNL, escapeNL, charsetName);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/FileRenameAction.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/FileRenameAction.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/FileRenameAction.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/FileRenameAction.java
Sun Jan 13 05:31:50 2013
@@ -74,7 +74,7 @@ public class FileRenameAction extends Ab
      * @return true if successfully renamed.
      */
     public static boolean execute(final File source, final File destination, final boolean
renameEmptyFiles) {
-        if (renameEmptyFiles || (source.length() > 0)) {
+        if (renameEmptyFiles || source.length() > 0) {
             final File parent = destination.getParentFile();
             if (!parent.exists()) {
                 if (!parent.mkdirs()) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java
Sun Jan 13 05:31:50 2013
@@ -60,7 +60,7 @@ public final class Routes {
         final StringBuilder sb = new StringBuilder("{");
         boolean first = true;
         for (final Route route : routes) {
-            if ((!first)) {
+            if (!first) {
                 sb.append(",");
             }
             first = false;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/TimeFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/TimeFilter.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/TimeFilter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/TimeFilter.java
Sun Jan 13 05:31:50 2013
@@ -79,7 +79,7 @@ public final class TimeFilter extends Ab
             calendar.get(Calendar.MINUTE) * MINUTE_MS +
             calendar.get(Calendar.SECOND) * SECOND_MS +
             calendar.get(Calendar.MILLISECOND);
-        return (apparentOffset >= start && apparentOffset < end) ? onMatch
: onMismatch;
+        return apparentOffset >= start && apparentOffset < end ? onMatch :
onMismatch;
     }
 
     @Override
@@ -125,7 +125,7 @@ public final class TimeFilter extends Ab
                 LOGGER.warn("Error parsing start value " + end, ex);
             }
         }
-        final TimeZone timezone = (tz == null) ? TimeZone.getDefault() : TimeZone.getTimeZone(tz);
+        final TimeZone timezone = tz == null ? TimeZone.getDefault() : TimeZone.getTimeZone(tz);
         final Result onMatch = Result.toResult(match, Result.NEUTRAL);
         final Result onMismatch = Result.toResult(mismatch, Result.DENY);
         return new TimeFilter(s, e, timezone, onMatch, onMismatch);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
Sun Jan 13 05:31:50 2013
@@ -102,7 +102,7 @@ public class Log4jLogEvent implements Lo
         this.fqcnOfLogger = fqcn;
         this.level = level;
         this.message = message;
-        this.throwable = (t == null ? null : (t instanceof ThrowableProxy ? (ThrowableProxy)t
: new ThrowableProxy(t)));
+        this.throwable = t == null ? null : t instanceof ThrowableProxy ? (ThrowableProxy)t
: new ThrowableProxy(t);
         this.mdc = mdc;
         this.ndc = ndc;
         this.timestamp = message instanceof TimestampMessage ? ((TimestampMessage) message).getTimestamp()
: timestamp;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
Sun Jan 13 05:31:50 2013
@@ -69,7 +69,7 @@ public class ThrowableProxy extends Thro
         final Stack<Class<?>> stack = getCurrentStack();
         super.setStackTrace(throwable.getStackTrace());
         callerPackageData = resolvePackageData(stack, map, null, throwable.getStackTrace());
-        this.proxyCause = (throwable.getCause() == null) ? null :
+        this.proxyCause = throwable.getCause() == null ? null :
             new ThrowableProxy(throwable, stack, map, throwable.getCause());
         setSuppressed(throwable);
     }
@@ -87,7 +87,7 @@ public class ThrowableProxy extends Thro
         this.name = cause.getClass().getName();
         super.setStackTrace(cause.getStackTrace());
         callerPackageData = resolvePackageData(stack, map, parent.getStackTrace(), cause.getStackTrace());
-        this.proxyCause = (cause.getCause() == null) ? null :
+        this.proxyCause = cause.getCause() == null ? null :
             new ThrowableProxy(parent, stack, map, cause.getCause());
         setSuppressed(cause);
     }

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=1432558&r1=1432557&r2=1432558&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
Sun Jan 13 05:31:50 2013
@@ -104,7 +104,7 @@ public final class PatternLayout extends
         this.conversionPattern = pattern;
         this.config = config;
         final PatternParser parser = createPatternParser(config);
-        formatters = parser.parse((pattern == null) ? DEFAULT_CONVERSION_PATTERN : pattern,
true);
+        formatters = parser.parse(pattern == null ? DEFAULT_CONVERSION_PATTERN : pattern,
true);
     }
 
     /**

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=1432558&r1=1432557&r2=1432558&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
Sun Jan 13 05:31:50 2013
@@ -158,7 +158,7 @@ public final class RFC5424Layout extends
         }
         this.checker = c != null ? c : noopChecker;
         final String name = config == null ? null : config.getName();
-        configName = (name != null && name.length() > 0) ? name : null;
+        configName = name != null && name.length() > 0 ? name : null;
     }
 
     /**

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
Sun Jan 13 05:31:50 2013
@@ -100,7 +100,7 @@ public final class DatePatternConverter 
 
         String patternOption;
 
-        if ((options == null) || (options.length == 0)) {
+        if (options == null || options.length == 0) {
             // the branch could be optimized, but here we are making explicit
             // that null values for patternOption are allowed.
             patternOption = null;
@@ -136,7 +136,7 @@ public final class DatePatternConverter 
         }
 
         // if the option list contains a TZ option, then set it.
-        if ((options != null) && (options.length > 1)) {
+        if (options != null && options.length > 1) {
             final TimeZone tz = TimeZone.getTimeZone(options[1]);
             tempFormat.setTimeZone(tz);
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FileDatePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FileDatePatternConverter.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FileDatePatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/FileDatePatternConverter.java
Sun Jan 13 05:31:50 2013
@@ -39,7 +39,7 @@ public final class FileDatePatternConver
      * @return instance of pattern converter.
      */
     public static PatternConverter newInstance(final String[] options) {
-        if ((options == null) || (options.length == 0)) {
+        if (options == null || options.length == 0) {
             return DatePatternConverter.newInstance(
                 new String[]{
                     "yyyy-MM-dd"

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LoggerPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LoggerPatternConverter.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LoggerPatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LoggerPatternConverter.java
Sun Jan 13 05:31:50 2013
@@ -49,7 +49,7 @@ public final class LoggerPatternConverte
      */
     public static LoggerPatternConverter newInstance(
         final String[] options) {
-        if ((options == null) || (options.length == 0)) {
+        if (options == null || options.length == 0) {
             return INSTANCE;
         }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MDCPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MDCPatternConverter.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MDCPatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MDCPatternConverter.java
Sun Jan 13 05:31:50 2013
@@ -44,8 +44,8 @@ public final class MDCPatternConverter e
      * @param options options, may be null.
      */
     private MDCPatternConverter(final String[] options) {
-        super(((options != null) && (options.length > 0)) ? ("MDC{" + options[0]
+ "}") : "MDC", "mdc");
-        key = (options != null && options.length > 0) ? options[0] : null;
+        super(options != null && options.length > 0 ? "MDC{" + options[0] + "}"
: "MDC", "mdc");
+        key = options != null && options.length > 0 ? options[0] : null;
     }
 
     /**

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MapPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MapPatternConverter.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MapPatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MapPatternConverter.java
Sun Jan 13 05:31:50 2013
@@ -44,8 +44,8 @@ public final class MapPatternConverter e
      * @param options options, may be null.
      */
     private MapPatternConverter(final String[] options) {
-        super(((options != null) && (options.length > 0)) ? ("MAP{" + options[0]
+ "}") : "MAP", "map");
-        key = (options != null && options.length > 0) ? options[0] : null;
+        super(options != null && options.length > 0 ? "MAP{" + options[0] + "}"
: "MAP", "map");
+        key = options != null && options.length > 0 ? options[0] : null;
     }
 
     /**

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java
Sun Jan 13 05:31:50 2013
@@ -52,8 +52,8 @@ public abstract class NameAbbreviator {
 
             int i = 0;
 
-            while ((i < trimmed.length()) && (trimmed.charAt(i) >= '0')
-                    && (trimmed.charAt(i) <= '9')) {
+            while (i < trimmed.length() && trimmed.charAt(i) >= '0'
+                    && trimmed.charAt(i) <= '9') {
                 i++;
             }
 
@@ -69,14 +69,14 @@ public abstract class NameAbbreviator {
             int charCount;
             int pos = 0;
 
-            while ((pos < trimmed.length()) && (pos >= 0)) {
+            while (pos < trimmed.length() && pos >= 0) {
                 int ellipsisPos = pos;
 
                 if (trimmed.charAt(pos) == '*') {
                     charCount = Integer.MAX_VALUE;
                     ellipsisPos++;
                 } else {
-                    if ((trimmed.charAt(pos) >= '0') && (trimmed.charAt(pos) <=
'9')) {
+                    if (trimmed.charAt(pos) >= '0' && trimmed.charAt(pos) <=
'9') {
                         charCount = trimmed.charAt(pos) - '0';
                         ellipsisPos++;
                     } else {
@@ -231,7 +231,7 @@ public abstract class NameAbbreviator {
             int nextDot = buf.toString().indexOf('.', startPos);
 
             if (nextDot != -1) {
-                if ((nextDot - startPos) > charCount) {
+                if (nextDot - startPos > charCount) {
                     buf.delete(startPos + charCount, nextDot);
                     nextDot = startPos + charCount;
 
@@ -285,7 +285,7 @@ public abstract class NameAbbreviator {
             int pos = 0;
             final StringBuilder sb = new StringBuilder(buf);
 
-            for (int i = 0; (i < (fragments.length - 1)) && (pos < buf.length());
+            for (int i = 0; i < fragments.length - 1 && pos < buf.length();
                  i++) {
                 pos = fragments[i].abbreviate(sb, pos);
             }
@@ -295,7 +295,7 @@ public abstract class NameAbbreviator {
             //
             final PatternAbbreviatorFragment terminalFragment = fragments[fragments.length
- 1];
 
-            while ((pos < buf.length()) && (pos >= 0)) {
+            while (pos < buf.length() && pos >= 0) {
                 pos = terminalFragment.abbreviate(sb, pos);
             }
             return sb.toString();

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NamePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NamePatternConverter.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NamePatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NamePatternConverter.java
Sun Jan 13 05:31:50 2013
@@ -36,7 +36,7 @@ public abstract class NamePatternConvert
     protected NamePatternConverter(final String name, final String style, final String[]
options) {
         super(name, style);
 
-        if ((options != null) && (options.length > 0)) {
+        if (options != null && options.length > 0) {
             abbreviator = NameAbbreviator.getAbbreviator(options[0]);
         } else {
             abbreviator = NameAbbreviator.getDefaultAbbreviator();

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
Sun Jan 13 05:31:50 2013
@@ -207,7 +207,7 @@ public final class PatternParser {
 
         convBuf.append(lastChar);
 
-        while ((i < pattern.length()) && Character.isUnicodeIdentifierPart(pattern.charAt(i)))
{
+        while (i < pattern.length() && Character.isUnicodeIdentifierPart(pattern.charAt(i)))
{
             convBuf.append(pattern.charAt(i));
             currentLiteral.append(pattern.charAt(i));
             i++;
@@ -225,7 +225,7 @@ public final class PatternParser {
      * @return position in pattern after options.
      */
     private static int extractOptions(final String pattern, int i, final List<String>
options) {
-        while ((i < pattern.length()) && (pattern.charAt(i) == '{')) {
+        while (i < pattern.length() && pattern.charAt(i) == '{') {
             final int begin = i++;
             int end;
             int depth = 0;
@@ -332,7 +332,7 @@ public final class PatternParser {
 
                         default:
 
-                            if ((c >= '0') && (c <= '9')) {
+                            if (c >= '0' && c <= '9') {
                                 formattingInfo = new FormattingInfo(formattingInfo.isLeftAligned(),
c - '0',
                                         formattingInfo.getMaxLength());
                                 state = ParserState.MIN_STATE;
@@ -352,10 +352,10 @@ public final class PatternParser {
                 case MIN_STATE:
                     currentLiteral.append(c);
 
-                    if ((c >= '0') && (c <= '9')) {
+                    if (c >= '0' && c <= '9') {
                         // Multiply the existing value and add the value of the number just
encountered.
                         formattingInfo = new FormattingInfo(formattingInfo.isLeftAligned(),
-                                (formattingInfo.getMinLength() * DECIMAL) + (c - '0'),
+                                formattingInfo.getMinLength() * DECIMAL + c - '0',
                                 formattingInfo.getMaxLength());
                     } else if (c == '.') {
                         state = ParserState.DOT_STATE;
@@ -372,7 +372,7 @@ public final class PatternParser {
                 case DOT_STATE:
                     currentLiteral.append(c);
 
-                    if ((c >= '0') && (c <= '9')) {
+                    if (c >= '0' && c <= '9') {
                         formattingInfo = new FormattingInfo(formattingInfo.isLeftAligned(),
                             formattingInfo.getMinLength(), c - '0');
                         state = ParserState.MAX_STATE;
@@ -388,11 +388,11 @@ public final class PatternParser {
                 case MAX_STATE:
                     currentLiteral.append(c);
 
-                    if ((c >= '0') && (c <= '9')) {
+                    if (c >= '0' && c <= '9') {
                         // Multiply the existing value and add the value of the number just
encountered.
                         formattingInfo = new FormattingInfo(
                                 formattingInfo.isLeftAligned(), formattingInfo.getMinLength(),
-                                (formattingInfo.getMaxLength() * DECIMAL) + (c - '0'));
+                                formattingInfo.getMaxLength() * DECIMAL + c - '0');
                     } else {
                         i = finalizeConverter(c, pattern, i, currentLiteral, formattingInfo,
                                 converterRules, patternConverters, formattingInfos);
@@ -428,10 +428,10 @@ public final class PatternParser {
         String converterName = converterId;
         Class<PatternConverter> converterClass = null;
 
-        for (int i = converterId.length(); (i > 0) && (converterClass == null);
i--) {
+        for (int i = converterId.length(); i > 0 && converterClass == null; i--)
{
             converterName = converterName.substring(0, i);
 
-            if ((converterClass == null) && (rules != null)) {
+            if (converterClass == null && rules != null) {
                 converterClass = rules.get(converterName);
             }
         }
@@ -533,7 +533,7 @@ public final class PatternParser {
         if (pc == null) {
             StringBuilder msg;
 
-            if ((converterId == null) || (converterId.length() == 0)) {
+            if (converterId == null || converterId.length() == 0) {
                 msg =
                     new StringBuilder("Empty conversion specifier starting at position ");
             } else {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java?rev=1432558&r1=1432557&r2=1432558&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java
Sun Jan 13 05:31:50 2013
@@ -62,7 +62,7 @@ public class ThrowablePatternConverter e
     protected ThrowablePatternConverter(final String name, final String style, final String[]
options) {
         super(name, style);
         int count = Integer.MAX_VALUE;
-        if ((options != null) && (options.length > 0)) {
+        if (options != null && options.length > 0) {
             option = options[0];
             if (option == null) {
             } else if (option.equalsIgnoreCase(NONE)) {



Mime
View raw message