logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1405272 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java
Date Sat, 03 Nov 2012 02:59:48 GMT
Author: ggregory
Date: Sat Nov  3 02:59:47 2012
New Revision: 1405272

URL: http://svn.apache.org/viewvc?rev=1405272&view=rev
Log:
Make some ivars final.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java?rev=1405272&r1=1405271&r2=1405272&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java
Sat Nov  3 02:59:47 2012
@@ -39,7 +39,7 @@ public final class RootThrowablePatternC
 
     private static final String FILTERS = "filters(";
 
-    private List<String> packages = null;
+    private final List<String> packages;
 
     /**
      * Private constructor.
@@ -48,18 +48,20 @@ public final class RootThrowablePatternC
      */
     private RootThrowablePatternConverter(final String[] options) {
         super("RootThrowable", "throwable", options);
+        List<String> tempPackages = null;
         if (options != null && options.length > 1) {
             if (options[1].startsWith(FILTERS) && options[1].endsWith(")")) {
                 String filterStr = options[1].substring(FILTERS.length(), options[1].length()
- 1);
                 String[] array = filterStr.split(",");
                 if (array.length > 0) {
-                    packages = new ArrayList<String>(array.length);
+                    tempPackages = new ArrayList<String>(array.length);
                     for (String token : array) {
-                        packages.add(token.trim());
+                        tempPackages.add(token.trim());
                     }
                 }
             }
         }
+        packages = tempPackages;
     }
 
     /**



Mime
View raw message