logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1419697 [11/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/pattern/LevelPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -38,7 +38,7 @@ public final class LevelPatternConverter
     /**
      * Private constructor.
      */
-    private LevelPatternConverter(EnumMap<Level, String> map) {
+    private LevelPatternConverter(final EnumMap<Level, String> map) {
         super("Level", "level");
         this.levelMap = map;
     }
@@ -54,15 +54,15 @@ public final class LevelPatternConverter
         if (options == null || options.length == 0) {
             return INSTANCE;
         }
-        EnumMap<Level, String> levelMap = new EnumMap<Level, String>(Level.class);
-        String[] definitions = options[0].split(",");
-        for (String def : definitions) {
-            String[] pair = def.split("=");
+        final EnumMap<Level, String> levelMap = new EnumMap<Level, String>(Level.class);
+        final String[] definitions = options[0].split(",");
+        for (final String def : definitions) {
+            final String[] pair = def.split("=");
             if (pair == null || pair.length != 2) {
                 LOGGER.error("Invalid option {}", def);
                 continue;
             }
-            Level level = Level.toLevel(pair[0].trim(), null);
+            final Level level = Level.toLevel(pair[0].trim(), null);
             if (level == null) {
                 LOGGER.error("Invalid Level {}", pair[0].trim());
             }
@@ -71,7 +71,7 @@ public final class LevelPatternConverter
         if (levelMap.size() == 0) {
             return INSTANCE;
         }
-        for (Level level : Level.values()) {
+        for (final Level level : Level.values()) {
             if (!levelMap.containsKey(level)) {
                 levelMap.put(level, level.toString());
             }
@@ -91,9 +91,9 @@ public final class LevelPatternConverter
      * {@inheritDoc}
      */
     @Override
-    public String getStyleClass(Object e) {
+    public String getStyleClass(final Object e) {
         if (e instanceof LogEvent) {
-            Level level = ((LogEvent) e).getLevel();
+            final Level level = ((LogEvent) e).getLevel();
 
             switch (level) {
                 case TRACE:

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LineLocationPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LineLocationPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LineLocationPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LineLocationPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -54,7 +54,7 @@ public final class LineLocationPatternCo
      */
     @Override
     public void format(final LogEvent event, final StringBuilder output) {
-        StackTraceElement element = event.getSource();
+        final StackTraceElement element = event.getSource();
 
         if (element != null) {
             output.append(element.getLineNumber());

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LineSeparatorPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LineSeparatorPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LineSeparatorPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LineSeparatorPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -59,7 +59,7 @@ public final class LineSeparatorPatternC
    * {@inheritDoc}
    */
   @Override
-public void format(LogEvent event, final StringBuilder toAppendTo) {
+public void format(final LogEvent event, final StringBuilder toAppendTo) {
     toAppendTo.append(lineSep);
   }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/LiteralPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -64,7 +64,7 @@ public final class LiteralPatternConvert
     /**
      * {@inheritDoc}
      */
-    public void format(final StringBuilder output, Object... objects) {
+    public void format(final StringBuilder output, final Object... objects) {
         output.append(substitute ? config.getSubst().replace(literal) : literal);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MDCPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MDCPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MDCPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MDCPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -63,7 +63,7 @@ public final class MDCPatternConverter e
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        Map<String, String> contextMap = event.getContextMap();
+        final Map<String, String> contextMap = event.getContextMap();
         // if there is no additional options, we output every single
         // Key/Value pair for the MDC in a similar format to Hashtable.toString()
         if (key == null) {
@@ -73,9 +73,9 @@ public final class MDCPatternConverter e
                 toAppendTo.append("{}");
                 return;
             }
-            StringBuilder sb = new StringBuilder("{");
-            Set<String> keys = new TreeSet<String>(contextMap.keySet());
-            for (String key : keys) {
+            final StringBuilder sb = new StringBuilder("{");
+            final Set<String> keys = new TreeSet<String>(contextMap.keySet());
+            for (final String key : keys) {
                 if (sb.length() > 1) {
                     sb.append(", ");
                 }
@@ -86,7 +86,7 @@ public final class MDCPatternConverter e
             toAppendTo.append(sb);
         } else if (contextMap != null) {
             // otherwise they just want a single key output
-            Object val = contextMap.get(key);
+            final Object val = contextMap.get(key);
 
             if (val != null) {
                 toAppendTo.append(val);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MapPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MapPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MapPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MapPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -69,7 +69,7 @@ public final class MapPatternConverter e
         } else {
             return;
         }
-        Map<String, String> map = msg.getData();
+        final Map<String, String> map = msg.getData();
         // if there is no additional options, we output every single
         // Key/Value pair for the Map in a similar format to Hashtable.toString()
         if (key == null) {
@@ -77,9 +77,9 @@ public final class MapPatternConverter e
                 toAppendTo.append("{}");
                 return;
             }
-            StringBuilder sb = new StringBuilder("{");
-            Set<String> keys = new TreeSet<String>(map.keySet());
-            for (String key : keys) {
+            final StringBuilder sb = new StringBuilder("{");
+            final Set<String> keys = new TreeSet<String>(map.keySet());
+            for (final String key : keys) {
                 if (sb.length() > 1) {
                     sb.append(", ");
                 }
@@ -90,7 +90,7 @@ public final class MapPatternConverter e
             toAppendTo.append(sb);
         } else {
             // otherwise they just want a single key output
-            String val = map.get(key);
+            final String val = map.get(key);
 
             if (val != null) {
                 toAppendTo.append(val);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MarkerPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MarkerPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MarkerPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MarkerPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -50,7 +50,7 @@ public final class MarkerPatternConverte
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        Marker marker = event.getMarker();
+        final Marker marker = event.getMarker();
         if (marker != null) {
             toAppendTo.append(marker.toString());
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MessagePatternConverter.java Mon Dec 10 19:36:06 2012
@@ -59,7 +59,7 @@ public final class MessagePatternConvert
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        Message msg = event.getMessage();
+        final Message msg = event.getMessage();
         if (msg != null) {
             String result;
             if (msg instanceof MultiformatMessage) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MethodLocationPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MethodLocationPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MethodLocationPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/MethodLocationPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -54,7 +54,7 @@ public final class MethodLocationPattern
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        StackTraceElement element = event.getSource();
+        final StackTraceElement element = event.getSource();
 
         if (element != null) {
             toAppendTo.append(element.getMethodName());

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/NameAbbreviator.java Mon Dec 10 19:36:06 2012
@@ -44,7 +44,7 @@ public abstract class NameAbbreviator {
         if (pattern.length() > 0) {
             //  if pattern is just spaces and numbers then
             //     use MaxElementAbbreviator
-            String trimmed = pattern.trim();
+            final String trimmed = pattern.trim();
 
             if (trimmed.length() == 0) {
                 return DEFAULT;
@@ -64,7 +64,7 @@ public abstract class NameAbbreviator {
                 return new MaxElementAbbreviator(Integer.parseInt(trimmed));
             }
 
-            ArrayList<PatternAbbreviatorFragment> fragments = new ArrayList<PatternAbbreviatorFragment>(5);
+            final ArrayList<PatternAbbreviatorFragment> fragments = new ArrayList<PatternAbbreviatorFragment>(5);
             char ellipsis;
             int charCount;
             int pos = 0;
@@ -262,7 +262,7 @@ public abstract class NameAbbreviator {
          *
          * @param fragments element abbreviation patterns.
          */
-        public PatternAbbreviator(List<PatternAbbreviatorFragment> fragments) {
+        public PatternAbbreviator(final List<PatternAbbreviatorFragment> fragments) {
             if (fragments.size() == 0) {
                 throw new IllegalArgumentException(
                     "fragments must have at least one element");
@@ -283,7 +283,7 @@ public abstract class NameAbbreviator {
             //  all non-terminal patterns are executed once
             //
             int pos = 0;
-            StringBuilder sb = new StringBuilder(buf);
+            final StringBuilder sb = new StringBuilder(buf);
 
             for (int i = 0; (i < (fragments.length - 1)) && (pos < buf.length());
                  i++) {
@@ -293,7 +293,7 @@ public abstract class NameAbbreviator {
             //
             //   last pattern in executed repeatedly
             //
-            PatternAbbreviatorFragment terminalFragment = fragments[fragments.length - 1];
+            final PatternAbbreviatorFragment terminalFragment = fragments[fragments.length - 1];
 
             while ((pos < buf.length()) && (pos >= 0)) {
                 pos = terminalFragment.abbreviate(sb, pos);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternFormatter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternFormatter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternFormatter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternFormatter.java Mon Dec 10 19:36:06 2012
@@ -26,13 +26,13 @@ public class PatternFormatter {
     private final LogEventPatternConverter converter;
     private final FormattingInfo field;
 
-    public PatternFormatter(LogEventPatternConverter converter, FormattingInfo field) {
+    public PatternFormatter(final LogEventPatternConverter converter, final FormattingInfo field) {
         this.converter = converter;
         this.field = field;
     }
 
-    public void format(LogEvent event, StringBuilder buf) {
-        int startField = buf.length();
+    public void format(final LogEvent event, final StringBuilder buf) {
+        final int startField = buf.length();
         converter.format(event, buf);
         field.format(startField, buf);
     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java Mon Dec 10 19:36:06 2012
@@ -92,7 +92,7 @@ public final class PatternParser {
      * Constructor.
      * @param converterKey The type of converters that will be used.
      */
-    public PatternParser(String converterKey) {
+    public PatternParser(final String converterKey) {
         this(null, converterKey, null);
     }
 
@@ -102,23 +102,23 @@ public final class PatternParser {
      * @param converterKey The key to lookup the converters.
      * @param expected The expected base Class of each Converter.
      */
-    public PatternParser(Configuration config, String converterKey, Class<?> expected) {
+    public PatternParser(final Configuration config, final String converterKey, final Class<?> expected) {
         this.config = config;
-        PluginManager manager = new PluginManager(converterKey, expected);
+        final PluginManager manager = new PluginManager(converterKey, expected);
         manager.collectPlugins();
-        Map<String, PluginType> plugins = manager.getPlugins();
-        Map<String, Class<PatternConverter>> converters = new HashMap<String, Class<PatternConverter>>();
+        final Map<String, PluginType> plugins = manager.getPlugins();
+        final Map<String, Class<PatternConverter>> converters = new HashMap<String, Class<PatternConverter>>();
 
-        for (PluginType type : plugins.values()) {
+        for (final PluginType type : plugins.values()) {
             try {
-                Class<PatternConverter> clazz = type.getPluginClass();
-                ConverterKeys keys = clazz.getAnnotation(ConverterKeys.class);
+                final Class<PatternConverter> clazz = type.getPluginClass();
+                final ConverterKeys keys = clazz.getAnnotation(ConverterKeys.class);
                 if (keys != null) {
-                    for (String key : keys.value()) {
+                    for (final String key : keys.value()) {
                         converters.put(key, clazz);
                     }
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 LOGGER.error("Error processing plugin " + type.getElementName(), ex);
             }
         }
@@ -126,16 +126,16 @@ public final class PatternParser {
     }
 
 
-    public List<PatternFormatter> parse(String pattern) {
-        List<PatternFormatter> list = new ArrayList<PatternFormatter>();
-        List<PatternConverter> converters = new ArrayList<PatternConverter>();
-        List<FormattingInfo> fields = new ArrayList<FormattingInfo>();
+    public List<PatternFormatter> parse(final String pattern) {
+        final List<PatternFormatter> list = new ArrayList<PatternFormatter>();
+        final List<PatternConverter> converters = new ArrayList<PatternConverter>();
+        final List<FormattingInfo> fields = new ArrayList<FormattingInfo>();
 
         parse(pattern, converters, fields);
 
-        Iterator<FormattingInfo> fieldIter = fields.iterator();
+        final Iterator<FormattingInfo> fieldIter = fields.iterator();
 
-        for (PatternConverter converter : converters) {
+        for (final PatternConverter converter : converters) {
             LogEventPatternConverter pc;
             if (converter instanceof LogEventPatternConverter) {
                 pc = (LogEventPatternConverter) converter;
@@ -176,7 +176,7 @@ public final class PatternParser {
      * @return position in pattern after converter.
      */
     private static int extractConverter(
-        char lastChar, final String pattern, int i, final StringBuilder convBuf,
+        final char lastChar, final String pattern, int i, final StringBuilder convBuf,
         final StringBuilder currentLiteral) {
         convBuf.setLength(0);
 
@@ -208,15 +208,15 @@ public final class PatternParser {
      * @param options array to receive extracted options
      * @return position in pattern after options.
      */
-    private static int extractOptions(String pattern, int i, List<String> options) {
+    private static int extractOptions(final String pattern, int i, final List<String> options) {
         while ((i < pattern.length()) && (pattern.charAt(i) == '{')) {
-            int begin = i++;
+            final int begin = i++;
             int end;
             int depth = 0;
             do {
                 end = pattern.indexOf('}', i);
                 if (end != -1) {
-                    int next = pattern.indexOf("{", i);
+                    final int next = pattern.indexOf("{", i);
                     if (next != -1 && next < end) {
                         i = end + 1;
                         ++depth;
@@ -230,7 +230,7 @@ public final class PatternParser {
                 break;
             }
 
-            String r = pattern.substring(begin + 1, end);
+            final String r = pattern.substring(begin + 1, end);
             options.add(r);
             i = end + 1;
         }
@@ -251,9 +251,9 @@ public final class PatternParser {
             throw new NullPointerException("pattern");
         }
 
-        StringBuilder currentLiteral = new StringBuilder(BUF_SIZE);
+        final StringBuilder currentLiteral = new StringBuilder(BUF_SIZE);
 
-        int patternLength = pattern.length();
+        final int patternLength = pattern.length();
         ParserState state = ParserState.LITERAL_STATE;
         char c;
         int i = 0;
@@ -427,9 +427,9 @@ public final class PatternParser {
 
         // Work around the regression bug in Class.getDeclaredMethods() in Oracle Java in version > 1.6.0_17:
         // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6815786
-        Method[] methods = converterClass.getDeclaredMethods();
+        final Method[] methods = converterClass.getDeclaredMethods();
         Method newInstanceMethod = null;
-        for (Method method : methods) {
+        for (final Method method : methods) {
             if (Modifier.isStatic(method.getModifiers()) && method.getDeclaringClass().equals(converterClass) &&
                     method.getName().equals("newInstance")) {
                 if (newInstanceMethod == null) {
@@ -445,15 +445,15 @@ public final class PatternParser {
             return null;
         }
 
-        Class<?>[] parmTypes = newInstanceMethod.getParameterTypes();
-        Object [] parms = parmTypes.length > 0 ? new Object[parmTypes.length] : null;
+        final Class<?>[] parmTypes = newInstanceMethod.getParameterTypes();
+        final Object [] parms = parmTypes.length > 0 ? new Object[parmTypes.length] : null;
 
         if (parms != null) {
             int i = 0;
             boolean errors = false;
-            for (Class<?> clazz : parmTypes) {
+            for (final Class<?> clazz : parmTypes) {
                 if (clazz.isArray() && clazz.getName().equals("[Ljava.lang.String;")) {
-                    String[] optionsArray = options.toArray(new String[options.size()]);
+                    final String[] optionsArray = options.toArray(new String[options.size()]);
                     parms[i] = optionsArray;
                 } else if (clazz.isAssignableFrom(Configuration.class)) {
                     parms[i] = config;
@@ -470,7 +470,7 @@ public final class PatternParser {
         }
 
         try {
-            Object newObj = newInstanceMethod.invoke(null, parms);
+            final Object newObj = newInstanceMethod.invoke(null, parms);
 
             if (newObj instanceof PatternConverter) {
                 currentLiteral.delete(0, currentLiteral.length()
@@ -480,7 +480,7 @@ public final class PatternParser {
             } else {
                 LOGGER.warn("Class " + converterClass.getName() + " does not extend PatternConverter.");
             }
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             LOGGER.error("Error creating converter for " + converterId, ex);
         }
 
@@ -500,19 +500,19 @@ public final class PatternParser {
      * @param formattingInfos   list to receive corresponding field specifier.
      * @return position after format specifier sequence.
      */
-    private int finalizeConverter(char c, String pattern, int i,
+    private int finalizeConverter(final char c, final String pattern, int i,
             final StringBuilder currentLiteral, final FormattingInfo formattingInfo,
             final Map<String, Class<PatternConverter>> rules,
             final List<PatternConverter> patternConverters, final List<FormattingInfo> formattingInfos) {
-        StringBuilder convBuf = new StringBuilder();
+        final StringBuilder convBuf = new StringBuilder();
         i = extractConverter(c, pattern, i, convBuf, currentLiteral);
 
-        String converterId = convBuf.toString();
+        final String converterId = convBuf.toString();
 
-        List<String> options = new ArrayList<String>();
+        final List<String> options = new ArrayList<String>();
         i = extractOptions(pattern, i, options);
 
-        PatternConverter pc = createConverter(converterId, currentLiteral, rules, options);
+        final PatternConverter pc = createConverter(converterId, currentLiteral, rules, options);
 
         if (pc == null) {
             StringBuilder msg;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacement.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacement.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacement.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacement.java Mon Dec 10 19:36:06 2012
@@ -42,7 +42,7 @@ public final class RegexReplacement {
      * @param pattern The Pattern.
      * @param substitution The substitution String.
      */
-    private RegexReplacement(Pattern pattern, String substitution) {
+    private RegexReplacement(final Pattern pattern, final String substitution) {
         this.pattern = pattern;
         this.substitution = substitution;
     }
@@ -52,7 +52,7 @@ public final class RegexReplacement {
      * @param msg The String to match against.
      * @return the replacement String.
      */
-    public String format(String msg) {
+    public String format(final String msg) {
         return pattern.matcher(msg).replaceAll(substitution);
     }
 
@@ -68,8 +68,8 @@ public final class RegexReplacement {
      * @return A RegexReplacement.
      */
     @PluginFactory
-    public static RegexReplacement createRegexReplacement(@PluginAttr("regex") String regex,
-                                                          @PluginAttr("replacement") String replacement) {
+    public static RegexReplacement createRegexReplacement(@PluginAttr("regex") final String regex,
+                                                          @PluginAttr("replacement") final String replacement) {
         if (regex == null) {
             LOGGER.error("A regular expression is required for replacement");
             return null;
@@ -77,7 +77,7 @@ public final class RegexReplacement {
         if (replacement == null) {
             LOGGER.error("A replacement string is required to perform replacement");
         }
-        Pattern p = Pattern.compile(regex);
+        final Pattern p = Pattern.compile(regex);
         return new RegexReplacement(p, replacement);
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacementConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacementConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacementConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacementConverter.java Mon Dec 10 19:36:06 2012
@@ -43,8 +43,8 @@ public final class RegexReplacementConve
      * @param pattern The regular expression Pattern.
      * @param substitution The substitution string.
      */
-    private RegexReplacementConverter(List<PatternFormatter> formatters,
-                                      Pattern pattern, String substitution) {
+    private RegexReplacementConverter(final List<PatternFormatter> formatters,
+                                      final Pattern pattern, final String substitution) {
         super("replace", "replace");
         this.pattern = pattern;
         this.substitution = substitution;
@@ -59,7 +59,7 @@ public final class RegexReplacementConve
      *                only the first line of the throwable will be formatted.
      * @return instance of class.
      */
-    public static RegexReplacementConverter newInstance(Configuration config, final String[] options) {
+    public static RegexReplacementConverter newInstance(final Configuration config, final String[] options) {
         if (options.length != 3) {
             LOGGER.error("Incorrect number of options on replace. Expected 3 received " + options.length);
             return null;
@@ -76,9 +76,9 @@ public final class RegexReplacementConve
             LOGGER.error("No substitution supplied on replace");
             return null;
         }
-        Pattern p = Pattern.compile(options[1]);
-        PatternParser parser = PatternLayout.createPatternParser(config);
-        List<PatternFormatter> formatters = parser.parse(options[0]);
+        final Pattern p = Pattern.compile(options[1]);
+        final PatternParser parser = PatternLayout.createPatternParser(config);
+        final List<PatternFormatter> formatters = parser.parse(options[0]);
         return new RegexReplacementConverter(formatters, p, options[2]);
     }
 
@@ -88,8 +88,8 @@ public final class RegexReplacementConve
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        StringBuilder buf = new StringBuilder();
-        for (PatternFormatter formatter : formatters) {
+        final StringBuilder buf = new StringBuilder();
+        for (final PatternFormatter formatter : formatters) {
             formatter.format(event, buf);
         }
         toAppendTo.append(pattern.matcher(buf.toString()).replaceAll(substitution));

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RelativeTimePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RelativeTimePatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RelativeTimePatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RelativeTimePatternConverter.java Mon Dec 10 19:36:06 2012
@@ -57,7 +57,7 @@ public class RelativeTimePatternConverte
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        long timestamp = event.getMillis();
+        final long timestamp = event.getMillis();
 
         synchronized (this) {
             if (timestamp != lastTimestamp) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java Mon Dec 10 19:36:06 2012
@@ -51,11 +51,11 @@ public final class RootThrowablePatternC
         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(",");
+                final String filterStr = options[1].substring(FILTERS.length(), options[1].length() - 1);
+                final String[] array = filterStr.split(",");
                 if (array.length > 0) {
                     tempPackages = new ArrayList<String>(array.length);
-                    for (String token : array) {
+                    for (final String token : array) {
                         tempPackages.add(token.trim());
                     }
                 }
@@ -75,10 +75,10 @@ public final class RootThrowablePatternC
         String type = null;
         String[] array = options;
         if (options != null && options.length == 1 && options[0].length() > 0) {
-            String[] opts = options[0].split(",", 2);
-            String first = opts[0].trim();
+            final String[] opts = options[0].split(",", 2);
+            final String first = opts[0].trim();
             String filter;
-            Scanner scanner = new Scanner(first);
+            final Scanner scanner = new Scanner(first);
             if (first.equalsIgnoreCase(FULL) || first.equalsIgnoreCase(SHORT) || scanner.hasNextInt()) {
                 type = first;
                 filter = opts[1].trim();
@@ -96,21 +96,21 @@ public final class RootThrowablePatternC
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        Throwable throwable = event.getThrown();
+        final Throwable throwable = event.getThrown();
         if (throwable != null) {
             if (!(throwable instanceof ThrowableProxy)) {
                 super.format(event, toAppendTo);
                 return;
             }
-            ThrowableProxy t = (ThrowableProxy) throwable;
-            String trace = t.getRootCauseStackTrace(packages);
-            int len = toAppendTo.length();
+            final ThrowableProxy t = (ThrowableProxy) throwable;
+            final String trace = t.getRootCauseStackTrace(packages);
+            final int len = toAppendTo.length();
             if (len > 0 && !Character.isWhitespace(toAppendTo.charAt(len - 1))) {
                 toAppendTo.append(" ");
             }
             if (lines > 0) {
-                StringBuilder sb = new StringBuilder();
-                String[] array = trace.split("\n");
+                final StringBuilder sb = new StringBuilder();
+                final String[] array = trace.split("\n");
                 for (int i = 0; i < lines; ++i) {
                     sb.append(array[i]).append("\n");
                 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/StyleConverter.java Mon Dec 10 19:36:06 2012
@@ -39,7 +39,7 @@ public final class StyleConverter extend
      * @param formatters The PatternFormatters to generate the text to manipulate.
      * @param styling The styling that should encapsulate the pattern.
      */
-    private StyleConverter(List<PatternFormatter> formatters, String styling) {
+    private StyleConverter(final List<PatternFormatter> formatters, final String styling) {
         super("style", "style");
         this.formatters = formatters;
         this.style = styling;
@@ -53,7 +53,7 @@ public final class StyleConverter extend
      *                only the first line of the throwable will be formatted.
      * @return instance of class.
      */
-    public static StyleConverter newInstance(Configuration config, final String[] options) {
+    public static StyleConverter newInstance(final Configuration config, final String[] options) {
         if (options.length < 1) {
             LOGGER.error("Incorrect number of options on style. Expected at least 1, received " + options.length);
             return null;
@@ -67,9 +67,9 @@ public final class StyleConverter extend
             return null;
         }
 
-        PatternParser parser = PatternLayout.createPatternParser(config);
-        List<PatternFormatter> formatters = parser.parse(options[0]);
-        String style = AnsiEscape.createSequence(options[1].split("\\s*,\\s*"));
+        final PatternParser parser = PatternLayout.createPatternParser(config);
+        final List<PatternFormatter> formatters = parser.parse(options[0]);
+        final String style = AnsiEscape.createSequence(options[1].split("\\s*,\\s*"));
         return new StyleConverter(formatters, style);
     }
 
@@ -79,8 +79,8 @@ public final class StyleConverter extend
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        StringBuilder buf = new StringBuilder();
-        for (PatternFormatter formatter : formatters) {
+        final StringBuilder buf = new StringBuilder();
+        for (final PatternFormatter formatter : formatters) {
             formatter.format(event, buf);
         }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java Mon Dec 10 19:36:06 2012
@@ -58,7 +58,7 @@ public class ThrowablePatternConverter e
      * @param style CSS style for output.
      * @param options options, may be null.
      */
-    protected ThrowablePatternConverter(String name, String style, final String[] options) {
+    protected ThrowablePatternConverter(final String name, final String style, final String[] options) {
         super(name, style);
         int count = 0;
         if ((options != null) && (options.length > 0)) {
@@ -92,18 +92,18 @@ public class ThrowablePatternConverter e
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        Throwable t = event.getThrown();
+        final Throwable t = event.getThrown();
 
         if (t != null) {
-            StringWriter w = new StringWriter();
+            final StringWriter w = new StringWriter();
             t.printStackTrace(new PrintWriter(w));
-            int len = toAppendTo.length();
+            final int len = toAppendTo.length();
             if (len > 0 && !Character.isWhitespace(toAppendTo.charAt(len - 1))) {
                 toAppendTo.append(" ");
             }
             if (lines > 0) {
-                StringBuilder sb = new StringBuilder();
-                String[] array = w.toString().split("\n");
+                final StringBuilder sb = new StringBuilder();
+                final String[] array = w.toString().split("\n");
                 for (int i = 0; i < lines; ++i) {
                     sb.append(array[i]).append("\n");
                 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/UUIDPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/UUIDPatternConverter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/UUIDPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/UUIDPatternConverter.java Mon Dec 10 19:36:06 2012
@@ -34,7 +34,7 @@ public final class UUIDPatternConverter 
     /**
      * Private constructor.
      */
-    private UUIDPatternConverter(boolean isRandom) {
+    private UUIDPatternConverter(final boolean isRandom) {
         super("u", "uuid");
         this.isRandom = isRandom;
     }
@@ -61,7 +61,7 @@ public final class UUIDPatternConverter 
      */
     @Override
     public void format(final LogEvent event, final StringBuilder toAppendTo) {
-        UUID uuid = isRandom ? UUID.randomUUID() : UUIDUtil.getTimeBasedUUID();
+        final UUID uuid = isRandom ? UUID.randomUUID() : UUIDUtil.getTimeBasedUUID();
         toAppendTo.append(uuid.toString());
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/BasicContextSelector.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/BasicContextSelector.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/BasicContextSelector.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/BasicContextSelector.java Mon Dec 10 19:36:06 2012
@@ -30,22 +30,22 @@ public class BasicContextSelector implem
 
     private static final LoggerContext context = new LoggerContext("Default");
 
-    public LoggerContext getContext(String fqcn, ClassLoader loader, boolean currentContext) {
+    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext) {
 
-        LoggerContext ctx = ContextAnchor.THREAD_CONTEXT.get();
+        final LoggerContext ctx = ContextAnchor.THREAD_CONTEXT.get();
         return ctx != null ? ctx : context;
     }
 
-    public LoggerContext locateContext(String name, String configLocation) {
+    public LoggerContext locateContext(final String name, final String configLocation) {
         return context;
     }
 
-    public void removeContext(LoggerContext context) {
+    public void removeContext(final LoggerContext context) {
 
     }
 
     public List<LoggerContext> getLoggerContexts() {
-        List<LoggerContext> list = new ArrayList<LoggerContext>();
+        final List<LoggerContext> list = new ArrayList<LoggerContext>();
         list.add(context);
         return Collections.unmodifiableList(list);
     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java Mon Dec 10 19:36:06 2012
@@ -61,9 +61,9 @@ public class ClassLoaderContextSelector 
         setupCallerCheck();
     }
 
-    public LoggerContext getContext(String fqcn, ClassLoader loader, boolean currentContext) {
+    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext) {
         if (currentContext) {
-            LoggerContext ctx = ContextAnchor.THREAD_CONTEXT.get();
+            final LoggerContext ctx = ContextAnchor.THREAD_CONTEXT.get();
             if (ctx != null) {
                 return ctx;
             }
@@ -76,7 +76,7 @@ public class ClassLoaderContextSelector 
                     Class clazz = Class.class;
                     boolean next = false;
                     for (int index = 2; clazz != null; ++index) {
-                        Object[] params = new Object[] {index};
+                        final Object[] params = new Object[] {index};
                         clazz = (Class) getCallerClass.invoke(null, params);
                         if (clazz == null) {
                             break;
@@ -92,22 +92,22 @@ public class ClassLoaderContextSelector 
                     if (clazz != null) {
                         return locateContext(clazz.getClassLoader(), null);
                     }
-                } catch (Exception ex) {
+                } catch (final Exception ex) {
                     // logger.debug("Unable to determine caller class via Sun Reflection", ex);
                 }
             }
 
             if (securityManager != null) {
-                Class clazz = securityManager.getCaller(fqcn);
+                final Class clazz = securityManager.getCaller(fqcn);
                 if (clazz != null) {
                     return locateContext(clazz.getClassLoader(), null);
                 }
             }
 
-            Throwable t = new Throwable();
+            final Throwable t = new Throwable();
             boolean next = false;
             String name = null;
-            for (StackTraceElement element : t.getStackTrace()) {
+            for (final StackTraceElement element : t.getStackTrace()) {
                 if (element.getClassName().equals(fqcn)) {
                     next = true;
                     continue;
@@ -120,11 +120,11 @@ public class ClassLoaderContextSelector 
             if (name != null) {
                 try {
                     return locateContext(Loader.loadClass(name).getClassLoader(), null);
-                } catch (ClassNotFoundException ex) {
+                } catch (final ClassNotFoundException ex) {
                     //System.out.println("Could not load class " + name);
                 }
             }
-            LoggerContext lc = ContextAnchor.THREAD_CONTEXT.get();
+            final LoggerContext lc = ContextAnchor.THREAD_CONTEXT.get();
             if (lc != null) {
                 return lc;
             }
@@ -132,9 +132,9 @@ public class ClassLoaderContextSelector 
         }
     }
 
-    public void removeContext(LoggerContext context) {
-        for (Map.Entry<String, AtomicReference<WeakReference<LoggerContext>>> entry : contextMap.entrySet()) {
-            LoggerContext ctx = entry.getValue().get().get();
+    public void removeContext(final LoggerContext context) {
+        for (final Map.Entry<String, AtomicReference<WeakReference<LoggerContext>>> entry : contextMap.entrySet()) {
+            final LoggerContext ctx = entry.getValue().get().get();
             if (ctx == context) {
                 contextMap.remove(entry.getKey());
             }
@@ -142,10 +142,10 @@ public class ClassLoaderContextSelector 
     }
 
     public List<LoggerContext> getLoggerContexts() {
-        List<LoggerContext> list = new ArrayList<LoggerContext>();
-        Collection<AtomicReference<WeakReference<LoggerContext>>> coll = contextMap.values();
-        for (AtomicReference<WeakReference<LoggerContext>> ref : coll) {
-            LoggerContext ctx = ref.get().get();
+        final List<LoggerContext> list = new ArrayList<LoggerContext>();
+        final Collection<AtomicReference<WeakReference<LoggerContext>>> coll = contextMap.values();
+        for (final AtomicReference<WeakReference<LoggerContext>> ref : coll) {
+            final LoggerContext ctx = ref.get().get();
             if (ctx != null) {
                 list.add(ctx);
             }
@@ -153,19 +153,19 @@ public class ClassLoaderContextSelector 
         return Collections.unmodifiableList(list);
     }
 
-    private LoggerContext locateContext(ClassLoader loader, String configLocation) {
-        String name = loader.toString();
-        AtomicReference<WeakReference<LoggerContext>> ref = contextMap.get(name);
+    private LoggerContext locateContext(final ClassLoader loader, final String configLocation) {
+        final String name = loader.toString();
+        final AtomicReference<WeakReference<LoggerContext>> ref = contextMap.get(name);
         if (ref == null) {
             LoggerContext ctx = new LoggerContext(name, null, configLocation);
-            AtomicReference<WeakReference<LoggerContext>> r =
+            final AtomicReference<WeakReference<LoggerContext>> r =
                 new AtomicReference<WeakReference<LoggerContext>>();
             r.set(new WeakReference<LoggerContext>(ctx));
             contextMap.putIfAbsent(loader.toString(), r);
             ctx = contextMap.get(name).get().get();
             return ctx;
         } else {
-            WeakReference<LoggerContext> r = ref.get();
+            final WeakReference<LoggerContext> r = ref.get();
             LoggerContext ctx = r.get();
             if (ctx != null) {
                 return ctx;
@@ -178,29 +178,29 @@ public class ClassLoaderContextSelector 
 
     private static void setupCallerCheck() {
         try {
-            ClassLoader loader = Loader.getClassLoader();
-            Class clazz = loader.loadClass("sun.reflect.Reflection");
-            Method[] methods = clazz.getMethods();
-            for (Method method : methods) {
-                int modifier = method.getModifiers();
+            final ClassLoader loader = Loader.getClassLoader();
+            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;
                     break;
                 }
             }
-        } catch (ClassNotFoundException cnfe) {
+        } catch (final ClassNotFoundException cnfe) {
             logger.debug("sun.reflect.Reflection is not installed");
         }
         try {
             securityManager = new PrivateSecurityManager();
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             ex.printStackTrace();
             logger.debug("Unable to install security manager", ex);
         }
     }
 
     private LoggerContext getDefault() {
-        LoggerContext ctx = context.get();
+        final LoggerContext ctx = context.get();
         if (ctx != null) {
             return ctx;
         }
@@ -213,10 +213,10 @@ public class ClassLoaderContextSelector 
      */
     private static class PrivateSecurityManager extends SecurityManager {
 
-        public Class getCaller(String fqcn) {
-            Class[] classes = getClassContext();
+        public Class getCaller(final String fqcn) {
+            final Class[] classes = getClassContext();
             boolean next = false;
-            for (Class clazz : classes) {
+            for (final Class clazz : classes) {
                 if (clazz.getName().equals(fqcn)) {
                     next = true;
                     continue;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/JNDIContextSelector.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/JNDIContextSelector.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/JNDIContextSelector.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/JNDIContextSelector.java Mon Dec 10 19:36:06 2012
@@ -93,9 +93,9 @@ public class JNDIContextSelector impleme
 
     private static final StatusLogger LOGGER = StatusLogger.getLogger();
 
-    public LoggerContext getContext(String fqcn, ClassLoader loader, boolean currentContext) {
+    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext) {
 
-        LoggerContext lc = ContextAnchor.THREAD_CONTEXT.get();
+        final LoggerContext lc = ContextAnchor.THREAD_CONTEXT.get();
         if (lc != null) {
             return lc;
         }
@@ -103,53 +103,53 @@ public class JNDIContextSelector impleme
         String loggingContextName = null;
 
         try {
-            Context ctx = new InitialContext();
+            final Context ctx = new InitialContext();
             loggingContextName = (String) lookup(ctx, Constants.JNDI_CONTEXT_NAME);
-        } catch (NamingException ne) {
+        } catch (final NamingException ne) {
             LOGGER.error("Unable to lookup " + Constants.JNDI_CONTEXT_NAME, ne);
         }
 
         return loggingContextName == null ? context : locateContext(loggingContextName, null);
     }
 
-    public LoggerContext locateContext(String name, String configLocation) {
+    public LoggerContext locateContext(final String name, final String configLocation) {
         if (name == null) {
             LOGGER.error("A context name is required to locate a LoggerContext");
             return null;
         }
         if (!contextMap.containsKey(name)) {
-            LoggerContext ctx = new LoggerContext(name, null, configLocation);
+            final LoggerContext ctx = new LoggerContext(name, null, configLocation);
             contextMap.putIfAbsent(name, ctx);
         }
         return contextMap.get(name);
     }
 
-    public void removeContext(LoggerContext context) {
+    public void removeContext(final LoggerContext context) {
 
-        for (Map.Entry<String, LoggerContext> entry : contextMap.entrySet()) {
+        for (final Map.Entry<String, LoggerContext> entry : contextMap.entrySet()) {
             if (entry.getValue().equals(context)) {
                 contextMap.remove(entry.getKey());
             }
         }
     }
 
-    public LoggerContext removeContext(String name) {
+    public LoggerContext removeContext(final String name) {
         return contextMap.remove(name);
     }
 
     public List<LoggerContext> getLoggerContexts() {
-        List<LoggerContext> list = new ArrayList<LoggerContext>(contextMap.values());
+        final List<LoggerContext> list = new ArrayList<LoggerContext>(contextMap.values());
         return Collections.unmodifiableList(list);
     }
 
 
-    protected static Object lookup(Context ctx, String name) throws NamingException {
+    protected static Object lookup(final Context ctx, final String name) throws NamingException {
         if (ctx == null) {
             return null;
         }
         try {
             return ctx.lookup(name);
-        } catch (NameNotFoundException e) {
+        } catch (final NameNotFoundException e) {
             LOGGER.error("Could not find name [" + name + "].");
             throw e;
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/DebugDisabledPerformanceComparison.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/DebugDisabledPerformanceComparison.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/DebugDisabledPerformanceComparison.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/DebugDisabledPerformanceComparison.java Mon Dec 10 19:36:06 2012
@@ -35,9 +35,9 @@ import java.nio.channels.FileChannel;
  */
 public class DebugDisabledPerformanceComparison {
 
-    private Logger logger = LogManager.getLogger(DebugDisabledPerformanceComparison.class.getName());
-    private org.slf4j.Logger logbacklogger = org.slf4j.LoggerFactory.getLogger(DebugDisabledPerformanceComparison.class);
-    private org.apache.log4j.Logger log4jlogger = org.apache.log4j.Logger.getLogger(DebugDisabledPerformanceComparison.class);
+    private final Logger logger = LogManager.getLogger(DebugDisabledPerformanceComparison.class.getName());
+    private final org.slf4j.Logger logbacklogger = org.slf4j.LoggerFactory.getLogger(DebugDisabledPerformanceComparison.class);
+    private final org.apache.log4j.Logger log4jlogger = org.apache.log4j.Logger.getLogger(DebugDisabledPerformanceComparison.class);
 
 
     // How many times should we try to log:
@@ -76,7 +76,7 @@ public class DebugDisabledPerformanceCom
         if (Profiler.isActive()) {
             System.out.println("Profiling Log4j 2.0");
             Profiler.start();
-            long result = log4j2(PROFILE_COUNT);
+            final long result = log4j2(PROFILE_COUNT);
             Profiler.stop();
             System.out.println("###############################################");
             System.out.println("Log4j 2.0: " + result);
@@ -126,18 +126,18 @@ public class DebugDisabledPerformanceCom
 
     //@Test
     public void testRawPerformance() throws Exception {
-        OutputStream os = new FileOutputStream("target/testos.log", true);
-        long result1 = writeToStream(COUNT, os);
+        final OutputStream os = new FileOutputStream("target/testos.log", true);
+        final long result1 = writeToStream(COUNT, os);
         os.close();
-        OutputStream bos = new BufferedOutputStream(new FileOutputStream("target/testbuffer.log", true));
-        long result2 = writeToStream(COUNT, bos);
+        final OutputStream bos = new BufferedOutputStream(new FileOutputStream("target/testbuffer.log", true));
+        final long result2 = writeToStream(COUNT, bos);
         bos.close();
-        Writer w = new FileWriter("target/testwriter.log", true);
-        long result3 = writeToWriter(COUNT, w);
+        final Writer w = new FileWriter("target/testwriter.log", true);
+        final long result3 = writeToWriter(COUNT, w);
         w.close();
-        FileOutputStream cos = new FileOutputStream("target/testchannel.log", true);
-        FileChannel channel = cos.getChannel();
-        long result4 = writeToChannel(COUNT, channel);
+        final FileOutputStream cos = new FileOutputStream("target/testchannel.log", true);
+        final FileChannel channel = cos.getChannel();
+        final long result4 = writeToChannel(COUNT, channel);
         cos.close();
         System.out.println("###############################################");
         System.out.println("FileOutputStream: " + result1);
@@ -148,18 +148,18 @@ public class DebugDisabledPerformanceCom
     }
 
 
-    private long log4jIsDebug(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long log4jIsDebug(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             log4jlogger.isDebugEnabled();
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private long logbackIsDebug(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long logbackIsDebug(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             logbacklogger.isDebugEnabled();
         }
@@ -167,9 +167,9 @@ public class DebugDisabledPerformanceCom
     }
 
 
-    private long log4j2IsDebug(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long log4j2IsDebug(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             logger.isDebugEnabled();
         }
@@ -178,27 +178,27 @@ public class DebugDisabledPerformanceCom
 
 
 
-    private long log4j(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long log4j(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             log4jlogger.debug("SEE IF THIS IS LOGGED " + j + '.');
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private long logback(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long logback(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             logbacklogger.debug("SEE IF THIS IS LOGGED " + j + '.');
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private long logbackDebug(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long logbackDebug(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             logbacklogger.debug("SEE IF THIS IS LOGGED {} .", j);
         }
@@ -206,18 +206,18 @@ public class DebugDisabledPerformanceCom
     }
 
 
-    private long log4j2(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long log4j2(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             logger.debug("SEE IF THIS IS LOGGED " + j + '.');
         }
         return (System.nanoTime() - start) / loop;
     }
 
-     private long log4j2Debug(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+     private long log4j2Debug(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             logger.debug("SEE IF THIS IS LOGGED {} .", j);
         }
@@ -225,42 +225,42 @@ public class DebugDisabledPerformanceCom
     }
 
 
-    private long writeToWriter(int loop, Writer w) throws Exception {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long writeToWriter(final int loop, final Writer w) throws Exception {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             w.write("SEE IF THIS IS LOGGED " + j + '.');
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private long writeToStream(int loop, OutputStream os) throws Exception {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long writeToStream(final int loop, final OutputStream os) throws Exception {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             os.write(getBytes("SEE IF THIS IS LOGGED " + j + '.'));
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private long writeToChannel(int loop, FileChannel channel) throws Exception {
-        Integer j = new Integer(2);
-        ByteBuffer buf = ByteBuffer.allocateDirect(8*1024);
-        long start = System.nanoTime();
+    private long writeToChannel(final int loop, final FileChannel channel) throws Exception {
+        final Integer j = new Integer(2);
+        final ByteBuffer buf = ByteBuffer.allocateDirect(8*1024);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             channel.write(getByteBuffer(buf, "SEE IF THIS IS LOGGED " + j + '.'));
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private ByteBuffer getByteBuffer(ByteBuffer buf, String s) {
+    private ByteBuffer getByteBuffer(final ByteBuffer buf, final String s) {
         buf.clear();
         buf.put(s.getBytes());
         buf.flip();
         return buf;
     }
 
-    private byte[] getBytes(String s) {
+    private byte[] getBytes(final String s) {
         return s.getBytes();
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/FilterPerformanceComparison.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/FilterPerformanceComparison.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/FilterPerformanceComparison.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/FilterPerformanceComparison.java Mon Dec 10 19:36:06 2012
@@ -26,8 +26,8 @@ import org.junit.Test;
  */
 public class FilterPerformanceComparison {
 
-    private Logger logger = LogManager.getLogger(FilterPerformanceComparison.class.getName());
-    private org.slf4j.Logger logbacklogger = org.slf4j.LoggerFactory.getLogger(FilterPerformanceComparison.class);
+    private final Logger logger = LogManager.getLogger(FilterPerformanceComparison.class.getName());
+    private final org.slf4j.Logger logbacklogger = org.slf4j.LoggerFactory.getLogger(FilterPerformanceComparison.class);
 
 
     // How many times should we try to log:
@@ -58,9 +58,9 @@ public class FilterPerformanceComparison
         log4j2(WARMUP);
 
         System.out.println("Starting Log4j 2.0");
-        long result3 = log4j2(COUNT);
+        final long result3 = log4j2(COUNT);
         System.out.println("Starting Logback");
-        long result2 = logback(COUNT);
+        final long result2 = logback(COUNT);
 
         System.out.println("###############################################");
         System.out.println("Logback: " + result2);
@@ -71,12 +71,12 @@ public class FilterPerformanceComparison
     @Test
     public void testThreads() throws Exception {
         System.out.println("Testing multithreading");
-        int threadedCount = COUNT; // THREADED_COUNT * threadCount < COUNT ? COUNT / threadCount : THREADED_COUNT;
-        int[] threadCounts = new int[] {1, 2, 5, 10, 20, 50};
-        for (int threadCount : threadCounts) {
+        final int threadedCount = COUNT; // THREADED_COUNT * threadCount < COUNT ? COUNT / threadCount : THREADED_COUNT;
+        final int[] threadCounts = new int[] {1, 2, 5, 10, 20, 50};
+        for (final int threadCount : threadCounts) {
             System.out.println("Testing " + threadCount + " threads");
-            Worker[] workers = new Worker[threadCount];
-            long[] results = new long[threadCount];
+            final Worker[] workers = new Worker[threadCount];
+            final long[] results = new long[threadCount];
             for (int i=0; i < threadCount; ++i) {
                 workers[i] = new Worker(true, threadedCount, results, i);
             }
@@ -88,7 +88,7 @@ public class FilterPerformanceComparison
                 workers[i].join();
                 total += results[i];
             }
-            long result3 = total / threadCount;
+            final long result3 = total / threadCount;
             total = 0;
             for (int i=0; i < threadCount; ++i) {
                 workers[i] = new Worker(false, threadedCount, results, i);
@@ -100,7 +100,7 @@ public class FilterPerformanceComparison
                 workers[i].join();
                 total += results[i];
             }
-            long result2 = total / threadCount;
+            final long result2 = total / threadCount;
             System.out.println("###############################################");
             System.out.println("Logback: " + result2);
             System.out.println("Log4j 2.0: " + result3 );
@@ -109,9 +109,9 @@ public class FilterPerformanceComparison
 
     }
 
-    private long logback(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long logback(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             logbacklogger.debug("SEE IF THIS IS LOGGED {}.", j);
         }
@@ -119,9 +119,9 @@ public class FilterPerformanceComparison
     }
 
 
-    private long log4j2(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long log4j2(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             logger.debug("SEE IF THIS IS LOGGED {}.", j);
         }
@@ -130,12 +130,12 @@ public class FilterPerformanceComparison
 
     private class Worker extends Thread {
 
-        private boolean isLog4j;
-        private int count;
-        private long[] results;
-        private int index;
+        private final boolean isLog4j;
+        private final int count;
+        private final long[] results;
+        private final int index;
 
-        public Worker(boolean isLog4j, int count, long[] results, int index) {
+        public Worker(final boolean isLog4j, final int count, final long[] results, final int index) {
             this.isLog4j = isLog4j;
             this.count = count;
             this.results = results;

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/LogbackSubstitution.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/LogbackSubstitution.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/LogbackSubstitution.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/LogbackSubstitution.java Mon Dec 10 19:36:06 2012
@@ -29,7 +29,7 @@ public class LogbackSubstitution {
 
     private static final String LOGBACK_CONF = "logback.configurationFile";
     private static final String LOGBACK_CONFIG = "logback-subst.xml";
-    private XLogger xLogger = XLoggerFactory.getXLogger(LogbackSubstitution.class);
+    private final XLogger xLogger = XLoggerFactory.getXLogger(LogbackSubstitution.class);
 
 
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/PerformanceComparison.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/PerformanceComparison.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/PerformanceComparison.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/PerformanceComparison.java Mon Dec 10 19:36:06 2012
@@ -37,9 +37,9 @@ import java.nio.channels.FileChannel;
  */
 public class PerformanceComparison {
 
-    private Logger logger = LogManager.getLogger(PerformanceComparison.class.getName());
-    private org.slf4j.Logger logbacklogger = org.slf4j.LoggerFactory.getLogger(PerformanceComparison.class);
-    private org.apache.log4j.Logger log4jlogger = org.apache.log4j.Logger.getLogger(PerformanceComparison.class);
+    private final Logger logger = LogManager.getLogger(PerformanceComparison.class.getName());
+    private final org.slf4j.Logger logbacklogger = org.slf4j.LoggerFactory.getLogger(PerformanceComparison.class);
+    private final org.apache.log4j.Logger log4jlogger = org.apache.log4j.Logger.getLogger(PerformanceComparison.class);
 
 
     // How many times should we try to log:
@@ -78,18 +78,18 @@ public class PerformanceComparison {
         if (Profiler.isActive()) {
             System.out.println("Profiling Log4j 2.0");
             Profiler.start();
-            long result = log4j2(PROFILE_COUNT);
+            final long result = log4j2(PROFILE_COUNT);
             Profiler.stop();
             System.out.println("###############################################");
             System.out.println("Log4j 2.0: " + result);
             System.out.println("###############################################");
         } else {
             System.out.println("Starting Log4j 2.0");
-            long result3 = log4j2(COUNT);
+            final long result3 = log4j2(COUNT);
             System.out.println("Starting Log4j");
-            long result1 = log4j(COUNT);
+            final long result1 = log4j(COUNT);
             System.out.println("Starting Logback");
-            long result2 = logback(COUNT);
+            final long result2 = logback(COUNT);
 
             System.out.println("###############################################");
             System.out.println("Log4j: " + result1);
@@ -101,18 +101,18 @@ public class PerformanceComparison {
 
     //@Test
     public void testRawPerformance() throws Exception {
-        OutputStream os = new FileOutputStream("target/testos.log", true);
-        long result1 = writeToStream(COUNT, os);
+        final OutputStream os = new FileOutputStream("target/testos.log", true);
+        final long result1 = writeToStream(COUNT, os);
         os.close();
-        OutputStream bos = new BufferedOutputStream(new FileOutputStream("target/testbuffer.log", true));
-        long result2 = writeToStream(COUNT, bos);
+        final OutputStream bos = new BufferedOutputStream(new FileOutputStream("target/testbuffer.log", true));
+        final long result2 = writeToStream(COUNT, bos);
         bos.close();
-        Writer w = new FileWriter("target/testwriter.log", true);
-        long result3 = writeToWriter(COUNT, w);
+        final Writer w = new FileWriter("target/testwriter.log", true);
+        final long result3 = writeToWriter(COUNT, w);
         w.close();
-        FileOutputStream cos = new FileOutputStream("target/testchannel.log", true);
-        FileChannel channel = cos.getChannel();
-        long result4 = writeToChannel(COUNT, channel);
+        final FileOutputStream cos = new FileOutputStream("target/testchannel.log", true);
+        final FileChannel channel = cos.getChannel();
+        final long result4 = writeToChannel(COUNT, channel);
         cos.close();
         System.out.println("###############################################");
         System.out.println("FileOutputStream: " + result1);
@@ -122,18 +122,18 @@ public class PerformanceComparison {
         System.out.println("###############################################");
     }
 
-    private long log4j(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long log4j(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             log4jlogger.debug("SEE IF THIS IS LOGGED " + j + '.');
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private long logback(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long logback(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             logbacklogger.debug("SEE IF THIS IS LOGGED " + j + '.');
         }
@@ -141,9 +141,9 @@ public class PerformanceComparison {
     }
 
 
-    private long log4j2(int loop) {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long log4j2(final int loop) {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             logger.debug("SEE IF THIS IS LOGGED " + j + '.');
         }
@@ -151,42 +151,42 @@ public class PerformanceComparison {
     }
 
 
-    private long writeToWriter(int loop, Writer w) throws Exception {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long writeToWriter(final int loop, final Writer w) throws Exception {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             w.write("SEE IF THIS IS LOGGED " + j + '.');
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private long writeToStream(int loop, OutputStream os) throws Exception {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long writeToStream(final int loop, final OutputStream os) throws Exception {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             os.write(getBytes("SEE IF THIS IS LOGGED " + j + '.'));
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private long writeToChannel(int loop, FileChannel channel) throws Exception {
-        Integer j = new Integer(2);
-        ByteBuffer buf = ByteBuffer.allocateDirect(8*1024);
-        long start = System.nanoTime();
+    private long writeToChannel(final int loop, final FileChannel channel) throws Exception {
+        final Integer j = new Integer(2);
+        final ByteBuffer buf = ByteBuffer.allocateDirect(8*1024);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             channel.write(getByteBuffer(buf, "SEE IF THIS IS LOGGED " + j + '.'));
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private ByteBuffer getByteBuffer(ByteBuffer buf, String s) {
+    private ByteBuffer getByteBuffer(final ByteBuffer buf, final String s) {
         buf.clear();
         buf.put(s.getBytes());
         buf.flip();
         return buf;
     }
 
-    private byte[] getBytes(String s) {
+    private byte[] getBytes(final String s) {
         return s.getBytes();
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/PerformanceRun.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/PerformanceRun.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/PerformanceRun.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/PerformanceRun.java Mon Dec 10 19:36:06 2012
@@ -38,7 +38,7 @@ import org.junit.Test;
  */
 public class PerformanceRun {
 
-    private Logger logger = LogManager.getLogger(PerformanceRun.class.getName());
+    private final Logger logger = LogManager.getLogger(PerformanceRun.class.getName());
 
     // How many times should we try to log:
     private static final int COUNT = 1000000;
@@ -58,7 +58,7 @@ public class PerformanceRun {
     @Test
     public void testPerformance() throws Exception {
         System.out.println("Starting Log4j 2.0");
-        long result3 = log4j2(COUNT);
+        final long result3 = log4j2(COUNT);
 
         System.out.println("###############################################");
         System.out.println("Log4j 2.0: " + result3);
@@ -67,18 +67,18 @@ public class PerformanceRun {
 
     // @Test
     public void testRawPerformance() throws Exception {
-        OutputStream os = new FileOutputStream("target/testos.log", true);
-        long result1 = writeToStream(COUNT, os);
+        final OutputStream os = new FileOutputStream("target/testos.log", true);
+        final long result1 = writeToStream(COUNT, os);
         os.close();
-        OutputStream bos = new BufferedOutputStream(new FileOutputStream("target/testbuffer.log", true));
-        long result2 = writeToStream(COUNT, bos);
+        final OutputStream bos = new BufferedOutputStream(new FileOutputStream("target/testbuffer.log", true));
+        final long result2 = writeToStream(COUNT, bos);
         bos.close();
-        Writer w = new FileWriter("target/testwriter.log", true);
-        long result3 = writeToWriter(COUNT, w);
+        final Writer w = new FileWriter("target/testwriter.log", true);
+        final long result3 = writeToWriter(COUNT, w);
         w.close();
-        FileOutputStream cos = new FileOutputStream("target/testchannel.log", true);
-        FileChannel channel = cos.getChannel();
-        long result4 = writeToChannel(COUNT, channel);
+        final FileOutputStream cos = new FileOutputStream("target/testchannel.log", true);
+        final FileChannel channel = cos.getChannel();
+        final long result4 = writeToChannel(COUNT, channel);
         cos.close();
         System.out.println("###############################################");
         System.out.println("FileOutputStream: " + result1);
@@ -88,8 +88,8 @@ public class PerformanceRun {
         System.out.println("###############################################");
     }
 
-    private long log4j2(int loop) {
-        long start = System.nanoTime();
+    private long log4j2(final int loop) {
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             if (logger.isDebugEnabled()) {
                 logger.debug("SEE IF THIS IS LOGGED");
@@ -98,42 +98,42 @@ public class PerformanceRun {
         return (System.nanoTime() - start) / loop;
     }
 
-    private long writeToWriter(int loop, Writer w) throws Exception {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long writeToWriter(final int loop, final Writer w) throws Exception {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             w.write("SEE IF THIS IS LOGGED " + j + '.');
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private long writeToStream(int loop, OutputStream os) throws Exception {
-        Integer j = new Integer(2);
-        long start = System.nanoTime();
+    private long writeToStream(final int loop, final OutputStream os) throws Exception {
+        final Integer j = new Integer(2);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             os.write(getBytes("SEE IF THIS IS LOGGED " + j + '.'));
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private long writeToChannel(int loop, FileChannel channel) throws Exception {
-        Integer j = new Integer(2);
-        ByteBuffer buf = ByteBuffer.allocateDirect(8 * 1024);
-        long start = System.nanoTime();
+    private long writeToChannel(final int loop, final FileChannel channel) throws Exception {
+        final Integer j = new Integer(2);
+        final ByteBuffer buf = ByteBuffer.allocateDirect(8 * 1024);
+        final long start = System.nanoTime();
         for (int i = 0; i < loop; i++) {
             channel.write(getByteBuffer(buf, "SEE IF THIS IS LOGGED " + j + '.'));
         }
         return (System.nanoTime() - start) / loop;
     }
 
-    private ByteBuffer getByteBuffer(ByteBuffer buf, String s) {
+    private ByteBuffer getByteBuffer(final ByteBuffer buf, final String s) {
         buf.clear();
         buf.put(s.getBytes());
         buf.flip();
         return buf;
     }
 
-    private byte[] getBytes(String s) {
+    private byte[] getBytes(final String s) {
         return s.getBytes();
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/ReflectionComparison.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/ReflectionComparison.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/ReflectionComparison.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/ReflectionComparison.java Mon Dec 10 19:36:06 2012
@@ -44,17 +44,17 @@ public class ReflectionComparison {
     @BeforeClass
     public static void setupCallerCheck() {
         try {
-            ClassLoader loader = Loader.getClassLoader();
-            Class clazz = loader.loadClass("sun.reflect.Reflection");
-            Method[] methods = clazz.getMethods();
-            for (Method method : methods) {
-                int modifier = method.getModifiers();
+            final ClassLoader loader = Loader.getClassLoader();
+            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;
                     break;
                 }
             }
-        } catch (ClassNotFoundException cnfe) {
+        } catch (final ClassNotFoundException cnfe) {
             cnfe.printStackTrace();
             throw  new RuntimeException(cnfe);
         }
@@ -62,9 +62,9 @@ public class ReflectionComparison {
 
     @Test
     public void test1() {
-        Timer timer = new Timer("Reflection", COUNT);
+        final Timer timer = new Timer("Reflection", COUNT);
         timer.start();
-        Object[] arr = new Object[1];
+        final Object[] arr = new Object[1];
         arr[0] = 3;
         for (int i= 0; i < COUNT; ++i) {
             getCallerClass(arr);
@@ -76,7 +76,7 @@ public class ReflectionComparison {
 
     @Test
     public void test2() {
-        Timer timer = new Timer("Reflection", COUNT);
+        final Timer timer = new Timer("Reflection", COUNT);
         timer.start();
         for (int i= 0; i < COUNT; ++i) {
 
@@ -97,7 +97,7 @@ public class ReflectionComparison {
         }
         timer.stop();
         System.out.println(timer.toString());
-        Class<? extends Message> clazz = StringFormattedMessage.class;
+        final Class<? extends Message> clazz = StringFormattedMessage.class;
 
         timer = new Timer("ReflectionObject", COUNT);
         timer.start();
@@ -109,12 +109,12 @@ public class ReflectionComparison {
         System.out.println(timer.toString());
     }
 
-    private Class getCallerClass(Object[] array) {
+    private Class getCallerClass(final Object[] array) {
         if (getCallerClass != null) {
             try {
                 /*Object[] params = new Object[]{index}; */
                 return (Class) getCallerClass.invoke(null, array);
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 fail(ex.getMessage());
                 // logger.debug("Unable to determine caller class via Sun Reflection", ex);
             }
@@ -122,8 +122,8 @@ public class ReflectionComparison {
         return null;
     }
 
-    private Message createMessage(Class<? extends Message> clazz, String msg, Object... params) throws Exception {
-        Constructor constructor = clazz.getConstructor(paramTypes);
+    private Message createMessage(final Class<? extends Message> clazz, final String msg, final Object... params) throws Exception {
+        final Constructor constructor = clazz.getConstructor(paramTypes);
         return (Message) constructor.newInstance(msg, params);
     }
 



Mime
View raw message