logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1405271 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java
Date Sat, 03 Nov 2012 02:57:39 GMT
Author: ggregory
Date: Sat Nov  3 02:57:38 2012
New Revision: 1405271

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

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

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java?rev=1405271&r1=1405270&r2=1405271&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverter.java
Sat Nov  3 02:57:38 2012
@@ -38,27 +38,29 @@ public final class ExtendedThrowablePatt
 
     private static final String FILTERS = "filters(";
 
-    private List<String> packages;
+    private final List<String> packages;
 
     /**
      * Private constructor.
      *
      * @param options options, may be null.
      */
-    private ExtendedThrowablePatternConverter(final String[] options) {
+    private ExtendedThrowablePatternConverter(final String[] options) {        
         super("ExtendedThrowable", "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