logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1419697 [8/17] - in /logging/log4j/log4j2/trunk: api/src/main/java/org/apache/logging/log4j/ api/src/main/java/org/apache/logging/log4j/message/ api/src/main/java/org/apache/logging/log4j/simple/ api/src/main/java/org/apache/logging/log4j/...
Date Mon, 10 Dec 2012 19:37:03 GMT
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/StructuredDataFilter.java Mon Dec 10 19:36:06 2012
@@ -39,12 +39,12 @@ import java.util.Map;
 @Plugin(name = "StructuredDataFilter", type = "Core", elementType = "filter", printObject = true)
 public final class StructuredDataFilter extends MapFilter {
 
-    private StructuredDataFilter(Map<String, List<String>> map, boolean oper, Result onMatch, Result onMismatch) {
+    private StructuredDataFilter(final Map<String, List<String>> map, final boolean oper, final Result onMatch, final Result onMismatch) {
         super(map, oper, onMatch, onMismatch);
     }
 
     @Override
-    public Result filter(Logger logger, Level level, Marker marker, Message msg, Throwable t) {
+    public Result filter(final Logger logger, final Level level, final Marker marker, final Message msg, final Throwable t) {
         if (msg instanceof StructuredDataMessage) {
             return filter((StructuredDataMessage) msg);
         }
@@ -52,18 +52,18 @@ public final class StructuredDataFilter 
     }
 
     @Override
-    public Result filter(LogEvent event) {
-        Message msg = event.getMessage();
+    public Result filter(final LogEvent event) {
+        final Message msg = event.getMessage();
         if (msg instanceof StructuredDataMessage) {
             return filter((StructuredDataMessage) msg);
         }
         return super.filter(event);
     }
 
-    protected Result filter(StructuredDataMessage message) {
+    protected Result filter(final StructuredDataMessage message) {
         boolean match = false;
-        for (Map.Entry<String, List<String>> entry : getMap().entrySet()) {
-            String toMatch = getValue(message, entry.getKey());
+        for (final Map.Entry<String, List<String>> entry : getMap().entrySet()) {
+            final String toMatch = getValue(message, entry.getKey());
             if (toMatch != null) {
                 match = entry.getValue().contains(toMatch);
             } else {
@@ -76,7 +76,7 @@ public final class StructuredDataFilter 
         return match ? onMatch : onMismatch;
     }
 
-    private String getValue(StructuredDataMessage data, String key) {
+    private String getValue(final StructuredDataMessage data, final String key) {
         if (key.equalsIgnoreCase("id")) {
             return data.getId().toString();
         } else if (key.equalsIgnoreCase("id.name")) {
@@ -99,22 +99,22 @@ public final class StructuredDataFilter 
      * @return The StructuredDataFilter.
      */
     @PluginFactory
-    public static StructuredDataFilter createFilter(@PluginElement("pairs") KeyValuePair[] pairs,
-                                                    @PluginAttr("operator") String oper,
-                                                    @PluginAttr("onmatch") String match,
-                                                    @PluginAttr("onmismatch") String mismatch) {
+    public static StructuredDataFilter createFilter(@PluginElement("pairs") final KeyValuePair[] pairs,
+                                                    @PluginAttr("operator") final String oper,
+                                                    @PluginAttr("onmatch") final String match,
+                                                    @PluginAttr("onmismatch") final String mismatch) {
         if (pairs == null || pairs.length == 0) {
             LOGGER.error("keys and values must be specified for the StructuredDataFilter");
             return null;
         }
-        Map<String, List<String>> map = new HashMap<String, List<String>>();
-        for (KeyValuePair pair : pairs) {
-            String key = pair.getKey();
+        final Map<String, List<String>> map = new HashMap<String, List<String>>();
+        for (final KeyValuePair pair : pairs) {
+            final String key = pair.getKey();
             if (key == null) {
                 LOGGER.error("A null key is not valid in MapFilter");
                 continue;
             }
-            String value = pair.getValue();
+            final String value = pair.getValue();
             if (value == null) {
                 LOGGER.error("A null value for key " + key + " is not allowed in MapFilter");
                 continue;
@@ -132,9 +132,9 @@ public final class StructuredDataFilter 
             LOGGER.error("StructuredDataFilter is not configured with any valid key value pairs");
             return null;
         }
-        boolean isAnd = oper == null || !oper.equalsIgnoreCase("or");
-        Result onMatch = Result.toResult(match);
-        Result onMismatch = Result.toResult(mismatch);
+        final boolean isAnd = oper == null || !oper.equalsIgnoreCase("or");
+        final Result onMatch = Result.toResult(match);
+        final Result onMismatch = Result.toResult(mismatch);
         return new StructuredDataFilter(map, isAnd, onMatch, onMismatch);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/ThreadContextMapFilter.java Mon Dec 10 19:36:06 2012
@@ -45,11 +45,11 @@ public class ThreadContextMapFilter exte
 
     private final boolean useMap;
 
-    public ThreadContextMapFilter(Map<String, List<String>> pairs, boolean oper, Result onMatch, Result onMismatch) {
+    public ThreadContextMapFilter(final Map<String, List<String>> pairs, final boolean oper, final Result onMatch, final Result onMismatch) {
         super(pairs, oper, onMatch, onMismatch);
         if (pairs.size() == 1) {
-            Iterator<Map.Entry<String, List<String>>> iter = pairs.entrySet().iterator();
-            Map.Entry<String, List<String>> entry = iter.next();
+            final Iterator<Map.Entry<String, List<String>>> iter = pairs.entrySet().iterator();
+            final Map.Entry<String, List<String>> entry = iter.next();
             if (entry.getValue().size() == 1) {
                 this.key = entry.getKey();
                 this.value = entry.getValue().get(0);
@@ -67,25 +67,25 @@ public class ThreadContextMapFilter exte
     }
 
     @Override
-    public Result filter(Logger logger, Level level, Marker marker, String msg, Object... params) {
+    public Result filter(final Logger logger, final Level level, final Marker marker, final String msg, final Object... params) {
         return filter();
     }
 
     @Override
-    public Result filter(Logger logger, Level level, Marker marker, Object msg, Throwable t) {
+    public Result filter(final Logger logger, final Level level, final Marker marker, final Object msg, final Throwable t) {
         return filter();
     }
 
     @Override
-    public Result filter(Logger logger, Level level, Marker marker, Message msg, Throwable t) {
+    public Result filter(final Logger logger, final Level level, final Marker marker, final Message msg, final Throwable t) {
         return filter();
     }
 
     private Result filter() {
         boolean match = false;
         if (useMap) {
-            for (Map.Entry<String, List<String>> entry : getMap().entrySet()) {
-                String toMatch = ThreadContext.get(entry.getKey());
+            for (final Map.Entry<String, List<String>> entry : getMap().entrySet()) {
+                final String toMatch = ThreadContext.get(entry.getKey());
                 if (toMatch != null) {
                     match = entry.getValue().contains(toMatch);
                 } else {
@@ -102,27 +102,27 @@ public class ThreadContextMapFilter exte
     }
 
     @Override
-    public Result filter(LogEvent event) {
+    public Result filter(final LogEvent event) {
         return super.filter(event.getContextMap()) ? onMatch : onMismatch;
     }
 
     @PluginFactory
-    public static ThreadContextMapFilter createFilter(@PluginElement("pairs") KeyValuePair[] pairs,
-                                                      @PluginAttr("operator") String oper,
-                                                      @PluginAttr("onmatch") String match,
-                                                      @PluginAttr("onmismatch") String mismatch) {
+    public static ThreadContextMapFilter createFilter(@PluginElement("pairs") final KeyValuePair[] pairs,
+                                                      @PluginAttr("operator") final String oper,
+                                                      @PluginAttr("onmatch") final String match,
+                                                      @PluginAttr("onmismatch") final String mismatch) {
         if (pairs == null || pairs.length == 0) {
             LOGGER.error("key and value pairs must be specified for the ThreadContextMapFilter");
             return null;
         }
-        Map<String, List<String>> map = new HashMap<String, List<String>>();
-        for (KeyValuePair pair : pairs) {
-            String key = pair.getKey();
+        final Map<String, List<String>> map = new HashMap<String, List<String>>();
+        for (final KeyValuePair pair : pairs) {
+            final String key = pair.getKey();
             if (key == null) {
                 LOGGER.error("A null key is not valid in MapFilter");
                 continue;
             }
-            String value = pair.getValue();
+            final String value = pair.getValue();
             if (value == null) {
                 LOGGER.error("A null value for key " + key + " is not allowed in MapFilter");
                 continue;
@@ -140,9 +140,9 @@ public class ThreadContextMapFilter exte
             LOGGER.error("ThreadContextMapFilter is not configured with any valid key value pairs");
             return null;
         }
-        boolean isAnd = oper == null || !oper.equalsIgnoreCase("or");
-        Result onMatch = Result.toResult(match);
-        Result onMismatch = Result.toResult(mismatch);
+        final boolean isAnd = oper == null || !oper.equalsIgnoreCase("or");
+        final Result onMatch = Result.toResult(match);
+        final Result onMismatch = Result.toResult(mismatch);
         return new ThreadContextMapFilter(map, isAnd, onMatch, onMismatch);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java Mon Dec 10 19:36:06 2012
@@ -38,32 +38,32 @@ public final class ThresholdFilter exten
 
     private final Level level;
 
-    private ThresholdFilter(Level level, Result onMatch, Result onMismatch) {
+    private ThresholdFilter(final Level level, final Result onMatch, final Result onMismatch) {
         super(onMatch, onMismatch);
         this.level = level;
     }
 
     @Override
-    public Result filter(Logger logger, Level level, Marker marker, String msg, Object... params) {
+    public Result filter(final Logger logger, final Level level, final Marker marker, final String msg, final Object... params) {
         return filter(level);
     }
 
     @Override
-    public Result filter(Logger logger, Level level, Marker marker, Object msg, Throwable t) {
+    public Result filter(final Logger logger, final Level level, final Marker marker, final Object msg, final Throwable t) {
         return filter(level);
     }
 
     @Override
-    public Result filter(Logger logger, Level level, Marker marker, Message msg, Throwable t) {
+    public Result filter(final Logger logger, final Level level, final Marker marker, final Message msg, final Throwable t) {
         return filter(level);
     }
 
     @Override
-    public Result filter(LogEvent event) {
+    public Result filter(final LogEvent event) {
         return filter(event.getLevel());
     }
 
-    private Result filter(Level level) {
+    private Result filter(final Level level) {
         return level.isAtLeastAsSpecificAs(this.level) ? onMatch : onMismatch;
     }
 
@@ -80,12 +80,12 @@ public final class ThresholdFilter exten
      * @return The created ThresholdFilter.
      */
     @PluginFactory
-    public static ThresholdFilter createFilter(@PluginAttr("level") String levelName,
-                                               @PluginAttr("onMatch") String match,
-                                               @PluginAttr("onMismatch") String mismatch) {
-        Level level = Level.toLevel(levelName, Level.ERROR);
-        Result onMatch = Result.toResult(match, Result.NEUTRAL);
-        Result onMismatch = Result.toResult(mismatch, Result.DENY);
+    public static ThresholdFilter createFilter(@PluginAttr("level") final String levelName,
+                                               @PluginAttr("onMatch") final String match,
+                                               @PluginAttr("onMismatch") final String mismatch) {
+        final Level level = Level.toLevel(levelName, Level.ERROR);
+        final Result onMatch = Result.toResult(match, Result.NEUTRAL);
+        final Result onMismatch = Result.toResult(mismatch, Result.DENY);
         return new ThresholdFilter(level, onMatch, onMismatch);
     }
 

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=1419697&r1=1419696&r2=1419697&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 Mon Dec 10 19:36:06 2012
@@ -60,7 +60,7 @@ public final class TimeFilter extends Ab
     private final TimeZone timezone;
 
 
-    private TimeFilter(long start, long end, TimeZone tz, Result onMatch, Result onMismatch) {
+    private TimeFilter(final long start, final long end, final TimeZone tz, final Result onMatch, final Result onMismatch) {
         super(onMatch, onMismatch);
         this.start = start;
         this.end = end;
@@ -68,14 +68,14 @@ public final class TimeFilter extends Ab
     }
 
     @Override
-    public Result filter(LogEvent event) {
-        Calendar calendar = Calendar.getInstance(timezone);
+    public Result filter(final LogEvent event) {
+        final Calendar calendar = Calendar.getInstance(timezone);
         calendar.setTimeInMillis(event.getMillis());
         //
         //   get apparent number of milliseconds since midnight
         //      (ignores extra or missing hour on daylight time changes).
         //
-        long apparentOffset = calendar.get(Calendar.HOUR_OF_DAY) * HOUR_MS +
+        final long apparentOffset = calendar.get(Calendar.HOUR_OF_DAY) * HOUR_MS +
             calendar.get(Calendar.MINUTE) * MINUTE_MS +
             calendar.get(Calendar.SECOND) * SECOND_MS +
             calendar.get(Calendar.MILLISECOND);
@@ -84,7 +84,7 @@ public final class TimeFilter extends Ab
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("start=").append(start);
         sb.append(", end=").append(end);
         sb.append(", timezone=").append(timezone.toString());
@@ -101,18 +101,18 @@ public final class TimeFilter extends Ab
      * @return A TimeFilter.
      */
     @PluginFactory
-    public static TimeFilter createFilter(@PluginAttr("start") String start,
-                                          @PluginAttr("end") String end,
-                                          @PluginAttr("timezone") String tz,
-                                          @PluginAttr("onMatch") String match,
-                                          @PluginAttr("onMismatch") String mismatch) {
-        SimpleDateFormat stf = new SimpleDateFormat("HH:mm:ss");
+    public static TimeFilter createFilter(@PluginAttr("start") final String start,
+                                          @PluginAttr("end") final String end,
+                                          @PluginAttr("timezone") final String tz,
+                                          @PluginAttr("onMatch") final String match,
+                                          @PluginAttr("onMismatch") final String mismatch) {
+        final SimpleDateFormat stf = new SimpleDateFormat("HH:mm:ss");
         long s = 0;
         if (start != null) {
             stf.setTimeZone(TimeZone.getTimeZone("UTC"));
             try {
                 s = stf.parse(start).getTime();
-            } catch (ParseException ex) {
+            } catch (final ParseException ex) {
                 LOGGER.warn("Error parsing start value " + start, ex);
             }
         }
@@ -121,13 +121,13 @@ public final class TimeFilter extends Ab
             stf.setTimeZone(TimeZone.getTimeZone("UTC"));
             try {
                 e = stf.parse(end).getTime();
-            } catch (ParseException ex) {
+            } catch (final ParseException ex) {
                 LOGGER.warn("Error parsing start value " + end, ex);
             }
         }
-        TimeZone timezone = (tz == null) ? TimeZone.getDefault() : TimeZone.getTimeZone(tz);
-        Result onMatch = Result.toResult(match, Result.NEUTRAL);
-        Result onMismatch = Result.toResult(mismatch, Result.DENY);
+        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/helpers/FileUtils.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/FileUtils.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/FileUtils.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/FileUtils.java Mon Dec 10 19:36:06 2012
@@ -56,23 +56,23 @@ public final class FileUtils {
             if (uri.getScheme() == null) {
                 try {
                     uri = new File(uri.getPath()).toURI();
-                } catch (Exception ex) {
+                } catch (final Exception ex) {
                     logger.warn("Invalid URI " + uri);
                     return null;
                 }
             }
             try {
                 return new File(URLDecoder.decode(uri.toURL().getFile(), "UTF8"));
-            } catch (MalformedURLException ex) {
+            } catch (final MalformedURLException ex) {
                 logger.warn("Invalid URL " + uri, ex);
-            } catch (UnsupportedEncodingException uee) {
+            } catch (final UnsupportedEncodingException uee) {
                 logger.warn("Invalid encoding: UTF8", uee);
             }
             return null;
         }
     }
 
-    public static boolean isFile(URL url) {
+    public static boolean isFile(final URL url) {
         return url != null && (url.getProtocol().equals(PROTOCOL_FILE) || url.getProtocol().equals(JBOSS_FILE));
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/KeyValuePair.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/KeyValuePair.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/KeyValuePair.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/KeyValuePair.java Mon Dec 10 19:36:06 2012
@@ -34,7 +34,7 @@ public class KeyValuePair {
      * @param key The key.
      * @param value The value.
      */
-    public KeyValuePair(String key, String value) {
+    public KeyValuePair(final String key, final String value) {
         this.key = key;
         this.value = value;
     }
@@ -67,8 +67,8 @@ public class KeyValuePair {
      * @return A KeyValuePair.
      */
     @PluginFactory
-    public static KeyValuePair createPair(@PluginAttr("key") String key,
-                                          @PluginAttr("value")  String value) {
+    public static KeyValuePair createPair(@PluginAttr("key") final String key,
+                                          @PluginAttr("value") final  String value) {
 
         return new KeyValuePair(key, value);
     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Loader.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Loader.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Loader.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Loader.java Mon Dec 10 19:36:06 2012
@@ -36,7 +36,7 @@ public final class Loader {
     private static final Logger LOGGER = StatusLogger.getLogger();
 
     static {
-        String ignoreTCLProp = OptionConverter.getSystemProperty("log4j.ignoreTCL", null);
+        final String ignoreTCLProp = OptionConverter.getSystemProperty("log4j.ignoreTCL", null);
         if (ignoreTCLProp != null) {
             ignoreTCL = OptionConverter.toBoolean(ignoreTCLProp, true);
         }
@@ -67,13 +67,13 @@ public final class Loader {
      * @param defaultLoader The default ClassLoader.
      * @return A URL to the resource.
      */
-    public static URL getResource(String resource, ClassLoader defaultLoader) {
+    public static URL getResource(final String resource, final ClassLoader defaultLoader) {
         try {
             ClassLoader classLoader = getTCL();
             if (classLoader != null) {
                 LOGGER.trace("Trying to find [" + resource + "] using context classloader "
                         + classLoader + '.');
-                URL url = classLoader.getResource(resource);
+                final URL url = classLoader.getResource(resource);
                 if (url != null) {
                     return url;
                 }
@@ -83,7 +83,7 @@ public final class Loader {
             classLoader = Loader.class.getClassLoader();
             if (classLoader != null) {
                 LOGGER.trace("Trying to find [" + resource + "] using " + classLoader + " class loader.");
-                URL url = classLoader.getResource(resource);
+                final URL url = classLoader.getResource(resource);
                 if (url != null) {
                     return url;
                 }
@@ -91,20 +91,20 @@ public final class Loader {
             // We could not find resource. Finally try with the default ClassLoader.
             if (defaultLoader != null) {
                 LOGGER.trace("Trying to find [" + resource + "] using " + defaultLoader + " class loader.");
-                URL url = defaultLoader.getResource(resource);
+                final URL url = defaultLoader.getResource(resource);
                 if (url != null) {
                     return url;
                 }
             }
-        } catch (IllegalAccessException t) {
+        } catch (final IllegalAccessException t) {
             LOGGER.warn(TSTR, t);
-        } catch (InvocationTargetException t) {
+        } catch (final InvocationTargetException t) {
             if (t.getTargetException() instanceof InterruptedException
                 || t.getTargetException() instanceof InterruptedIOException) {
                 Thread.currentThread().interrupt();
             }
             LOGGER.warn(TSTR, t);
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             //
             //  can't be InterruptedException or InterruptedIOException
             //    since not declared, must be error or RuntimeError.
@@ -141,7 +141,7 @@ public final class Loader {
      * @param defaultLoader The default ClassLoader.
      * @return An InputStream to read the resouce.
      */
-    public static InputStream getResourceAsStream(String resource, ClassLoader defaultLoader) {
+    public static InputStream getResourceAsStream(final String resource, final ClassLoader defaultLoader) {
         ClassLoader classLoader;
         InputStream is;
 
@@ -173,15 +173,15 @@ public final class Loader {
                     return is;
                 }
             }
-        } catch (IllegalAccessException t) {
+        } catch (final IllegalAccessException t) {
             LOGGER.warn(TSTR, t);
-        } catch (InvocationTargetException t) {
+        } catch (final InvocationTargetException t) {
             if (t.getTargetException() instanceof InterruptedException
                 || t.getTargetException() instanceof InterruptedIOException) {
                 Thread.currentThread().interrupt();
             }
             LOGGER.warn(TSTR, t);
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             //
             //  can't be InterruptedException or InterruptedIOException
             //    since not declared, must be error or RuntimeError.
@@ -202,29 +202,29 @@ public final class Loader {
      * @return The Class.
      * @throws ClassNotFoundException if the Class could not be found.
      */
-    public static Class<?> loadClass(String className) throws ClassNotFoundException {
+    public static Class<?> loadClass(final String className) throws ClassNotFoundException {
         // Just call Class.forName(className) if we are instructed to ignore the TCL.
         if (ignoreTCL) {
             return Class.forName(className);
         } else {
             try {
                 return getTCL().loadClass(className);
-            } catch (Throwable e) {
+            } catch (final Throwable e) {
                 return Class.forName(className);
             }
         }
     }
 
-    public static ClassLoader getClassLoader(Class<?> class1, Class<?> class2) {
+    public static ClassLoader getClassLoader(final Class<?> class1, final Class<?> class2) {
 
         ClassLoader loader1 = null;
         try {
             loader1 = getTCL();
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             LOGGER.warn("Caught exception locating thread ClassLoader {}", ex.getMessage());
         }
-        ClassLoader loader2 = class1 == null ? null : class1.getClassLoader();
-        ClassLoader loader3 = class2 == null ? null : class2.getClass().getClassLoader();
+        final ClassLoader loader2 = class1 == null ? null : class1.getClassLoader();
+        final ClassLoader loader3 = class2 == null ? null : class2.getClass().getClassLoader();
 
         if (isChild(loader1, loader2)) {
             return isChild(loader1, loader3) ? loader1 : loader3;
@@ -233,7 +233,7 @@ public final class Loader {
         }
     }
 
-    private static boolean isChild(ClassLoader loader1, ClassLoader loader2) {
+    private static boolean isChild(final ClassLoader loader1, final ClassLoader loader2) {
         if (loader1 != null && loader2 != null) {
             ClassLoader parent = loader1.getParent();
             while (parent != null && parent != loader2) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/NameUtil.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/NameUtil.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/NameUtil.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/NameUtil.java Mon Dec 10 19:36:06 2012
@@ -24,11 +24,11 @@ public final class NameUtil {
     private NameUtil() {
     }
 
-    public static String getSubName(String name) {
+    public static String getSubName(final String name) {
         if (name.length() == 0) {
             return null;
         }
-        int i = name.lastIndexOf('.');
+        final int i = name.lastIndexOf('.');
         return i > 0 ? name.substring(0, i) : "";
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/OptionConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/OptionConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/OptionConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/OptionConverter.java Mon Dec 10 19:36:06 2012
@@ -41,9 +41,9 @@ public final class OptionConverter {
     private OptionConverter() {
     }
 
-    public static String[] concatanateArrays(String[] l, String[] r) {
-        int len = l.length + r.length;
-        String[] a = new String[len];
+    public static String[] concatanateArrays(final String[] l, final String[] r) {
+        final int len = l.length + r.length;
+        final String[] a = new String[len];
 
         System.arraycopy(l, 0, a, 0, l.length);
         System.arraycopy(r, 0, a, l.length, r.length);
@@ -51,10 +51,10 @@ public final class OptionConverter {
         return a;
     }
 
-    public static String convertSpecialChars(String s) {
+    public static String convertSpecialChars(final String s) {
         char c;
-        int len = s.length();
-        StringBuffer sbuf = new StringBuffer(len);
+        final int len = s.length();
+        final StringBuffer sbuf = new StringBuffer(len);
 
         int i = 0;
         while (i < len) {
@@ -94,21 +94,21 @@ public final class OptionConverter {
      * @return the string value of the system property, or the default
      *         value if there is no property with that key.
      */
-    public static String getSystemProperty(String key, String def) {
+    public static String getSystemProperty(final String key, final String def) {
         try {
             return System.getProperty(key, def);
-        } catch (Throwable e) { // MS-Java throws com.ms.security.SecurityExceptionEx
+        } catch (final Throwable e) { // MS-Java throws com.ms.security.SecurityExceptionEx
             LOGGER.debug("Was not allowed to read system property \"" + key + "\".");
             return def;
         }
     }
 
 
-    public static Object instantiateByKey(Properties props, String key, Class<?> superClass,
-                                   Object defaultValue) {
+    public static Object instantiateByKey(final Properties props, final String key, final Class<?> superClass,
+                                   final Object defaultValue) {
 
         // Get the value of the property in string form
-        String className = findAndSubst(key, props);
+        final String className = findAndSubst(key, props);
         if (className == null) {
             LOGGER.error("Could not find value for key " + key);
             return defaultValue;
@@ -129,11 +129,11 @@ public final class OptionConverter {
      * @param dEfault The default value.
      * @return true or false, depending on the value and/or default.
      */
-    public static boolean toBoolean(String value, boolean dEfault) {
+    public static boolean toBoolean(final String value, final boolean dEfault) {
         if (value == null) {
             return dEfault;
         }
-        String trimmedVal = value.trim();
+        final String trimmedVal = value.trim();
         if ("true".equalsIgnoreCase(trimmedVal)) {
             return true;
         }
@@ -149,12 +149,12 @@ public final class OptionConverter {
      * @param dEfault The default value.
      * @return The value as an int.
      */
-    public static int toInt(String value, int dEfault) {
+    public static int toInt(final String value, final int dEfault) {
         if (value != null) {
-            String s = value.trim();
+            final String s = value.trim();
             try {
                 return Integer.valueOf(s);
-            } catch (NumberFormatException e) {
+            } catch (final NumberFormatException e) {
                 LOGGER.error("[" + s + "] is not in proper int form.");
                 e.printStackTrace();
             }
@@ -168,7 +168,7 @@ public final class OptionConverter {
      * @param defaultValue The default value.
      * @return The size of the file as a long.
      */
-    public static long toFileSize(String value, long defaultValue) {
+    public static long toFileSize(final String value, final long defaultValue) {
         if (value == null) {
             return defaultValue;
         }
@@ -190,7 +190,7 @@ public final class OptionConverter {
         if (s != null) {
             try {
                 return Long.valueOf(s) * multiplier;
-            } catch (NumberFormatException e) {
+            } catch (final NumberFormatException e) {
                 LOGGER.error("[" + s + "] is not in proper int form.");
                 LOGGER.error("[" + value + "] not in expected format.", e);
             }
@@ -206,15 +206,15 @@ public final class OptionConverter {
      * @param props The properties.
      * @return The String after substitution.
      */
-    public static String findAndSubst(String key, Properties props) {
-        String value = props.getProperty(key);
+    public static String findAndSubst(final String key, final Properties props) {
+        final String value = props.getProperty(key);
         if (value == null) {
             return null;
         }
 
         try {
             return substVars(value, props);
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             LOGGER.error("Bad option value [" + value + "].", e);
             return value;
         }
@@ -231,11 +231,11 @@ public final class OptionConverter {
      * @param defaultValue The object to return in case of non-fulfillment
      * @return The created object.
      */
-    public static Object instantiateByClassName(String className, Class<?> superClass,
-                                         Object defaultValue) {
+    public static Object instantiateByClassName(final String className, final Class<?> superClass,
+                                         final Object defaultValue) {
         if (className != null) {
             try {
-                Class<?> classObj = Loader.loadClass(className);
+                final Class<?> classObj = Loader.loadClass(className);
                 if (!superClass.isAssignableFrom(classObj)) {
                     LOGGER.error("A \"" + className + "\" object is not assignable to a \"" +
                         superClass.getName() + "\" variable.");
@@ -246,13 +246,13 @@ public final class OptionConverter {
                     return defaultValue;
                 }
                 return classObj.newInstance();
-            } catch (ClassNotFoundException e) {
+            } catch (final ClassNotFoundException e) {
                 LOGGER.error("Could not instantiate class [" + className + "].", e);
-            } catch (IllegalAccessException e) {
+            } catch (final IllegalAccessException e) {
                 LOGGER.error("Could not instantiate class [" + className + "].", e);
-            } catch (InstantiationException e) {
+            } catch (final InstantiationException e) {
                 LOGGER.error("Could not instantiate class [" + className + "].", e);
-            } catch (RuntimeException e) {
+            } catch (final RuntimeException e) {
                 LOGGER.error("Could not instantiate class [" + className + "].", e);
             }
         }
@@ -297,10 +297,10 @@ public final class OptionConverter {
      * @return The String after substitution.
      * @throws IllegalArgumentException if <code>val</code> is malformed.
      */
-    public static String substVars(String val, Properties props) throws
+    public static String substVars(final String val, final Properties props) throws
         IllegalArgumentException {
 
-        StringBuilder sbuf = new StringBuilder();
+        final StringBuilder sbuf = new StringBuilder();
 
         int i = 0;
         int j;
@@ -325,7 +325,7 @@ public final class OptionConverter {
                         + '.');
                 } else {
                     j += DELIM_START_LEN;
-                    String key = val.substring(j, k);
+                    final String key = val.substring(j, k);
                     // first try in System properties
                     String replacement = getSystemProperty(key, null);
                     // then try props parameter
@@ -339,7 +339,7 @@ public final class OptionConverter {
                         // the where the properties are
                         // x1=p1
                         // x2=${x1}
-                        String recursiveReplacement = substVars(replacement, props);
+                        final String recursiveReplacement = substVars(replacement, props);
                         sbuf.append(recursiveReplacement);
                     }
                     i = k + DELIM_STOP_LEN;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Transform.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Transform.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Transform.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Transform.java Mon Dec 10 19:36:06 2012
@@ -56,10 +56,10 @@ public final class Transform {
         //Use a StringBuffer in lieu of String concatenation -- it is
         //much more efficient this way.
 
-        StringBuilder buf = new StringBuilder(input.length() + 6);
+        final StringBuilder buf = new StringBuilder(input.length() + 6);
         char ch = ' ';
 
-        int len = input.length();
+        final int len = input.length();
         for (int i = 0; i < len; i++) {
             ch = input.charAt(i);
             if (ch > '>') {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/UUIDUtil.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/UUIDUtil.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/UUIDUtil.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/UUIDUtil.java Mon Dec 10 19:36:06 2012
@@ -65,65 +65,65 @@ public final class UUIDUtil {
     static {
         byte[] mac = null;
         try {
-            InetAddress address = InetAddress.getLocalHost();
+            final InetAddress address = InetAddress.getLocalHost();
             try {
                 NetworkInterface ni = NetworkInterface.getByInetAddress(address);
                 if (ni != null && !ni.isLoopback() && ni.isUp()) {
-                    Method method = ni.getClass().getMethod("getHardwareAddress");
+                    final Method method = ni.getClass().getMethod("getHardwareAddress");
                     if (method != null) {
                         mac = (byte[]) method.invoke(ni);
                     }
                 }
 
                 if (mac == null) {
-                    Enumeration<NetworkInterface> enumeration = NetworkInterface.getNetworkInterfaces();
+                    final Enumeration<NetworkInterface> enumeration = NetworkInterface.getNetworkInterfaces();
                     while (enumeration.hasMoreElements() && mac == null) {
                         ni = enumeration.nextElement();
                         if (ni != null && ni.isUp() && !ni.isLoopback()) {
-                            Method method = ni.getClass().getMethod("getHardwareAddress");
+                            final Method method = ni.getClass().getMethod("getHardwareAddress");
                             if (method != null) {
                                 mac = (byte[]) method.invoke(ni);
                             }
                         }
                     }
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 ex.printStackTrace();
                 // Ignore exception
             }
             if (mac == null || mac.length == 0) {
                 mac = address.getAddress();
             }
-        } catch (UnknownHostException e) {
+        } catch (final UnknownHostException e) {
             // Ignore exception
         }
-        Random randomGenerator = new SecureRandom();
+        final Random randomGenerator = new SecureRandom();
         if (mac == null || mac.length == 0) {
             mac = new byte[6];
             randomGenerator.nextBytes(mac);
         }
-        int length = mac.length >= 6 ? 6 : mac.length;
-        int index = mac.length >= 6 ? mac.length - 6 : 0;
-        byte[] node = new byte[NODE_SIZE];
+        final int length = mac.length >= 6 ? 6 : mac.length;
+        final int index = mac.length >= 6 ? mac.length - 6 : 0;
+        final byte[] node = new byte[NODE_SIZE];
         node[0] = VARIANT;
         node[1] = 0;
         for (int i = 2; i < NODE_SIZE; ++i) {
             node[i] = 0;
         }
         System.arraycopy(mac, index, node, index + 2, length);
-        ByteBuffer buf = ByteBuffer.wrap(node);
+        final ByteBuffer buf = ByteBuffer.wrap(node);
         long rand = uuidSequence;
-        Runtime runtime = Runtime.getRuntime();
+        final Runtime runtime = Runtime.getRuntime();
         synchronized (runtime) {
             String assigned = System.getProperty(ASSIGNED_SEQUENCES);
             long[] sequences;
             if (assigned == null) {
                 sequences = new long[0];
             } else {
-                String[] array = assigned.split(",");
+                final String[] array = assigned.split(",");
                 sequences = new long[array.length];
                 int i = 0;
-                for (String value : array) {
+                for (final String value : array) {
                     sequences[i] = Long.parseLong(value);
                     ++i;
                 }
@@ -135,7 +135,7 @@ public final class UUIDUtil {
             boolean duplicate;
             do {
                 duplicate = false;
-                for (long sequence : sequences) {
+                for (final long sequence : sequences) {
                     if (sequence == rand) {
                         duplicate = true;
                     }
@@ -174,12 +174,12 @@ public final class UUIDUtil {
      */
     public static UUID getTimeBasedUUID() {
 
-        long time = ((System.currentTimeMillis() * HUNDRED_NANOS_PER_MILLI) + NUM_100NS_INTERVALS_SINCE_UUID_EPOCH) +
+        final long time = ((System.currentTimeMillis() * HUNDRED_NANOS_PER_MILLI) + NUM_100NS_INTERVALS_SINCE_UUID_EPOCH) +
             (count.incrementAndGet() % HUNDRED_NANOS_PER_MILLI);
-        long timeLow = (time & LOW_MASK) << SHIFT_4;
-        long timeMid = (time & MID_MASK) >> SHIFT_2;
-        long timeHi = (time & HIGH_MASK) >> SHIFT_6;
-        long most = timeLow | timeMid | TYPE1 | timeHi;
+        final long timeLow = (time & LOW_MASK) << SHIFT_4;
+        final long timeMid = (time & MID_MASK) >> SHIFT_2;
+        final long timeHi = (time & HIGH_MASK) >> SHIFT_6;
+        final long most = timeLow | timeMid | TYPE1 | timeHi;
         return new UUID(most, least);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/Log4jContextFactory.java Mon Dec 10 19:36:06 2012
@@ -37,15 +37,15 @@ public class Log4jContextFactory impleme
      * Constructor that initializes the ContextSelector.
      */
     public Log4jContextFactory() {
-        String sel = System.getProperty(Constants.LOG4J_CONTEXT_SELECTOR);
+        final String sel = System.getProperty(Constants.LOG4J_CONTEXT_SELECTOR);
         if (sel != null) {
             try {
-                Class clazz = Loader.loadClass(sel);
+                final Class clazz = Loader.loadClass(sel);
                 if (clazz != null && ContextSelector.class.isAssignableFrom(clazz)) {
                     selector = (ContextSelector) clazz.newInstance();
                     return;
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 logger.error("Unable to create context " + sel, ex);
             }
 
@@ -69,8 +69,8 @@ public class Log4jContextFactory impleme
      * for the caller if a more appropriate Context can be determined.
      * @return The LoggerContext.
      */
-    public LoggerContext getContext(String fqcn, ClassLoader loader, boolean currentContext) {
-        LoggerContext ctx = selector.getContext(fqcn, loader, currentContext);
+    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext) {
+        final LoggerContext ctx = selector.getContext(fqcn, loader, currentContext);
         if (ctx.getStatus() == LoggerContext.Status.INITIALIZED) {
             ctx.start();
         }

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=1419697&r1=1419696&r2=1419697&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 Mon Dec 10 19:36:06 2012
@@ -46,7 +46,7 @@ public class Log4jLogEvent implements Lo
     private final long timestamp;
     private final ThrowableProxy throwable;
     private final Map<String, String> mdc;
-    private ThreadContext.ContextStack ndc;
+    private final ThreadContext.ContextStack ndc;
     private String threadName = null;
     private StackTraceElement location;
 
@@ -59,7 +59,7 @@ public class Log4jLogEvent implements Lo
      * @param message The Message.
      * @param t A Throwable or null.
      */
-    public Log4jLogEvent(String loggerName, Marker marker, String fqcn, Level level, Message message, Throwable t) {
+    public Log4jLogEvent(final String loggerName, final Marker marker, final String fqcn, final Level level, final Message message, final Throwable t) {
         this(loggerName, marker, fqcn, level, message, null, t);
     }
 
@@ -72,8 +72,8 @@ public class Log4jLogEvent implements Lo
      * @param message The Message.
      * @param t A Throwable or null.
      */
-    public Log4jLogEvent(String loggerName, Marker marker, String fqcn, Level level, Message message,
-                         List<Property> properties, Throwable t) {
+    public Log4jLogEvent(final String loggerName, final Marker marker, final String fqcn, final Level level, final Message message,
+                         final List<Property> properties, final Throwable t) {
         this(loggerName, marker, fqcn, level, message, t,
             createMap(properties),
             ThreadContext.getDepth() == 0 ? null : ThreadContext.cloneStack(), null,
@@ -94,9 +94,9 @@ public class Log4jLogEvent implements Lo
      * @param location The locations of the caller.
      * @param timestamp The timestamp of the event.
      */
-    public Log4jLogEvent(String loggerName, Marker marker, String fqcn, Level level, Message message, Throwable t,
-                         Map<String, String> mdc, ThreadContext.ContextStack ndc, String threadName,
-                         StackTraceElement location, long timestamp) {
+    public Log4jLogEvent(final String loggerName, final Marker marker, final String fqcn, final Level level, final Message message, final Throwable t,
+                         final Map<String, String> mdc, final ThreadContext.ContextStack ndc, final String threadName,
+                         final StackTraceElement location, final long timestamp) {
         name = loggerName;
         this.marker = marker;
         this.fqcnOfLogger = fqcn;
@@ -113,16 +113,16 @@ public class Log4jLogEvent implements Lo
         }
     }
 
-    private static Map<String, String> createMap(List<Property> properties) {
+    private static Map<String, String> createMap(final List<Property> properties) {
         if (ThreadContext.isEmpty() && (properties == null || properties.size() == 0)) {
             return null;
         }
         if (properties == null || properties.size() == 0) {
             return ThreadContext.getImmutableContext();
         }
-        Map<String, String> map = ThreadContext.getContext();
+        final Map<String, String> map = ThreadContext.getContext();
 
-        for (Property prop : properties) {
+        for (final Property prop : properties) {
             if (!map.containsKey(prop.getName())) {
                 map.put(prop.getName(), prop.getValue());
             }
@@ -223,10 +223,10 @@ public class Log4jLogEvent implements Lo
             return null;
         }
         if (location == null) {
-            StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
+            final StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
             boolean next = false;
-            for (StackTraceElement element : stackTrace) {
-                String className = element.getClassName();
+            for (final StackTraceElement element : stackTrace) {
+                final String className = element.getClassName();
                 if (next) {
                     if (fqcnOfLogger.equals(className)) {
                         continue;
@@ -254,30 +254,30 @@ public class Log4jLogEvent implements Lo
         return new LogEventProxy(this);
     }
 
-    public static Serializable serialize(Log4jLogEvent event) {
+    public static Serializable serialize(final Log4jLogEvent event) {
         return new LogEventProxy(event);
     }
 
-    public static Log4jLogEvent deserialize(Serializable event) {
+    public static Log4jLogEvent deserialize(final Serializable event) {
         if (event == null) {
             throw new NullPointerException("Event cannot be null");
         }
         if (event instanceof LogEventProxy) {
-            LogEventProxy proxy = (LogEventProxy) event;
+            final LogEventProxy proxy = (LogEventProxy) event;
             return new Log4jLogEvent(proxy.name, proxy.marker, proxy.fqcnOfLogger, proxy.level, proxy.message,
                 proxy.throwable, proxy.mdc, proxy.ndc, proxy.threadName, proxy.location, proxy.timestamp);
         }
         throw new IllegalArgumentException("Event is not a serialized LogEvent: " + event.toString());
     }
 
-    private void readObject(ObjectInputStream stream) throws InvalidObjectException {
+    private void readObject(final ObjectInputStream stream) throws InvalidObjectException {
         throw new InvalidObjectException("Proxy required");
     }
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
-        String n = name.length() == 0 ? "root" : name;
+        final StringBuilder sb = new StringBuilder();
+        final String n = name.length() == 0 ? "root" : name;
         sb.append("Logger=").append(n);
         sb.append(" Level=").append(level.name());
         sb.append(" Message=").append(message.getFormattedMessage());
@@ -298,11 +298,11 @@ public class Log4jLogEvent implements Lo
         private final long timestamp;
         private final Throwable throwable;
         private final Map<String, String> mdc;
-        private ThreadContext.ContextStack ndc;
-        private String threadName;
-        private StackTraceElement location;
+        private final ThreadContext.ContextStack ndc;
+        private final String threadName;
+        private final StackTraceElement location;
 
-        public LogEventProxy(Log4jLogEvent event) {
+        public LogEventProxy(final Log4jLogEvent event) {
             this.fqcnOfLogger = event.fqcnOfLogger;
             this.marker = event.marker;
             this.level = event.level;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/StackTracePackageElement.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/StackTracePackageElement.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/StackTracePackageElement.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/StackTracePackageElement.java Mon Dec 10 19:36:06 2012
@@ -37,7 +37,7 @@ public class StackTracePackageElement im
      * @param version The version of the component.
      * @param exact if true this is an exact package element.
      */
-    public StackTracePackageElement(String location, String version, boolean exact) {
+    public StackTracePackageElement(final String location, final String version, final boolean exact) {
         this.location = location;
         this.version = version;
         this.isExact = exact;
@@ -69,7 +69,7 @@ public class StackTracePackageElement im
 
     @Override
     public String toString() {
-        String exact = isExact ? "" : "~";
+        final String exact = isExact ? "" : "~";
         return exact + "[" + location + ":" + version + "]";
     }
 }

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=1419697&r1=1419696&r2=1419697&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 Mon Dec 10 19:36:06 2012
@@ -63,10 +63,10 @@ public class ThrowableProxy extends Thro
      * Construct the wrapper for the Throwable that includes packaging data.
      * @param throwable The Throwable to wrap.
      */
-    public ThrowableProxy(Throwable throwable) {
+    public ThrowableProxy(final Throwable throwable) {
         this.throwable = throwable;
-        Map<String, CacheEntry> map = new HashMap<String, CacheEntry>();
-        Stack<Class<?>> stack = getCurrentStack();
+        final Map<String, CacheEntry> map = new HashMap<String, CacheEntry>();
+        final Stack<Class<?>> stack = getCurrentStack();
         callerPackageData = resolvePackageData(stack, map, null, throwable.getStackTrace());
         this.cause = (throwable.getCause() == null) ? null :
             new ThrowableProxy(throwable, stack, map, throwable.getCause());
@@ -81,7 +81,7 @@ public class ThrowableProxy extends Thro
      * @param map The cache containing the packaging data.
      * @param cause The Throwable to wrap.
      */
-    private ThrowableProxy(Throwable parent, Stack<Class<?>> stack, Map<String, CacheEntry> map, Throwable cause) {
+    private ThrowableProxy(final Throwable parent, final Stack<Class<?>> stack, final Map<String, CacheEntry> map, final Throwable cause) {
         this.throwable = cause;
         callerPackageData = resolvePackageData(stack, map, parent.getStackTrace(), cause.getStackTrace());
         this.cause = (throwable.getCause() == null) ? null :
@@ -91,7 +91,7 @@ public class ThrowableProxy extends Thro
 
 
     @Override
-    public void setStackTrace(StackTraceElement[] stackTraceElements) {
+    public void setStackTrace(final StackTraceElement[] stackTraceElements) {
         throw new UnsupportedOperationException("Cannot set the stack trace on a ThrowableProxy");
     }
 
@@ -111,7 +111,7 @@ public class ThrowableProxy extends Thro
     }
 
     @Override
-    public Throwable initCause(Throwable throwable) {
+    public Throwable initCause(final Throwable throwable) {
         throw new IllegalStateException("Cannot set the cause on a ThrowableProxy");
     }
 
@@ -126,12 +126,12 @@ public class ThrowableProxy extends Thro
     }
 
     @Override
-    public void printStackTrace(PrintStream printStream) {
+    public void printStackTrace(final PrintStream printStream) {
         throwable.printStackTrace(printStream);
     }
 
     @Override
-    public void printStackTrace(PrintWriter printWriter) {
+    public void printStackTrace(final PrintWriter printWriter) {
         throwable.printStackTrace(printWriter);
     }
 
@@ -158,8 +158,8 @@ public class ThrowableProxy extends Thro
      * @param packages The List of packages to be suppressed from the trace.
      * @return The formatted Throwable that caused this Throwable.
      */
-    public String getRootCauseStackTrace(List<String> packages) {
-        StringBuilder sb = new StringBuilder();
+    public String getRootCauseStackTrace(final List<String> packages) {
+        final StringBuilder sb = new StringBuilder();
         if (cause != null) {
             formatWrapper(sb, cause);
             sb.append("Wrapped by: ");
@@ -175,7 +175,7 @@ public class ThrowableProxy extends Thro
      * @param sb StringBuilder to contain the formatted Throwable.
      * @param cause The Throwable to format.
      */
-    public void formatWrapper(StringBuilder sb, ThrowableProxy cause) {
+    public void formatWrapper(final StringBuilder sb, final ThrowableProxy cause) {
         formatWrapper(sb, cause, null);
     }
 
@@ -185,8 +185,8 @@ public class ThrowableProxy extends Thro
      * @param cause The Throwable to format.
      * @param packages The List of packages to be suppressed from the trace.
      */
-    public void formatWrapper(StringBuilder sb, ThrowableProxy cause, List<String> packages) {
-        Throwable caused = cause.getCause();
+    public void formatWrapper(final StringBuilder sb, final ThrowableProxy cause, final List<String> packages) {
+        final Throwable caused = cause.getCause();
         if (caused != null) {
             formatWrapper(sb, cause.cause);
             sb.append("Wrapped by: ");
@@ -208,8 +208,8 @@ public class ThrowableProxy extends Thro
      * @param packages List of packages to be suppressed from the trace.
      * @return The formatted stack trace including packaging information.
      */
-    public String getExtendedStackTrace(List<String> packages) {
-        StringBuilder sb = new StringBuilder(throwable.toString());
+    public String getExtendedStackTrace(final List<String> packages) {
+        final StringBuilder sb = new StringBuilder(throwable.toString());
         sb.append("\n");
         formatElements(sb, 0, throwable.getStackTrace(), callerPackageData, packages);
         if (cause != null) {
@@ -223,18 +223,18 @@ public class ThrowableProxy extends Thro
      * @return The formatted suppressed Throwables.
      */
     public String getSuppressedStackTrace() {
-        ThrowableProxy[] suppressed = getSuppressedProxies();
+        final ThrowableProxy[] suppressed = getSuppressedProxies();
         if (suppressed == null || suppressed.length == 0) {
             return "";
         }
-        StringBuilder sb = new StringBuilder("Suppressed Stack Trace Elements:\n");
-        for (ThrowableProxy proxy : suppressed) {
+        final StringBuilder sb = new StringBuilder("Suppressed Stack Trace Elements:\n");
+        for (final ThrowableProxy proxy : suppressed) {
             sb.append(proxy.getExtendedStackTrace());
         }
         return sb.toString();
     }
 
-    private void formatCause(StringBuilder sb, ThrowableProxy cause, List<String> packages) {
+    private void formatCause(final StringBuilder sb, final ThrowableProxy cause, final List<String> packages) {
         sb.append("Caused by: ").append(cause).append("\n");
         formatElements(sb, cause.commonElementCount, cause.getStackTrace(), cause.callerPackageData, packages);
         if (cause.getCause() != null) {
@@ -242,8 +242,8 @@ public class ThrowableProxy extends Thro
         }
     }
 
-    private void formatElements(StringBuilder sb, int commonCount, StackTraceElement[] causedTrace,
-                                StackTracePackageElement[] packageData, List<String> packages) {
+    private void formatElements(final StringBuilder sb, final int commonCount, final StackTraceElement[] causedTrace,
+                                final StackTracePackageElement[] packageData, final List<String> packages) {
         if (packages == null || packages.size() == 0) {
             for (int i = 0; i < packageData.length; ++i) {
                 formatEntry(causedTrace[i], packageData[i], sb);
@@ -278,7 +278,7 @@ public class ThrowableProxy extends Thro
         }
     }
 
-    private void formatEntry(StackTraceElement element, StackTracePackageElement packageData, StringBuilder sb) {
+    private void formatEntry(final StackTraceElement element, final StackTracePackageElement packageData, final StringBuilder sb) {
         sb.append("\tat ");
         sb.append(element);
         sb.append(" ");
@@ -286,9 +286,9 @@ public class ThrowableProxy extends Thro
         sb.append("\n");
     }
 
-    private boolean isSuppressed(StackTraceElement element, List<String> packages) {
-        String className = element.getClassName();
-        for (String pkg : packages) {
+    private boolean isSuppressed(final StackTraceElement element, final List<String> packages) {
+        final String className = element.getClassName();
+        for (final String pkg : packages) {
             if (className.startsWith(pkg)) {
                 return true;
             }
@@ -304,7 +304,7 @@ public class ThrowableProxy extends Thro
      */
     private Stack<Class<?>> getCurrentStack() {
         if (getCallerClass != null) {
-            Stack<Class<?>> classes = new Stack<Class<?>>();
+            final Stack<Class<?>> classes = new Stack<Class<?>>();
             int index = 2;
             Class<?> clazz = getCallerClass(index);
             while (clazz != null) {
@@ -313,9 +313,9 @@ public class ThrowableProxy extends Thro
             }
             return classes;
         } else if (securityManager != null) {
-            Class<?>[] array = securityManager.getClasses();
-            Stack<Class<?>> classes = new Stack<Class<?>>();
-            for (Class<?> clazz : array) {
+            final Class<?>[] array = securityManager.getClasses();
+            final Stack<Class<?>> classes = new Stack<Class<?>>();
+            for (final Class<?> clazz : array) {
                 classes.push(clazz);
             }
             return classes;
@@ -331,9 +331,9 @@ public class ThrowableProxy extends Thro
      * @param stackTrace The stack trace being resolved.
      * @return The StackTracePackageElement array.
      */
-    private StackTracePackageElement[] resolvePackageData(Stack<Class<?>> stack, Map<String, CacheEntry> map,
-                                                          StackTraceElement[] rootTrace,
-                                                          StackTraceElement[] stackTrace) {
+    private StackTracePackageElement[] resolvePackageData(final Stack<Class<?>> stack, final Map<String, CacheEntry> map,
+                                                          final StackTraceElement[] rootTrace,
+                                                          final StackTraceElement[] stackTrace) {
         int stackLength;
         if (rootTrace != null) {
             int rootIndex = rootTrace.length - 1;
@@ -348,29 +348,29 @@ public class ThrowableProxy extends Thro
             commonElementCount = 0;
             stackLength = stackTrace.length;
         }
-        StackTracePackageElement[] packageArray = new StackTracePackageElement[stackLength];
+        final StackTracePackageElement[] packageArray = new StackTracePackageElement[stackLength];
         Class<?> clazz = stack.peek();
         ClassLoader lastLoader = null;
         for (int i = stackLength - 1; i >= 0; --i) {
-            String className = stackTrace[i].getClassName();
+            final String className = stackTrace[i].getClassName();
             // The stack returned from getCurrentStack will be missing entries for  java.lang.reflect.Method.invoke()
             // and its implementation. The Throwable might also contain stack entries that are no longer
             // present as those methods have returned.
             if (className.equals(clazz.getName())) {
-                CacheEntry entry = resolvePackageElement(clazz, true);
+                final CacheEntry entry = resolvePackageElement(clazz, true);
                 packageArray[i] = entry.element;
                 lastLoader = entry.loader;
                 stack.pop();
                 clazz = stack.peek();
             } else {
                 if (map.containsKey(className)) {
-                    CacheEntry entry = map.get(className);
+                    final CacheEntry entry = map.get(className);
                     packageArray[i] = entry.element;
                     if (entry.loader != null) {
                         lastLoader = entry.loader;
                     }
                 } else {
-                    CacheEntry entry = resolvePackageElement(loadClass(lastLoader, className), false);
+                    final CacheEntry entry = resolvePackageElement(loadClass(lastLoader, className), false);
                     packageArray[i] = entry.element;
                     map.put(className, entry);
                     if (entry.loader != null) {
@@ -389,17 +389,17 @@ public class ThrowableProxy extends Thro
      * @param exact True if the class was obtained via Reflection.getCallerClass.
      * @return The CacheEntry.
      */
-    private CacheEntry resolvePackageElement(Class<?> callerClass, boolean exact) {
+    private CacheEntry resolvePackageElement(final Class<?> callerClass, final boolean exact) {
         String location = "?";
         String version = "?";
         ClassLoader lastLoader = null;
         if (callerClass != null) {
             try {
-                CodeSource source = callerClass.getProtectionDomain().getCodeSource();
+                final CodeSource source = callerClass.getProtectionDomain().getCodeSource();
                 if (source != null) {
-                    URL locationURL = source.getLocation();
+                    final URL locationURL = source.getLocation();
                     if (locationURL != null) {
-                        String str = locationURL.toString().replace('\\', '/');
+                        final String str = locationURL.toString().replace('\\', '/');
                         int index = str.lastIndexOf("/");
                         if (index >= 0 && index == str.length() - 1) {
                             index = str.lastIndexOf("/", index - 1);
@@ -409,12 +409,12 @@ public class ThrowableProxy extends Thro
                         }
                     }
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 // Ignore the exception.
             }
-            Package pkg = callerClass.getPackage();
+            final Package pkg = callerClass.getPackage();
             if (pkg != null) {
-                String ver = pkg.getImplementationVersion();
+                final String ver = pkg.getImplementationVersion();
                 if (ver != null) {
                     version = ver;
                 }
@@ -431,12 +431,12 @@ public class ThrowableProxy extends Thro
      * @param index The index into the stack trace.
      * @return The Class at the specified stack entry.
      */
-    private Class<?> getCallerClass(int index) {
+    private Class<?> getCallerClass(final int index) {
         if (getCallerClass != null) {
             try {
-                Object[] params = new Object[]{index};
+                final Object[] params = new Object[]{index};
                 return (Class<?>) getCallerClass.invoke(null, params);
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 // logger.debug("Unable to determine caller class via Sun Reflection", ex);
             }
         }
@@ -449,7 +449,7 @@ public class ThrowableProxy extends Thro
      * @param className The name of the Class.
      * @return The Class object for the Class or null if it could not be located.
      */
-    private Class<?> loadClass(ClassLoader lastLoader, String className) {
+    private Class<?> loadClass(final ClassLoader lastLoader, final String className) {
         Class<?> clazz;
         if (lastLoader != null) {
             try {
@@ -457,19 +457,19 @@ public class ThrowableProxy extends Thro
                 if (clazz != null) {
                     return clazz;
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 // Ignore exception.
             }
         }
         try {
             clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
-        } catch (ClassNotFoundException e) {
+        } catch (final ClassNotFoundException e) {
             try {
                 clazz = Class.forName(className);
-            } catch (ClassNotFoundException e1) {
+            } catch (final ClassNotFoundException e1) {
                 try {
                     clazz = getClass().getClassLoader().loadClass(className);
-                } catch (ClassNotFoundException e2) {
+                } catch (final ClassNotFoundException e2) {
                     return null;
                 }
             }
@@ -478,8 +478,8 @@ public class ThrowableProxy extends Thro
     }
 
     private static void versionCheck() {
-        Method[] methods = Throwable.class.getMethods();
-        for (Method method : methods) {
+        final Method[] methods = Throwable.class.getMethods();
+        for (final Method method : methods) {
             if (method.getName().equals("getSuppressed")) {
                 getSuppressed = method;
             } else if (method.getName().equals("addSuppressed")) {
@@ -493,30 +493,30 @@ public class ThrowableProxy extends Thro
      */
     private static void setupCallerCheck() {
         try {
-            ClassLoader loader = Loader.getClassLoader();
+            final ClassLoader loader = Loader.getClassLoader();
             // Use wildcard to avoid compile-time reference.
-            Class<?> clazz = loader.loadClass("sun.reflect.Reflection");
-            Method[] methods = clazz.getMethods();
-            for (Method method : methods) {
-                int modifier = method.getModifiers();
+            final Class<?> clazz = loader.loadClass("sun.reflect.Reflection");
+            final Method[] methods = clazz.getMethods();
+            for (final Method method : methods) {
+                final int modifier = method.getModifiers();
                 if (method.getName().equals("getCallerClass") && Modifier.isStatic(modifier)) {
                     getCallerClass = method;
                     return;
                 }
             }
-        } catch (ClassNotFoundException cnfe) {
+        } catch (final ClassNotFoundException cnfe) {
             LOGGER.debug("sun.reflect.Reflection is not installed");
         }
 
         try {
-            PrivateSecurityManager mgr = new PrivateSecurityManager();
+            final PrivateSecurityManager mgr = new PrivateSecurityManager();
             if (mgr.getClasses() != null) {
                 securityManager = mgr;
             } else {
                 // This shouldn't happen.
                 LOGGER.error("Unable to obtain call stack from security manager");
             }
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             LOGGER.debug("Unable to install security manager", ex);
         }
     }
@@ -525,21 +525,21 @@ public class ThrowableProxy extends Thro
         if (getSuppressed != null) {
             try {
                 return (ThrowableProxy[]) getSuppressed.invoke(this, null);
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 return null;
             }
         }
         return null;
     }
 
-    private void setSuppressed(Throwable throwable) {
+    private void setSuppressed(final Throwable throwable) {
         if (getSuppressed != null && addSuppressed != null) {
             try {
-                Throwable[] array = (Throwable[]) getSuppressed.invoke(throwable, null);
-                for (Throwable t : array) {
+                final Throwable[] array = (Throwable[]) getSuppressed.invoke(throwable, null);
+                for (final Throwable t : array) {
                     addSuppressed.invoke(this, new ThrowableProxy(t));
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 //
             }
         }
@@ -552,7 +552,7 @@ public class ThrowableProxy extends Thro
         private final StackTracePackageElement element;
         private final ClassLoader loader;
 
-        public CacheEntry(StackTracePackageElement element, ClassLoader loader) {
+        public CacheEntry(final StackTracePackageElement element, final ClassLoader loader) {
             this.element = element;
             this.loader = loader;
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Log4jManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Log4jManager.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Log4jManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Log4jManager.java Mon Dec 10 19:36:06 2012
@@ -33,8 +33,8 @@ public class Log4jManager {
     private static final StatusLogger LOGGER = StatusLogger.getLogger();
 
     public List<LoggerContext> getLoggerContexts() {
-        Log4jContextFactory factory = (Log4jContextFactory) LogManager.getFactory();
-        ContextSelector selector = factory.getSelector();
+        final Log4jContextFactory factory = (Log4jContextFactory) LogManager.getFactory();
+        final ContextSelector selector = factory.getSelector();
         return selector.getLoggerContexts();
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/AbstractLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/AbstractLayout.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/AbstractLayout.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/AbstractLayout.java Mon Dec 10 19:36:06 2012
@@ -52,7 +52,7 @@ public abstract class AbstractLayout<T e
      * Set the header.
      * @param header The header.
      */
-    public void setHeader(byte[] header) {
+    public void setHeader(final byte[] header) {
         this.header = header;
     }
 
@@ -68,7 +68,7 @@ public abstract class AbstractLayout<T e
      * Set the footer.
      * @param footer The footer.
      */
-    public void setFooter(byte[] footer) {
+    public void setFooter(final byte[] footer) {
         this.footer = footer;
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/AbstractStringLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/AbstractStringLayout.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/AbstractStringLayout.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/AbstractStringLayout.java Mon Dec 10 19:36:06 2012
@@ -33,14 +33,14 @@ public abstract class AbstractStringLayo
 
     private final StringEncoder encoder;
 
-    protected AbstractStringLayout(Charset charset) {
+    protected AbstractStringLayout(final Charset charset) {
         this.charset = charset;
         boolean useClass = false;
         try {
             if (String.class.getMethod("getBytes", new Class[] {Charset.class}) != null) {
                 useClass = true;
             }
-        } catch (NoSuchMethodException ex) {
+        } catch (final NoSuchMethodException ex) {
             // Not JDK 6 or greater.
         }
         encoder = useClass ? new ClassEncoder() : new NameEncoder();
@@ -52,7 +52,7 @@ public abstract class AbstractStringLayo
      * @param event The Log Event.
      * @return The formatted event as a byte array.
      */
-    public byte[] toByteArray(LogEvent event) {
+    public byte[] toByteArray(final LogEvent event) {
         return encoder.getBytes(toSerializable(event));
     }
 
@@ -72,7 +72,7 @@ public abstract class AbstractStringLayo
      * JDK 6 or greater.
      */
     private class ClassEncoder implements StringEncoder {
-        public byte[] getBytes(String str) {
+        public byte[] getBytes(final String str) {
             return str.getBytes(charset);
         }
     }
@@ -81,10 +81,10 @@ public abstract class AbstractStringLayo
      * JDK 5.
      */
     private class NameEncoder implements StringEncoder {
-        public byte[] getBytes(String str) {
+        public byte[] getBytes(final String str) {
             try {
                 return str.getBytes(charset.name());
-            } catch (UnsupportedEncodingException ex) {
+            } catch (final UnsupportedEncodingException ex) {
                 // This shouldn't ever happen since an invalid Charset would never have been created.
                 return str.getBytes();
             }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java Mon Dec 10 19:36:06 2012
@@ -69,7 +69,7 @@ public final class HTMLLayout extends Ab
 
         private final String size;
 
-        private FontSize(String size) {
+        private FontSize(final String size) {
             this.size = size;
         }
 
@@ -77,8 +77,8 @@ public final class HTMLLayout extends Ab
             return size;
         }
 
-        public static FontSize getFontSize(String size) {
-            for (FontSize fontSize : values()) {
+        public static FontSize getFontSize(final String size) {
+            for (final FontSize fontSize : values()) {
                 if (fontSize.size.equals(size)) {
                     return fontSize;
                 }
@@ -95,8 +95,8 @@ public final class HTMLLayout extends Ab
     private final String fontSize;
     private final String headerSize;
 
-    private HTMLLayout(boolean locationInfo, String title, String contentType, Charset charset,
-                       String font, String fontSize, String headerSize) {
+    private HTMLLayout(final boolean locationInfo, final String title, final String contentType, final Charset charset,
+                       final String font, final String fontSize, final String headerSize) {
         super(charset);
         this.locationInfo = locationInfo;
         this.title = title;
@@ -112,8 +112,8 @@ public final class HTMLLayout extends Ab
      * @param event The Logging Event.
      * @return A String containging the LogEvent as HTML.
      */
-    public String toSerializable(LogEvent event) {
-        StringBuilder sbuf = new StringBuilder(BUF_SIZE);
+    public String toSerializable(final LogEvent event) {
+        final StringBuilder sbuf = new StringBuilder(BUF_SIZE);
 
         sbuf.append(LINE_SEP).append("<tr>").append(LINE_SEP);
 
@@ -121,7 +121,7 @@ public final class HTMLLayout extends Ab
         sbuf.append(event.getMillis() - jvmStartTime);
         sbuf.append("</td>").append(LINE_SEP);
 
-        String escapedThread = Transform.escapeTags(event.getThreadName());
+        final String escapedThread = Transform.escapeTags(event.getThreadName());
         sbuf.append("<td title=\"").append(escapedThread).append(" thread\">");
         sbuf.append(escapedThread);
         sbuf.append("</td>").append(LINE_SEP);
@@ -149,7 +149,7 @@ public final class HTMLLayout extends Ab
         sbuf.append("</td>").append(LINE_SEP);
 
         if (locationInfo) {
-            StackTraceElement element = event.getSource();
+            final StackTraceElement element = event.getSource();
             sbuf.append("<td>");
             sbuf.append(Transform.escapeTags(element.getFileName()));
             sbuf.append(':');
@@ -178,7 +178,7 @@ public final class HTMLLayout extends Ab
             sbuf.append("</td></tr>").append(LINE_SEP);
         }
 
-        Throwable throwable = event.getThrown();
+        final Throwable throwable = event.getThrown();
         if (throwable != null) {
             sbuf.append("<tr><td bgcolor=\"#993300\" style=\"color:White; font-size : ").append(fontSize);
             sbuf.append(";\" colspan=\"6\">");
@@ -189,31 +189,31 @@ public final class HTMLLayout extends Ab
         return sbuf.toString();
     }
 
-    private void appendThrowableAsHTML(Throwable throwable, StringBuilder sbuf) {
-        StringWriter sw = new StringWriter();
-        PrintWriter pw = new PrintWriter(sw);
+    private void appendThrowableAsHTML(final Throwable throwable, final StringBuilder sbuf) {
+        final StringWriter sw = new StringWriter();
+        final PrintWriter pw = new PrintWriter(sw);
         try {
             throwable.printStackTrace(pw);
-        } catch (RuntimeException ex) {
+        } catch (final RuntimeException ex) {
             // Ignore the exception.
         }
         pw.flush();
-        LineNumberReader reader = new LineNumberReader(new StringReader(sw.toString()));
-        ArrayList<String> lines = new ArrayList<String>();
+        final LineNumberReader reader = new LineNumberReader(new StringReader(sw.toString()));
+        final ArrayList<String> lines = new ArrayList<String>();
         try {
           String line = reader.readLine();
           while (line != null) {
             lines.add(line);
             line = reader.readLine();
           }
-        } catch (IOException ex) {
+        } catch (final IOException ex) {
             if (ex instanceof InterruptedIOException) {
                 Thread.currentThread().interrupt();
             }
             lines.add(ex.toString());
         }
         boolean first = true;
-        for (String line : lines) {
+        for (final String line : lines) {
             if (!first) {
                 sbuf.append(TRACE_PREFIX);
             } else {
@@ -230,7 +230,7 @@ public final class HTMLLayout extends Ab
      */
     @Override
     public byte[] getHeader() {
-        StringBuilder sbuf = new StringBuilder();
+        final StringBuilder sbuf = new StringBuilder();
         sbuf.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" ");
         sbuf.append("\"http://www.w3.org/TR/html4/loose.dtd\">");
         sbuf.append(LINE_SEP);
@@ -271,7 +271,7 @@ public final class HTMLLayout extends Ab
      */
     @Override
     public byte[] getFooter() {
-        StringBuilder sbuf = new StringBuilder();
+        final StringBuilder sbuf = new StringBuilder();
         sbuf.append("</table>").append(LINE_SEP);
         sbuf.append("<br>").append(LINE_SEP);
         sbuf.append("</body></html>");
@@ -287,10 +287,10 @@ public final class HTMLLayout extends Ab
      * @return An HTML Layout.
      */
     @PluginFactory
-    public static HTMLLayout createLayout(@PluginAttr("locationInfo") String locationInfo,
+    public static HTMLLayout createLayout(@PluginAttr("locationInfo") final String locationInfo,
                                           @PluginAttr("title") String title,
                                           @PluginAttr("contentType") String contentType,
-                                          @PluginAttr("charset") String charset,
+                                          @PluginAttr("charset") final String charset,
                                           @PluginAttr("fontSize") String fontSize,
                                           @PluginAttr("fontName") String font) {
         Charset c = Charset.isSupported("UTF-8") ? Charset.forName("UTF-8") : Charset.defaultCharset();
@@ -304,10 +304,10 @@ public final class HTMLLayout extends Ab
         if (font == null) {
             font = "arial,sans-serif";
         }
-        FontSize fs = FontSize.getFontSize(fontSize);
+        final FontSize fs = FontSize.getFontSize(fontSize);
         fontSize = fs.getFontSize();
-        String headerSize = fs.larger().getFontSize();
-        boolean info = locationInfo == null ? false : Boolean.valueOf(locationInfo);
+        final String headerSize = fs.larger().getFontSize();
+        final boolean info = locationInfo == null ? false : Boolean.valueOf(locationInfo);
         if (title == null) {
             title = DEFAULT_TITLE;
         }



Mime
View raw message