You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2013/08/22 17:10:26 UTC

svn commit: r1516481 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java

Author: ggregory
Date: Thu Aug 22 15:10:26 2013
New Revision: 1516481

URL: http://svn.apache.org/r1516481
Log:
Avoid boxing and unboxing by using int instead of Integer in the ctor.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java?rev=1516481&r1=1516480&r2=1516481&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java Thu Aug 22 15:10:26 2013
@@ -27,6 +27,8 @@ import org.apache.logging.log4j.core.hel
  */
 public final class ThrowableFormatOptions {
 
+    private static final int DEFAULT_LINES = Integer.MAX_VALUE;
+
     /**
      * Default instance of {@code ThrowableFormatOptions}.
      */
@@ -68,8 +70,8 @@ public final class ThrowableFormatOption
      * @param separator The stack trace separator.
      * @param packages The packages to filter.
      */
-    protected ThrowableFormatOptions(final Integer lines, final String separator, final List<String> packages) {
-        this.lines = lines == null ? Integer.MAX_VALUE : lines;
+    protected ThrowableFormatOptions(final int lines, final String separator, final List<String> packages) {
+        this.lines = lines;
         this.separator = separator == null ? Constants.LINE_SEP : separator;
         this.packages = packages;
     }
@@ -79,14 +81,14 @@ public final class ThrowableFormatOption
      * @param packages The packages to filter.
      */
     protected ThrowableFormatOptions(final List<String> packages) {
-        this(null, null, packages);
+        this(DEFAULT_LINES, null, packages);
     }
 
     /**
      * Construct the options for printing stack trace.
      */
     protected ThrowableFormatOptions() {
-        this(null, null, null);
+        this(DEFAULT_LINES, null, null);
     }
 
     /**
@@ -118,7 +120,7 @@ public final class ThrowableFormatOption
      * @return true for all lines, false otherwise.
      */
     public boolean allLines() {
-        return this.lines == Integer.MAX_VALUE;
+        return this.lines == DEFAULT_LINES;
     }
 
     /**