logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1419697 [7/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/config/NullConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/NullConfiguration.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/NullConfiguration.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/NullConfiguration.java Mon Dec 10 19:36:06 2012
@@ -28,7 +28,7 @@ public class NullConfiguration extends B
     public NullConfiguration() {
 
         setName(NULL_NAME);
-        LoggerConfig root = getRootLogger();
+        final LoggerConfig root = getRootLogger();
         root.setLevel(Level.OFF);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Property.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Property.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Property.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/Property.java Mon Dec 10 19:36:06 2012
@@ -31,10 +31,10 @@ public final class Property {
 
     private static final Logger LOGGER = StatusLogger.getLogger();
 
-    private String name;
-    private String value;
+    private final String name;
+    private final String value;
 
-    private Property(String name, String value) {
+    private Property(final String name, final String value) {
         this.name = name;
         this.value = value;
     }
@@ -62,8 +62,8 @@ public final class Property {
      * @return A Property.
      */
     @PluginFactory
-    public static Property createProperty(@PluginAttr("name") String key,
-                                          @PluginValue("value") String value) {
+    public static Property createProperty(@PluginAttr("name") final String key,
+                                          @PluginValue("value") final String value) {
         if (key == null) {
             LOGGER.error("Property key cannot be null");
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java Mon Dec 10 19:36:06 2012
@@ -84,24 +84,24 @@ public class XMLConfiguration extends Ba
 
     private final File configFile;
 
-    public XMLConfiguration(ConfigurationFactory.ConfigurationSource configSource) {
+    public XMLConfiguration(final ConfigurationFactory.ConfigurationSource configSource) {
         this.configFile = configSource.getFile();
         byte[] buffer = null;
 
         try {
-            InputStream configStream = configSource.getInputStream();
+            final InputStream configStream = configSource.getInputStream();
             buffer = toByteArray(configStream);
             configStream.close();
-            InputSource source = new InputSource(new ByteArrayInputStream(buffer));
-            DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
-            Document document = builder.parse(source);
+            final InputSource source = new InputSource(new ByteArrayInputStream(buffer));
+            final DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+            final Document document = builder.parse(source);
             rootElement = document.getDocumentElement();
-            Map<String, String> attrs = processAttributes(rootNode, rootElement);
+            final Map<String, String> attrs = processAttributes(rootNode, rootElement);
             Level status = Level.OFF;
             boolean verbose = false;
             PrintStream stream = System.out;
 
-            for (Map.Entry<String, String> entry : attrs.entrySet()) {
+            for (final Map.Entry<String, String> entry : attrs.entrySet()) {
                 if ("status".equalsIgnoreCase(entry.getKey())) {
                     status = Level.toLevel(getSubst().replace(entry.getValue()), null);
                     if (status == null) {
@@ -109,15 +109,15 @@ public class XMLConfiguration extends Ba
                         messages.add("Invalid status specified: " + entry.getValue() + ". Defaulting to ERROR");
                     }
                 } else if ("dest".equalsIgnoreCase(entry.getKey())) {
-                    String dest = entry.getValue();
+                    final String dest = entry.getValue();
                     if (dest != null) {
                         if (dest.equalsIgnoreCase("err")) {
                             stream = System.err;
                         } else {
                             try {
-                                File destFile = FileUtils.fileFromURI(new URI(dest));
+                                final File destFile = FileUtils.fileFromURI(new URI(dest));
                                 stream = new PrintStream(new FileOutputStream(destFile));
-                            } catch (URISyntaxException use) {
+                            } catch (final URISyntaxException use) {
                                 System.err.println("Unable to write to " + dest + ". Writing to stdout");
                             }
                         }
@@ -125,8 +125,8 @@ public class XMLConfiguration extends Ba
                 } else if ("verbose".equalsIgnoreCase(entry.getKey())) {
                     verbose = Boolean.parseBoolean(getSubst().replace(entry.getValue()));
                 } else if ("packages".equalsIgnoreCase(getSubst().replace(entry.getKey()))) {
-                    String[] packages = entry.getValue().split(",");
-                    for (String p : packages) {
+                    final String[] packages = entry.getValue().split(",");
+                    for (final String p : packages) {
                         PluginManager.addPackage(p);
                     }
                 } else if ("name".equalsIgnoreCase(entry.getKey())) {
@@ -136,16 +136,16 @@ public class XMLConfiguration extends Ba
                 } else if ("schema".equalsIgnoreCase(entry.getKey())) {
                     schema = getSubst().replace(entry.getValue());
                 } else if ("monitorInterval".equalsIgnoreCase(entry.getKey())) {
-                    int interval = Integer.parseInt(getSubst().replace(entry.getValue()));
+                    final int interval = Integer.parseInt(getSubst().replace(entry.getValue()));
                     if (interval > 0 && configFile != null) {
                         monitor = new FileConfigurationMonitor(this, configFile, listeners, interval);
                     }
                 }
             }
-            Iterator<StatusListener> iter = ((StatusLogger) LOGGER).getListeners();
+            final Iterator<StatusListener> iter = ((StatusLogger) LOGGER).getListeners();
             boolean found = false;
             while (iter.hasNext()) {
-                StatusListener listener = iter.next();
+                final StatusListener listener = iter.next();
                 if (listener instanceof StatusConsoleListener) {
                     found = true;
                     ((StatusConsoleListener) listener).setLevel(status);
@@ -155,46 +155,46 @@ public class XMLConfiguration extends Ba
                 }
             }
             if (!found && status != Level.OFF) {
-                StatusConsoleListener listener = new StatusConsoleListener(status, stream);
+                final StatusConsoleListener listener = new StatusConsoleListener(status, stream);
                 if (!verbose) {
                     listener.setFilters(VERBOSE_CLASSES);
                 }
                 ((StatusLogger) LOGGER).registerListener(listener);
-                for (String msg : messages) {
+                for (final String msg : messages) {
                     LOGGER.error(msg);
                 }
             }
 
-        } catch (SAXException domEx) {
+        } catch (final SAXException domEx) {
             LOGGER.error("Error parsing " + configSource.getLocation(), domEx);
-        } catch (IOException ioe) {
+        } catch (final IOException ioe) {
             LOGGER.error("Error parsing " + configSource.getLocation(), ioe);
-        } catch (ParserConfigurationException pex) {
+        } catch (final ParserConfigurationException pex) {
             LOGGER.error("Error parsing " + configSource.getLocation(), pex);
         }
         if (strict && schema != null && buffer != null) {
             InputStream is = null;
             try {
                 is = getClass().getClassLoader().getResourceAsStream(schema);
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 LOGGER.error("Unable to access schema " + schema);
             }
             if (is != null) {
-                Source src = new StreamSource(is, LOG4J_XSD);
-                SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+                final Source src = new StreamSource(is, LOG4J_XSD);
+                final SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
                 Schema schema = null;
                 try {
                     schema = factory.newSchema(src);
-                } catch (SAXException ex) {
+                } catch (final SAXException ex) {
                     LOGGER.error("Error parsing Log4j schema", ex);
                 }
                 if (schema != null) {
                     validator = schema.newValidator();
                     try {
                         validator.validate(new StreamSource(new ByteArrayInputStream(buffer)));
-                    } catch (IOException ioe) {
+                    } catch (final IOException ioe) {
                         LOGGER.error("Error reading configuration for validation", ioe);
-                    } catch (SAXException ex) {
+                    } catch (final SAXException ex) {
                         LOGGER.error("Error validating configuration", ex);
                     }
                 }
@@ -210,7 +210,7 @@ public class XMLConfiguration extends Ba
     public void setup() {
         constructHierarchy(rootNode, rootElement);
         if (status.size() > 0) {
-            for (Status s : status) {
+            for (final Status s : status) {
                 LOGGER.error("Error processing element " + s.name + ": " + s.errorType);
             }
             return;
@@ -221,31 +221,31 @@ public class XMLConfiguration extends Ba
     public Configuration reconfigure() {
         if (configFile != null) {
             try {
-                ConfigurationFactory.ConfigurationSource source =
+                final ConfigurationFactory.ConfigurationSource source =
                     new ConfigurationFactory.ConfigurationSource(new FileInputStream(configFile), configFile);
                 return new XMLConfiguration(source);
-            } catch (FileNotFoundException ex) {
+            } catch (final FileNotFoundException ex) {
                 LOGGER.error("Cannot locate file " + configFile, ex);
             }
         }
         return null;
     }
 
-    private void constructHierarchy(Node node, Element element) {
+    private void constructHierarchy(final Node node, final Element element) {
         processAttributes(node, element);
-        StringBuffer buffer = new StringBuffer();
-        NodeList list = element.getChildNodes();
-        List<Node> children = node.getChildren();
+        final StringBuffer buffer = new StringBuffer();
+        final NodeList list = element.getChildNodes();
+        final List<Node> children = node.getChildren();
         for (int i = 0; i < list.getLength(); i++) {
-            org.w3c.dom.Node w3cNode = list.item(i);
+            final org.w3c.dom.Node w3cNode = list.item(i);
             if (w3cNode instanceof Element) {
-                Element child = (Element) w3cNode;
-                String name = getType(child);
-                PluginType type = getPluginManager().getPluginType(name);
-                Node childNode = new Node(node, name, type);
+                final Element child = (Element) w3cNode;
+                final String name = getType(child);
+                final PluginType type = getPluginManager().getPluginType(name);
+                final Node childNode = new Node(node, name, type);
                 constructHierarchy(childNode, child);
                 if (type == null) {
-                    String value = childNode.getValue();
+                    final String value = childNode.getValue();
                     if (!childNode.hasChildren() && value != null) {
                         node.getAttributes().put(name, value);
                     } else {
@@ -255,26 +255,26 @@ public class XMLConfiguration extends Ba
                     children.add(childNode);
                 }
             } else if (w3cNode instanceof Text) {
-                Text data = (Text) w3cNode;
+                final Text data = (Text) w3cNode;
                 buffer.append(data.getData());
             }
         }
 
-        String text = buffer.toString().trim();
+        final String text = buffer.toString().trim();
         if (text.length() > 0 || (!node.hasChildren() && !node.isRoot())) {
             node.setValue(text);
         }
     }
 
-    private String getType(Element element) {
+    private String getType(final Element element) {
         if (strict) {
-            NamedNodeMap attrs = element.getAttributes();
+            final NamedNodeMap attrs = element.getAttributes();
             for (int i = 0; i < attrs.getLength(); ++i) {
-                org.w3c.dom.Node w3cNode = attrs.item(i);
+                final org.w3c.dom.Node w3cNode = attrs.item(i);
                 if (w3cNode instanceof Attr) {
-                    Attr attr = (Attr) w3cNode;
+                    final Attr attr = (Attr) w3cNode;
                     if (attr.getName().equalsIgnoreCase("type")) {
-                        String type = attr.getValue();
+                        final String type = attr.getValue();
                         attrs.removeNamedItem(attr.getName());
                         return type;
                     }
@@ -284,11 +284,11 @@ public class XMLConfiguration extends Ba
         return element.getTagName();
     }
 
-    private byte[] toByteArray(InputStream is) throws IOException {
-        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+    private byte[] toByteArray(final InputStream is) throws IOException {
+        final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
 
         int nRead;
-        byte[] data = new byte[BUF_SIZE];
+        final byte[] data = new byte[BUF_SIZE];
 
         while ((nRead = is.read(data, 0, data.length)) != -1) {
             buffer.write(data, 0, nRead);
@@ -297,14 +297,14 @@ public class XMLConfiguration extends Ba
         return buffer.toByteArray();
     }
 
-    private Map<String, String> processAttributes(Node node, Element element) {
-        NamedNodeMap attrs = element.getAttributes();
-        Map<String, String> attributes = node.getAttributes();
+    private Map<String, String> processAttributes(final Node node, final Element element) {
+        final NamedNodeMap attrs = element.getAttributes();
+        final Map<String, String> attributes = node.getAttributes();
 
         for (int i = 0; i < attrs.getLength(); ++i) {
-            org.w3c.dom.Node w3cNode = attrs.item(i);
+            final org.w3c.dom.Node w3cNode = attrs.item(i);
             if (w3cNode instanceof Attr) {
-                Attr attr = (Attr) w3cNode;
+                final Attr attr = (Attr) w3cNode;
                 attributes.put(attr.getName(), attr.getValue());
             }
         }
@@ -326,7 +326,7 @@ public class XMLConfiguration extends Ba
         private final String name;
         private final ErrorType errorType;
 
-        public Status(String name, Element element, ErrorType errorType) {
+        public Status(final String name, final Element element, final ErrorType errorType) {
             this.name = name;
             this.element = element;
             this.errorType = errorType;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfigurationFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfigurationFactory.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfigurationFactory.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfigurationFactory.java Mon Dec 10 19:36:06 2012
@@ -36,7 +36,7 @@ public class XMLConfigurationFactory ext
      * @return The Configuration.
      */
     @Override
-    public Configuration getConfiguration(ConfigurationSource source) {
+    public Configuration getConfiguration(final ConfigurationSource source) {
         return new XMLConfiguration(source);
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/AppendersPlugin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/AppendersPlugin.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/AppendersPlugin.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/AppendersPlugin.java Mon Dec 10 19:36:06 2012
@@ -36,10 +36,10 @@ public final class AppendersPlugin {
      * @return The Appender Map.
      */
     @PluginFactory
-    public static ConcurrentMap<String, Appender> createAppenders(@PluginElement("appenders") Appender[] appenders) {
-        ConcurrentMap<String, Appender> map = new ConcurrentHashMap<String, Appender>();
+    public static ConcurrentMap<String, Appender> createAppenders(@PluginElement("appenders") final Appender[] appenders) {
+        final ConcurrentMap<String, Appender> map = new ConcurrentHashMap<String, Appender>();
 
-        for (Appender appender : appenders) {
+        for (final Appender appender : appenders) {
                 map.put(appender.getName(), appender);
         }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/LoggersPlugin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/LoggersPlugin.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/LoggersPlugin.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/LoggersPlugin.java Mon Dec 10 19:36:06 2012
@@ -37,11 +37,11 @@ public final class LoggersPlugin {
      * @return A Loggers object.
      */
     @PluginFactory
-    public static Loggers createLoggers(@PluginElement("loggers") LoggerConfig[] loggers) {
-        ConcurrentMap<String, LoggerConfig> loggerMap = new ConcurrentHashMap<String, LoggerConfig>();
+    public static Loggers createLoggers(@PluginElement("loggers") final LoggerConfig[] loggers) {
+        final ConcurrentMap<String, LoggerConfig> loggerMap = new ConcurrentHashMap<String, LoggerConfig>();
         LoggerConfig root = null;
 
-        for (LoggerConfig logger : loggers) {
+        for (final LoggerConfig logger : loggers) {
             if (logger != null) {
                 if (logger.getName().length() == 0) {
                     root = logger;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java Mon Dec 10 19:36:06 2012
@@ -64,7 +64,7 @@ public class PluginManager {
      * Constructor that takes only a type name.
      * @param type The type name.
      */
-    public PluginManager(String type) {
+    public PluginManager(final String type) {
         this.type = type;
         this.clazz = null;
     }
@@ -74,20 +74,20 @@ public class PluginManager {
      * @param type The type that must be matched.
      * @param clazz The Class each match must be an instance of.
      */
-    public PluginManager(String type, Class clazz) {
+    public PluginManager(final String type, final Class clazz) {
         this.type = type;
         this.clazz = clazz;
     }
 
-    public static void main(String[] args) throws Exception {
+    public static void main(final String[] args) throws Exception {
         if (args == null || args.length < 1) {
             System.err.println("A target directory must be specified");
             System.exit(-1);
         }
         rootDir = args[0].endsWith("/") || args[0].endsWith("\\") ? args[0] : args[0] + "/";
 
-        PluginManager manager = new PluginManager("Core");
-        String packages = args.length == 2 ? args[1] : null;
+        final PluginManager manager = new PluginManager("Core");
+        final String packages = args.length == 2 ? args[1] : null;
 
         manager.collectPlugins(false, packages);
         encode(pluginTypeMap);
@@ -97,7 +97,7 @@ public class PluginManager {
      * Adds a package name to be scanned for plugins. Must be invoked prior to plugins being collected.
      * @param p The package name.
      */
-    public static void addPackage(String p) {
+    public static void addPackage(final String p) {
         packages.addIfAbsent(p);
     }
 
@@ -106,7 +106,7 @@ public class PluginManager {
      * @param name The name of the plugin.
      * @return The plugin's type.
      */
-    public PluginType getPluginType(String name) {
+    public PluginType getPluginType(final String name) {
         return plugins.get(name.toLowerCase());
     }
 
@@ -131,19 +131,19 @@ public class PluginManager {
      * @param pkgs A comma separated list of package names to scan for plugins. If
      * null the default Log4j package name will be used.
      */
-    public void collectPlugins(boolean preLoad, String pkgs) {
+    public void collectPlugins(boolean preLoad, final String pkgs) {
         if (pluginTypeMap.containsKey(type)) {
             plugins = pluginTypeMap.get(type);
             preLoad = false;
         }
-        long start = System.nanoTime();
-        ResolverUtil<?> resolver = new ResolverUtil();
-        ClassLoader loader = Loader.getClassLoader();
+        final long start = System.nanoTime();
+        final ResolverUtil<?> resolver = new ResolverUtil();
+        final ClassLoader loader = Loader.getClassLoader();
         if (loader != null) {
             resolver.setClassLoader(loader);
         }
         if (preLoad) {
-            ConcurrentMap<String, ConcurrentMap<String, PluginType>> map = decode(loader);
+            final ConcurrentMap<String, ConcurrentMap<String, PluginType>> map = decode(loader);
             if (map != null) {
                 pluginTypeMap = map;
                 plugins = map.get(type);
@@ -155,32 +155,32 @@ public class PluginManager {
             if (pkgs == null) {
                 packages.add(LOG4J_PACKAGES);
             } else {
-                String[] names = pkgs.split(",");
-                for (String name : names) {
+                final String[] names = pkgs.split(",");
+                for (final String name : names) {
                     packages.add(name);
                 }
             }
         }
-        ResolverUtil.Test test = new PluginTest(clazz);
-        for (String pkg : packages) {
+        final ResolverUtil.Test test = new PluginTest(clazz);
+        for (final String pkg : packages) {
             resolver.findInPackage(test, pkg);
         }
-        for (Class<?> item : resolver.getClasses()) {
-            Plugin p = item.getAnnotation(Plugin.class);
-            String pluginType = p.type();
+        for (final Class<?> item : resolver.getClasses()) {
+            final Plugin p = item.getAnnotation(Plugin.class);
+            final String pluginType = p.type();
             if (!pluginTypeMap.containsKey(pluginType)) {
                 pluginTypeMap.putIfAbsent(pluginType, new ConcurrentHashMap<String, PluginType>());
             }
-            Map<String, PluginType> map = pluginTypeMap.get(pluginType);
-            String type = p.elementType().equals(Plugin.EMPTY) ? p.name() : p.elementType();
+            final Map<String, PluginType> map = pluginTypeMap.get(pluginType);
+            final String type = p.elementType().equals(Plugin.EMPTY) ? p.name() : p.elementType();
             map.put(p.name().toLowerCase(), new PluginType(item, type, p.printObject(), p.deferChildren()));
         }
         long elapsed = System.nanoTime() - start;
         plugins = pluginTypeMap.get(type);
-        StringBuilder sb = new StringBuilder("Generated plugins");
+        final StringBuilder sb = new StringBuilder("Generated plugins");
         sb.append(" in ");
         DecimalFormat numFormat = new DecimalFormat("#0");
-        long seconds = elapsed / NANOS_PER_SECOND;
+        final long seconds = elapsed / NANOS_PER_SECOND;
         elapsed %= NANOS_PER_SECOND;
         sb.append(numFormat.format(seconds)).append('.');
         numFormat = new DecimalFormat("000000000");
@@ -188,44 +188,44 @@ public class PluginManager {
         LOGGER.debug(sb.toString());
     }
 
-    private static ConcurrentMap<String, ConcurrentMap<String, PluginType>> decode(ClassLoader loader) {
+    private static ConcurrentMap<String, ConcurrentMap<String, PluginType>> decode(final ClassLoader loader) {
         Enumeration<URL> resources;
         try {
             resources = loader.getResources(PATH + FILENAME);
-        } catch (IOException ioe) {
+        } catch (final IOException ioe) {
             LOGGER.warn("Unable to preload plugins", ioe);
             return null;
         }
-        ConcurrentMap<String, ConcurrentMap<String, PluginType>> map =
+        final ConcurrentMap<String, ConcurrentMap<String, PluginType>> map =
             new ConcurrentHashMap<String, ConcurrentMap<String, PluginType>>();
         while (resources.hasMoreElements()) {
             try {
-                URL url = resources.nextElement();
+                final URL url = resources.nextElement();
                 LOGGER.debug("Found Plugin Map at {}", url.toExternalForm());
-                InputStream is = url.openStream();
-                BufferedInputStream bis = new BufferedInputStream(is);
-                DataInputStream dis = new DataInputStream(bis);
-                int count = dis.readInt();
+                final InputStream is = url.openStream();
+                final BufferedInputStream bis = new BufferedInputStream(is);
+                final DataInputStream dis = new DataInputStream(bis);
+                final int count = dis.readInt();
                 for (int j = 0; j < count; ++j) {
-                    String type = dis.readUTF();
-                    int entries = dis.readInt();
+                    final String type = dis.readUTF();
+                    final int entries = dis.readInt();
                     ConcurrentMap<String, PluginType> types = map.get(type);
                     if (types == null) {
                         types = new ConcurrentHashMap<String, PluginType>(count);
                     }
                     for (int i = 0; i < entries; ++i) {
-                        String key = dis.readUTF();
-                        String className = dis.readUTF();
-                        String name = dis.readUTF();
-                        boolean printable = dis.readBoolean();
-                        boolean defer = dis.readBoolean();
-                        Class clazz = Class.forName(className);
+                        final String key = dis.readUTF();
+                        final String className = dis.readUTF();
+                        final String name = dis.readUTF();
+                        final boolean printable = dis.readBoolean();
+                        final boolean defer = dis.readBoolean();
+                        final Class clazz = Class.forName(className);
                         types.put(key, new PluginType(clazz, name, printable, defer));
                     }
                     map.putIfAbsent(type, types);
                 }
                 dis.close();
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 LOGGER.warn("Unable to preload plugins", ex);
                 return null;
             }
@@ -233,21 +233,21 @@ public class PluginManager {
         return map.size() == 0 ? null : map;
     }
 
-    private static void encode(ConcurrentMap<String, ConcurrentMap<String, PluginType>> map) {
-        String fileName = rootDir + PATH + FILENAME;
+    private static void encode(final ConcurrentMap<String, ConcurrentMap<String, PluginType>> map) {
+        final String fileName = rootDir + PATH + FILENAME;
         try {
-            File file = new File(rootDir + PATH);
+            final File file = new File(rootDir + PATH);
             file.mkdirs();
-            FileOutputStream fos = new FileOutputStream(fileName);
-            BufferedOutputStream bos = new BufferedOutputStream(fos);
-            DataOutputStream dos = new DataOutputStream(bos);
+            final FileOutputStream fos = new FileOutputStream(fileName);
+            final BufferedOutputStream bos = new BufferedOutputStream(fos);
+            final DataOutputStream dos = new DataOutputStream(bos);
             dos.writeInt(map.size());
-            for (Map.Entry<String, ConcurrentMap<String, PluginType>> outer : map.entrySet()) {
+            for (final Map.Entry<String, ConcurrentMap<String, PluginType>> outer : map.entrySet()) {
                 dos.writeUTF(outer.getKey());
                 dos.writeInt(outer.getValue().size());
-                for (Map.Entry<String, PluginType> entry : outer.getValue().entrySet()) {
+                for (final Map.Entry<String, PluginType> entry : outer.getValue().entrySet()) {
                     dos.writeUTF(entry.getKey());
-                    PluginType pt = entry.getValue();
+                    final PluginType pt = entry.getValue();
                     dos.writeUTF(pt.getPluginClass().getName());
                     dos.writeUTF(pt.getElementName());
                     dos.writeBoolean(pt.isObjectPrintable());
@@ -255,7 +255,7 @@ public class PluginManager {
                 }
             }
             dos.close();
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             ex.printStackTrace();
         }
     }
@@ -271,7 +271,7 @@ public class PluginManager {
          * Constructs an AnnotatedWith test for the specified annotation type.
          * @param isA The class to compare against.
          */
-        public PluginTest(Class isA) {
+        public PluginTest(final Class isA) {
             this.isA = isA;
         }
 
@@ -280,14 +280,14 @@ public class PluginManager {
          * @param type The type to check for.
          * @return true if the Class is of the specified type.
          */
-        public boolean matches(Class type) {
+        public boolean matches(final Class type) {
             return type != null && type.isAnnotationPresent(Plugin.class) &&
                 (isA == null || isA.isAssignableFrom(type));
         }
 
         @Override
         public String toString() {
-            StringBuilder msg = new StringBuilder("annotated with @" + Plugin.class.getSimpleName());
+            final StringBuilder msg = new StringBuilder("annotated with @" + Plugin.class.getSimpleName());
             if (isA != null) {
                 msg.append(" is assignable to " + isA.getSimpleName());
             }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginType.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginType.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginType.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginType.java Mon Dec 10 19:36:06 2012
@@ -31,7 +31,7 @@ public class PluginType<T> implements Se
     private boolean printObject = false;
     private boolean deferChildren = false;
 
-    public PluginType(Class<T> clazz, String name, boolean printObj, boolean deferChildren) {
+    public PluginType(final Class<T> clazz, final String name, final boolean printObj, final boolean deferChildren) {
         this.pluginClass = clazz;
         this.elementName = name;
         this.printObject = printObj;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PropertiesPlugin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PropertiesPlugin.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PropertiesPlugin.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PropertiesPlugin.java Mon Dec 10 19:36:06 2012
@@ -39,13 +39,13 @@ public final class PropertiesPlugin {
      * @return An Interpolator that includes the configuration properties.
      */
     @PluginFactory
-    public static StrLookup configureSubstitutor(@PluginElement("properties") Property[] properties) {
+    public static StrLookup configureSubstitutor(@PluginElement("properties") final Property[] properties) {
         if (properties == null) {
             return new Interpolator(null);
         }
-        Map<String, String> map = new HashMap<String, String>();
+        final Map<String, String> map = new HashMap<String, String>();
 
-        for (Property prop : properties) {
+        for (final Property prop : properties) {
             map.put(prop.getName(), prop.getValue());
         }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/ResolverUtil.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/ResolverUtil.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/ResolverUtil.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/ResolverUtil.java Mon Dec 10 19:36:06 2012
@@ -82,10 +82,10 @@ public class ResolverUtil<T> {
     private static final String BUNDLE_RESOURCE = "bundleresource";
 
     /** The set of matches being accumulated. */
-    private Set<Class<? extends T>> classMatches = new HashSet<Class<?extends T>>();
+    private final Set<Class<? extends T>> classMatches = new HashSet<Class<?extends T>>();
 
     /** The set of matches being accumulated. */
-    private Set<URI> resourceMatches = new HashSet<URI>();
+    private final Set<URI> resourceMatches = new HashSet<URI>();
 
     /**
      * The ClassLoader to use when looking for classes. If null then the ClassLoader returned
@@ -128,7 +128,7 @@ public class ResolverUtil<T> {
      *
      * @param classloader a ClassLoader to use when scanning for classes
      */
-    public void setClassLoader(ClassLoader classloader) { this.classloader = classloader; }
+    public void setClassLoader(final ClassLoader classloader) { this.classloader = classloader; }
 
     /**
      * Attempts to discover classes that are assignable to the type provided. In the case
@@ -139,13 +139,13 @@ public class ResolverUtil<T> {
      * @param parent the class of interface to find subclasses or implementations of
      * @param packageNames one or more package names to scan (including subpackages) for classes
      */
-    public void findImplementations(Class parent, String... packageNames) {
+    public void findImplementations(final Class parent, final String... packageNames) {
         if (packageNames == null) {
             return;
         }
 
-        Test test = new IsA(parent);
-        for (String pkg : packageNames) {
+        final Test test = new IsA(parent);
+        for (final String pkg : packageNames) {
             findInPackage(test, pkg);
         }
     }
@@ -157,13 +157,13 @@ public class ResolverUtil<T> {
      * @param suffix The class name suffix to match
      * @param packageNames one or more package names to scan (including subpackages) for classes
      */
-    public void findSuffix(String suffix, String... packageNames) {
+    public void findSuffix(final String suffix, final String... packageNames) {
         if (packageNames == null) {
             return;
         }
 
-        Test test = new NameEndsWith(suffix);
-        for (String pkg : packageNames) {
+        final Test test = new NameEndsWith(suffix);
+        for (final String pkg : packageNames) {
             findInPackage(test, pkg);
         }
     }
@@ -175,24 +175,24 @@ public class ResolverUtil<T> {
      * @param annotation the annotation that should be present on matching classes
      * @param packageNames one or more package names to scan (including subpackages) for classes
      */
-    public void findAnnotated(Class<? extends Annotation> annotation, String... packageNames) {
+    public void findAnnotated(final Class<? extends Annotation> annotation, final String... packageNames) {
         if (packageNames == null) {
             return;
         }
 
-        Test test = new AnnotatedWith(annotation);
-        for (String pkg : packageNames) {
+        final Test test = new AnnotatedWith(annotation);
+        for (final String pkg : packageNames) {
             findInPackage(test, pkg);
         }
     }
 
-    public void findNamedResource(String name, String... pathNames) {
+    public void findNamedResource(final String name, final String... pathNames) {
         if (pathNames == null) {
             return;
         }
 
-        Test test = new NameIs(name);
-        for (String pkg : pathNames) {
+        final Test test = new NameIs(name);
+        for (final String pkg : pathNames) {
             findInPackage(test, pkg);
         }
     }
@@ -204,12 +204,12 @@ public class ResolverUtil<T> {
      * @param test the test to determine matching classes
      * @param packageNames one or more package names to scan (including subpackages) for classes
      */
-    public void find(Test test, String... packageNames) {
+    public void find(final Test test, final String... packageNames) {
         if (packageNames == null) {
             return;
         }
 
-        for (String pkg : packageNames) {
+        for (final String pkg : packageNames) {
             findInPackage(test, pkg);
         }
     }
@@ -224,21 +224,21 @@ public class ResolverUtil<T> {
      * @param packageName the name of the package from which to start scanning for
      *        classes, e.g. {@code net.sourceforge.stripes}
      */
-    public void findInPackage(Test test, String packageName) {
+    public void findInPackage(final Test test, String packageName) {
         packageName = packageName.replace('.', '/');
-        ClassLoader loader = getClassLoader();
+        final ClassLoader loader = getClassLoader();
         Enumeration<URL> urls;
 
         try {
             urls = loader.getResources(packageName);
-        } catch (IOException ioe) {
+        } catch (final IOException ioe) {
             LOG.warn("Could not read package: " + packageName, ioe);
             return;
         }
 
         while (urls.hasMoreElements()) {
             try {
-                URL url = urls.nextElement();
+                final URL url = urls.nextElement();
                 String urlPath = url.getFile();
                 urlPath = URLDecoder.decode(urlPath, "UTF-8");
 
@@ -255,30 +255,30 @@ public class ResolverUtil<T> {
                 LOG.info("Scanning for classes in [" + urlPath + "] matching criteria: " + test);
                 // Check for a jar in a war in JBoss
                 if (VFSZIP.equals(url.getProtocol())) {
-                    String path = urlPath.substring(0, urlPath.length() - packageName.length() - 2);
-                    URL newURL = new URL(url.getProtocol(), url.getHost(), path);
-                    JarInputStream stream = new JarInputStream(newURL.openStream());
+                    final String path = urlPath.substring(0, urlPath.length() - packageName.length() - 2);
+                    final URL newURL = new URL(url.getProtocol(), url.getHost(), path);
+                    final JarInputStream stream = new JarInputStream(newURL.openStream());
                     loadImplementationsInJar(test, packageName, path, stream);
                 } else if (BUNDLE_RESOURCE.equals(url.getProtocol())) {
                     loadImplementationsInBundle(test, packageName);
                 } else {
-                    File file = new File(urlPath);
+                    final File file = new File(urlPath);
                     if (file.isDirectory()) {
                         loadImplementationsInDirectory(test, packageName, file);
                     } else {
                         loadImplementationsInJar(test, packageName, file);
                     }
                 }
-            } catch (IOException ioe) {
+            } catch (final IOException ioe) {
                 LOG.warn("could not read entries", ioe);
             }
         }
     }
 
-    private void loadImplementationsInBundle(Test test, String packageName) {
-        BundleWiring wiring = (BundleWiring)FrameworkUtil.getBundle(ResolverUtil.class).adapt(BundleWiring.class);
-        Collection<String> list = wiring.listResources(packageName, "*.class", BundleWiring.LISTRESOURCES_RECURSE);
-        for (String name : list) {
+    private void loadImplementationsInBundle(final Test test, final String packageName) {
+        final BundleWiring wiring = (BundleWiring)FrameworkUtil.getBundle(ResolverUtil.class).adapt(BundleWiring.class);
+        final Collection<String> list = wiring.listResources(packageName, "*.class", BundleWiring.LISTRESOURCES_RECURSE);
+        for (final String name : list) {
             addIfMatching(test, name);
         }
     }
@@ -296,14 +296,14 @@ public class ResolverUtil<T> {
      *        the values of <i>parent</i> would be <i>org/apache</i>
      * @param location a File object representing a directory
      */
-    private void loadImplementationsInDirectory(Test test, String parent, File location) {
-        File[] files = location.listFiles();
+    private void loadImplementationsInDirectory(final Test test, final String parent, final File location) {
+        final File[] files = location.listFiles();
         StringBuilder builder;
 
-        for (File file : files) {
+        for (final File file : files) {
             builder = new StringBuilder();
             builder.append(parent).append("/").append(file.getName());
-            String packageOrClass = parent == null ? file.getName() : builder.toString();
+            final String packageOrClass = parent == null ? file.getName() : builder.toString();
 
             if (file.isDirectory()) {
                 loadImplementationsInDirectory(test, packageOrClass, file);
@@ -313,7 +313,7 @@ public class ResolverUtil<T> {
         }
     }
 
-    private boolean isTestApplicable(Test test, String path) {
+    private boolean isTestApplicable(final Test test, final String path) {
         return test.doesMatchResource() || path.endsWith(".class") && test.doesMatchClass();
     }
 
@@ -326,15 +326,15 @@ public class ResolverUtil<T> {
      * @param parent the parent package under which classes must be in order to be considered
      * @param jarfile the jar file to be examined for classes
      */
-    private void loadImplementationsInJar(Test test, String parent, File jarfile) {
+    private void loadImplementationsInJar(final Test test, final String parent, final File jarfile) {
         JarInputStream jarStream;
         try {
             jarStream = new JarInputStream(new FileInputStream(jarfile));
             loadImplementationsInJar(test, parent, jarfile.getPath(), jarStream);
-        } catch (FileNotFoundException ex) {
+        } catch (final FileNotFoundException ex) {
             LOG.error("Could not search jar file '" + jarfile + "' for classes matching criteria: " +
                 test + " file not found");
-        } catch (IOException ioe) {
+        } catch (final IOException ioe) {
             LOG.error("Could not search jar file '" + jarfile + "' for classes matching criteria: " +
                 test + " due to an IOException", ioe);
         }
@@ -349,18 +349,18 @@ public class ResolverUtil<T> {
      * @param parent the parent package under which classes must be in order to be considered
      * @param stream The jar InputStream
      */
-    private void loadImplementationsInJar(Test test, String parent, String path, JarInputStream stream) {
+    private void loadImplementationsInJar(final Test test, final String parent, final String path, final JarInputStream stream) {
 
         try {
             JarEntry entry;
 
             while ((entry = stream.getNextJarEntry()) != null) {
-                String name = entry.getName();
+                final String name = entry.getName();
                 if (!entry.isDirectory() && name.startsWith(parent) && isTestApplicable(test, name)) {
                     addIfMatching(test, name);
                 }
             }
-        } catch (IOException ioe) {
+        } catch (final IOException ioe) {
             LOG.error("Could not search jar file '" + path + "' for classes matching criteria: " +
                 test + " due to an IOException", ioe);
         }
@@ -373,16 +373,16 @@ public class ResolverUtil<T> {
      * @param test the test used to determine if the class matches
      * @param fqn the fully qualified name of a class
      */
-    protected void addIfMatching(Test test, String fqn) {
+    protected void addIfMatching(final Test test, final String fqn) {
         try {
-            ClassLoader loader = getClassLoader();
+            final ClassLoader loader = getClassLoader();
             if (test.doesMatchClass()) {
-                String externalName = fqn.substring(0, fqn.indexOf('.')).replace('/', '.');
+                final String externalName = fqn.substring(0, fqn.indexOf('.')).replace('/', '.');
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("Checking to see if class " + externalName + " matches criteria [" + test + "]");
                 }
 
-                Class type = loader.loadClass(externalName);
+                final Class type = loader.loadClass(externalName);
                 if (test.matches(type)) {
                     classMatches.add(type);
                 }
@@ -396,7 +396,7 @@ public class ResolverUtil<T> {
                     resourceMatches.add(url.toURI());
                 }
             }
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             LOG.warn("Could not examine class '" + fqn + "' due to a " +
                 t.getClass().getName() + " with message: " + t.getMessage());
         }
@@ -430,7 +430,7 @@ public class ResolverUtil<T> {
      * Test against a Class.
      */
     public abstract static class ClassTest implements Test {
-        public boolean matches(URI resource) {
+        public boolean matches(final URI resource) {
             throw new UnsupportedOperationException();
         }
 
@@ -446,7 +446,7 @@ public class ResolverUtil<T> {
      * Test against a resource.
      */
     public abstract static class ResourceTest implements Test {
-        public boolean matches(Class cls) {
+        public boolean matches(final Class cls) {
             throw new UnsupportedOperationException();
         }
 
@@ -469,14 +469,14 @@ public class ResolverUtil<T> {
          * Constructs an IsA test using the supplied Class as the parent class/interface.
          * @param parentType The parent class to check for.
          */
-        public IsA(Class parentType) { this.parent = parentType; }
+        public IsA(final Class parentType) { this.parent = parentType; }
 
         /**
          * Returns true if type is assignable to the parent type supplied in the constructor.
          * @param type The Class to check.
          * @return true if the Class matches.
          */
-        public boolean matches(Class type) {
+        public boolean matches(final Class type) {
             return type != null && parent.isAssignableFrom(type);
         }
 
@@ -496,14 +496,14 @@ public class ResolverUtil<T> {
          * Constructs a NameEndsWith test using the supplied suffix.
          * @param suffix the String suffix to check for.
          */
-        public NameEndsWith(String suffix) { this.suffix = suffix; }
+        public NameEndsWith(final String suffix) { this.suffix = suffix; }
 
         /**
          * Returns true if type name ends with the suffix supplied in the constructor.
          * @param type The Class to check.
          * @return true if the Class matches.
          */
-        public boolean matches(Class type) {
+        public boolean matches(final Class type) {
             return type != null && type.getName().endsWith(suffix);
         }
 
@@ -524,7 +524,7 @@ public class ResolverUtil<T> {
          * Constructs an AnnotatedWith test for the specified annotation type.
          * @param annotation The annotation to check for.
          */
-        public AnnotatedWith(Class<? extends Annotation> annotation) {
+        public AnnotatedWith(final Class<? extends Annotation> annotation) {
             this.annotation = annotation;
         }
 
@@ -533,7 +533,7 @@ public class ResolverUtil<T> {
          * @param type the Class to match against.
          * @return true if the Classes match.
          */
-        public boolean matches(Class type) {
+        public boolean matches(final Class type) {
             return type != null && type.isAnnotationPresent(annotation);
         }
 
@@ -549,9 +549,9 @@ public class ResolverUtil<T> {
     public static class NameIs extends ResourceTest {
         private final String name;
 
-        public NameIs(String name) { this.name = "/" + name; }
+        public NameIs(final String name) { this.name = "/" + name; }
 
-        public boolean matches(URI resource) {
+        public boolean matches(final URI resource) {
             return resource.getPath().endsWith(name);
         }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java Mon Dec 10 19:36:06 2012
@@ -61,7 +61,7 @@ public abstract class AbstractFilter imp
      * @param onMatch The result to return when a match occurs.
      * @param onMismatch The result to return when a match dos not occur.
      */
-    protected AbstractFilter(Result onMatch, Result onMismatch) {
+    protected AbstractFilter(final Result onMatch, final Result onMismatch) {
         this.onMatch = onMatch == null ? Result.NEUTRAL : onMatch;
         this.onMismatch = onMismatch == null ? Result.DENY : onMismatch;
     }
@@ -118,7 +118,7 @@ public abstract class AbstractFilter imp
      * @param params An array of parameters or null.
      * @return The Result of filtering.
      */
-    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 Result.NEUTRAL;
     }
 
@@ -131,7 +131,7 @@ public abstract class AbstractFilter imp
      * @param t A throwable or null.
      * @return The Result of filtering.
      */
-    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 Result.NEUTRAL;
     }
 
@@ -144,7 +144,7 @@ public abstract class AbstractFilter imp
      * @param t A throwable or null.
      * @return The Result of filtering.
      */
-    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 Result.NEUTRAL;
     }
 
@@ -153,7 +153,7 @@ public abstract class AbstractFilter imp
      * @param event The LogEvent.
      * @return The Result of filtering.
      */
-    public Result filter(LogEvent event) {
+    public Result filter(final LogEvent event) {
         return Result.NEUTRAL;
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java Mon Dec 10 19:36:06 2012
@@ -29,7 +29,7 @@ public abstract class AbstractFilterable
 
     private volatile Filter filter;
 
-    protected AbstractFilterable(Filter filter) {
+    protected AbstractFilterable(final Filter filter) {
         this.filter = filter;
     }
 
@@ -48,13 +48,13 @@ public abstract class AbstractFilterable
      * Add a filter.
      * @param filter The Filter to add.
      */
-    public synchronized void addFilter(Filter filter) {
+    public synchronized void addFilter(final Filter filter) {
         if (this.filter == null) {
             this.filter = filter;
         } else if (filter instanceof CompositeFilter) {
             this.filter = ((CompositeFilter) this.filter).addFilter(filter);
         } else {
-            Filter[] filters = new Filter[] {this.filter, filter};
+            final Filter[] filters = new Filter[] {this.filter, filter};
             this.filter = CompositeFilter.createFilters(filters);
         }
     }
@@ -63,7 +63,7 @@ public abstract class AbstractFilterable
      * Remove a Filter.
      * @param filter The Filter to remove.
      */
-    public synchronized void removeFilter(Filter filter) {
+    public synchronized void removeFilter(final Filter filter) {
         if (this.filter == filter) {
             this.filter = null;
         } else if (filter instanceof CompositeFilter) {
@@ -72,7 +72,7 @@ public abstract class AbstractFilterable
             if (composite.size() > 1) {
                 this.filter = composite;
             } else if (composite.size() == 1) {
-                Iterator<Filter> iter = composite.iterator();
+                final Iterator<Filter> iter = composite.iterator();
                 this.filter = iter.next();
             } else {
                 this.filter = null;
@@ -111,7 +111,7 @@ public abstract class AbstractFilterable
      * @param event The LogEvent.
      * @return true if the LogEvent should be processed.
      */
-    public boolean isFiltered(LogEvent event) {
+    public boolean isFiltered(final LogEvent event) {
         return filter != null && filter.filter(event) == Filter.Result.DENY;
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java Mon Dec 10 19:36:06 2012
@@ -77,7 +77,7 @@ public final class BurstFilter extends A
 
     private final Queue<LogDelay> available = new ConcurrentLinkedQueue<LogDelay>();
 
-    private BurstFilter(Level level, float rate, long maxBurst, Result onMatch, Result onMismatch) {
+    private BurstFilter(final Level level, final float rate, final long maxBurst, final Result onMatch, final Result onMismatch) {
         super(onMatch, onMismatch);
         this.level = level;
         this.burstInterval = (long) (NANOS_IN_SECONDS * (maxBurst / rate));
@@ -87,22 +87,22 @@ public final class BurstFilter extends A
     }
 
     @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());
     }
 
@@ -113,7 +113,7 @@ public final class BurstFilter extends A
      * @param level The log level.
      * @return The onMatch value if the filter passes, onMismatch otherwise.
      */
-    private Result filter(Level level) {
+    private Result filter(final Level level) {
         if (this.level.isAtLeastAsSpecificAs(level)) {
             LogDelay delay = history.poll();
             while (delay != null) {
@@ -144,9 +144,9 @@ public final class BurstFilter extends A
      * Clear the history. Used for unit testing.
      */
     public void clear() {
-        Iterator<LogDelay> iter = history.iterator();
+        final Iterator<LogDelay> iter = history.iterator();
         while (iter.hasNext()) {
-            LogDelay delay = iter.next();
+            final LogDelay delay = iter.next();
             history.remove(delay);
             available.add(delay);
         }
@@ -167,15 +167,15 @@ public final class BurstFilter extends A
         public LogDelay() {
         }
 
-        public void setDelay(long delay) {
+        public void setDelay(final long delay) {
             this.expireTime = delay + System.nanoTime();
         }
 
-        public long getDelay(TimeUnit timeUnit) {
+        public long getDelay(final TimeUnit timeUnit) {
             return timeUnit.convert(expireTime - System.nanoTime(), TimeUnit.NANOSECONDS);
         }
 
-        public int compareTo(Delayed delayed) {
+        public int compareTo(final Delayed delayed) {
             if (this.expireTime < ((LogDelay) delayed).expireTime) {
                 return -1;
             } else if (this.expireTime > ((LogDelay) delayed).expireTime) {
@@ -185,7 +185,7 @@ public final class BurstFilter extends A
         }
 
         @Override
-        public boolean equals(Object o) {
+        public boolean equals(final Object o) {
             if (this == o) {
                 return true;
             }
@@ -193,7 +193,7 @@ public final class BurstFilter extends A
                 return false;
             }
 
-            LogDelay logDelay = (LogDelay) o;
+            final LogDelay logDelay = (LogDelay) o;
 
             if (expireTime != logDelay.expireTime) {
                 return false;
@@ -218,19 +218,19 @@ public final class BurstFilter extends A
      * @return A BurstFilter.
      */
     @PluginFactory
-    public static BurstFilter createFilter(@PluginAttr("level") String levelName,
-                                           @PluginAttr("rate") String rate,
-                                           @PluginAttr("maxBurst") String maxBurst,
-                                           @PluginAttr("onmatch") String match,
-                                           @PluginAttr("onmismatch") String mismatch) {
-        Result onMatch = Result.toResult(match, Result.NEUTRAL);
-        Result onMismatch = Result.toResult(mismatch, Result.DENY);
-        Level level = Level.toLevel(levelName, Level.WARN);
+    public static BurstFilter createFilter(@PluginAttr("level") final String levelName,
+                                           @PluginAttr("rate") final String rate,
+                                           @PluginAttr("maxBurst") final String maxBurst,
+                                           @PluginAttr("onmatch") final String match,
+                                           @PluginAttr("onmismatch") final String mismatch) {
+        final Result onMatch = Result.toResult(match, Result.NEUTRAL);
+        final Result onMismatch = Result.toResult(mismatch, Result.DENY);
+        final Level level = Level.toLevel(levelName, Level.WARN);
         float eventRate = rate == null ? DEFAULT_RATE : Float.parseFloat(rate);
         if (eventRate <= 0) {
             eventRate = DEFAULT_RATE;
         }
-        long max = maxBurst == null ? (long) (eventRate * DEFAULT_RATE_MULTIPLE) : Long.parseLong(maxBurst);
+        final long max = maxBurst == null ? (long) (eventRate * DEFAULT_RATE_MULTIPLE) : Long.parseLong(maxBurst);
         return new BurstFilter(level, eventRate, max, onMatch, onMismatch);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/CompositeFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/CompositeFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/CompositeFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/CompositeFilter.java Mon Dec 10 19:36:06 2012
@@ -49,7 +49,7 @@ public final class CompositeFilter imple
         this.hasFilters = false;
     }
 
-    private CompositeFilter(List<Filter> filters) {
+    private CompositeFilter(final List<Filter> filters) {
         if (filters == null) {
             this.filters = Collections.unmodifiableList(new ArrayList<Filter>());
             this.hasFilters = false;
@@ -59,14 +59,14 @@ public final class CompositeFilter imple
         this.hasFilters = this.filters.size() > 0;
     }
 
-    public CompositeFilter addFilter(Filter filter) {
-        List<Filter> filters = new ArrayList<Filter>(this.filters);
+    public CompositeFilter addFilter(final Filter filter) {
+        final List<Filter> filters = new ArrayList<Filter>(this.filters);
         filters.add(filter);
         return new CompositeFilter(Collections.unmodifiableList(filters));
     }
 
-    public CompositeFilter removeFilter(Filter filter) {
-        List<Filter> filters = new ArrayList<Filter>(this.filters);
+    public CompositeFilter removeFilter(final Filter filter) {
+        final List<Filter> filters = new ArrayList<Filter>(this.filters);
         filters.remove(filter);
         return new CompositeFilter(Collections.unmodifiableList(filters));
     }
@@ -88,7 +88,7 @@ public final class CompositeFilter imple
     }
 
     public void start() {
-        for (Filter filter : filters) {
+        for (final Filter filter : filters) {
             if (filter instanceof LifeCycle) {
                 ((LifeCycle) filter).start();
             }
@@ -97,7 +97,7 @@ public final class CompositeFilter imple
     }
 
     public void stop() {
-        for (Filter filter : filters) {
+        for (final Filter filter : filters) {
             if (filter instanceof LifeCycle) {
                 ((LifeCycle) filter).stop();
             }
@@ -142,9 +142,9 @@ public final class CompositeFilter imple
      *            An array of parameters or null.
      * @return the Result.
      */
-    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) {
         Result result = Result.NEUTRAL;
-        for (Filter filter : filters) {
+        for (final Filter filter : filters) {
             result = filter.filter(logger, level, marker, msg, params);
             if (result == Result.ACCEPT || result == Result.DENY) {
                 return result;
@@ -168,9 +168,9 @@ public final class CompositeFilter imple
      *            A Throwable or null.
      * @return the Result.
      */
-    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) {
         Result result = Result.NEUTRAL;
-        for (Filter filter : filters) {
+        for (final Filter filter : filters) {
             result = filter.filter(logger, level, marker, msg, t);
             if (result == Result.ACCEPT || result == Result.DENY) {
                 return result;
@@ -194,9 +194,9 @@ public final class CompositeFilter imple
      *            A Throwable or null.
      * @return the Result.
      */
-    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) {
         Result result = Result.NEUTRAL;
-        for (Filter filter : filters) {
+        for (final Filter filter : filters) {
             result = filter.filter(logger, level, marker, msg, t);
             if (result == Result.ACCEPT || result == Result.DENY) {
                 return result;
@@ -212,9 +212,9 @@ public final class CompositeFilter imple
      *            The Event to filter on.
      * @return the Result.
      */
-    public Result filter(LogEvent event) {
+    public Result filter(final LogEvent event) {
         Result result = Result.NEUTRAL;
-        for (Filter filter : filters) {
+        for (final Filter filter : filters) {
             result = filter.filter(event);
             if (result == Result.ACCEPT || result == Result.DENY) {
                 return result;
@@ -225,8 +225,8 @@ public final class CompositeFilter imple
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
-        for (Filter filter : filters) {
+        final StringBuilder sb = new StringBuilder();
+        for (final Filter filter : filters) {
             if (sb.length() == 0) {
                 sb.append("{");
             } else {
@@ -248,8 +248,8 @@ public final class CompositeFilter imple
      * @return The CompositeFilter.
      */
     @PluginFactory
-    public static CompositeFilter createFilters(@PluginElement("filters") Filter[] filters) {
-        List<Filter> f = filters == null || filters.length == 0 ? new ArrayList<Filter>() : Arrays.asList(filters);
+    public static CompositeFilter createFilters(@PluginElement("filters") final Filter[] filters) {
+        final List<Filter> f = filters == null || filters.length == 0 ? new ArrayList<Filter>() : Arrays.asList(filters);
         return new CompositeFilter(f);
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java Mon Dec 10 19:36:06 2012
@@ -38,10 +38,10 @@ import java.util.Map;
 public final class DynamicThresholdFilter extends AbstractFilter {
     private Map<String, Level> levelMap = new HashMap<String, Level>();
     private Level defaultThreshold = Level.ERROR;
-    private String key;
+    private final String key;
 
-    private DynamicThresholdFilter(String key, Map<String, Level> pairs, Level defaultLevel,
-                                   Result onMatch, Result onMismatch) {
+    private DynamicThresholdFilter(final String key, final Map<String, Level> pairs, final Level defaultLevel,
+                                   final Result onMatch, final Result onMismatch) {
         super(onMatch, onMismatch);
         if (key == null) {
             throw new NullPointerException("key cannot be null");
@@ -56,27 +56,27 @@ public final class DynamicThresholdFilte
     }
 
     @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) {
-        Object value = ThreadContext.get(key);
+    private Result filter(final Level level) {
+        final Object value = ThreadContext.get(key);
         if (value != null) {
             Level ctxLevel = levelMap.get(value);
             if (ctxLevel == null) {
@@ -94,13 +94,13 @@ public final class DynamicThresholdFilte
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("key=").append(key);
         sb.append(", default=").append(defaultThreshold);
         if (levelMap.size() > 0) {
             sb.append("{");
             boolean first = true;
-            for (Map.Entry<String, Level> entry : levelMap.entrySet()) {
+            for (final Map.Entry<String, Level> entry : levelMap.entrySet()) {
                 if (!first) {
                     sb.append(", ");
                     first = false;
@@ -122,18 +122,18 @@ public final class DynamicThresholdFilte
      * @return The DynamicThresholdFilter.
      */
     @PluginFactory
-    public static DynamicThresholdFilter createFilter(@PluginAttr("key") String key,
-                                                      @PluginElement("pairs") KeyValuePair[] pairs,
-                                                      @PluginAttr("defaultThreshold") String levelName,
-                                                      @PluginAttr("onmatch") String match,
-                                                      @PluginAttr("onmismatch") String mismatch) {
-        Result onMatch = Result.toResult(match);
-        Result onMismatch = Result.toResult(mismatch);
-        Map<String, Level> map = new HashMap<String, Level>();
-        for (KeyValuePair pair : pairs) {
+    public static DynamicThresholdFilter createFilter(@PluginAttr("key") final String key,
+                                                      @PluginElement("pairs") final KeyValuePair[] pairs,
+                                                      @PluginAttr("defaultThreshold") final String levelName,
+                                                      @PluginAttr("onmatch") final String match,
+                                                      @PluginAttr("onmismatch") final String mismatch) {
+        final Result onMatch = Result.toResult(match);
+        final Result onMismatch = Result.toResult(mismatch);
+        final Map<String, Level> map = new HashMap<String, Level>();
+        for (final KeyValuePair pair : pairs) {
             map.put(pair.getKey(), Level.toLevel(pair.getValue()));
         }
-        Level level = Level.toLevel(levelName, Level.ERROR);
+        final Level level = Level.toLevel(levelName, Level.ERROR);
         return new DynamicThresholdFilter(key, map, level, onMatch, onMismatch);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/MapFilter.java Mon Dec 10 19:36:06 2012
@@ -42,7 +42,7 @@ public class MapFilter extends AbstractF
 
     private final boolean isAnd;
 
-    protected MapFilter(Map<String, List<String>> map, boolean oper, Result onMatch, Result onMismatch) {
+    protected MapFilter(final Map<String, List<String>> map, final boolean oper, final Result onMatch, final Result onMismatch) {
         super(onMatch, onMismatch);
         if (map == null) {
             throw new NullPointerException("key cannot be null");
@@ -52,7 +52,7 @@ public class MapFilter extends AbstractF
     }
 
     @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 MapMessage) {
             return filter(((MapMessage) msg).getData()) ? onMatch : onMismatch;
         }
@@ -60,18 +60,18 @@ public class MapFilter extends AbstractF
     }
 
     @Override
-    public Result filter(LogEvent event) {
-        Message msg = event.getMessage();
+    public Result filter(final LogEvent event) {
+        final Message msg = event.getMessage();
         if (msg instanceof MapMessage) {
             return filter(((MapMessage) msg).getData()) ? onMatch : onMismatch;
         }
         return Result.NEUTRAL;
     }
 
-    protected boolean filter(Map<String, String> data) {
+    protected boolean filter(final Map<String, String> data) {
         boolean match = false;
-        for (Map.Entry<String, List<String>> entry : map.entrySet()) {
-            String toMatch = data.get(entry.getKey());
+        for (final Map.Entry<String, List<String>> entry : map.entrySet()) {
+            final String toMatch = data.get(entry.getKey());
             if (toMatch != null) {
                 match = entry.getValue().contains(toMatch);
             } else {
@@ -86,18 +86,18 @@ public class MapFilter extends AbstractF
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("isAnd=").append(isAnd);
         if (map.size() > 0) {
             sb.append(", {");
             boolean first = true;
-            for (Map.Entry<String, List<String>> entry : map.entrySet()) {
+            for (final Map.Entry<String, List<String>> entry : map.entrySet()) {
                 if (!first) {
                     sb.append(", ");
                 }
                 first = false;
-                List<String> list = entry.getValue();
-                String value = list.size() > 1 ? list.get(0) : list.toString();
+                final List<String> list = entry.getValue();
+                final String value = list.size() > 1 ? list.get(0) : list.toString();
                 sb.append(entry.getKey()).append("=").append(value);
             }
             sb.append("}");
@@ -114,22 +114,22 @@ public class MapFilter extends AbstractF
     }
 
     @PluginFactory
-    public static MapFilter createFilter(@PluginElement("pairs") KeyValuePair[] pairs,
-                                         @PluginAttr("operator") String oper,
-                                         @PluginAttr("onmatch") String match,
-                                         @PluginAttr("onmismatch") String mismatch) {
+    public static MapFilter 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 MapFilter");
             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;
@@ -147,9 +147,9 @@ public class MapFilter extends AbstractF
             LOGGER.error("MapFilter 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 MapFilter(map, isAnd, onMatch, onMismatch);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/MarkerFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/MarkerFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/MarkerFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/MarkerFilter.java Mon Dec 10 19:36:06 2012
@@ -35,32 +35,32 @@ public final class MarkerFilter extends 
 
     private final String name;
 
-    private MarkerFilter(String name, Result onMatch, Result onMismatch) {
+    private MarkerFilter(final String name, final Result onMatch, final Result onMismatch) {
         super(onMatch, onMismatch);
         this.name = name;
     }
 
     @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(marker);
     }
 
     @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(marker);
     }
 
     @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(marker);
     }
 
     @Override
-    public Result filter(LogEvent event) {
+    public Result filter(final LogEvent event) {
         return filter(event.getMarker());
     }
 
-    private Result filter(Marker marker) {
+    private Result filter(final Marker marker) {
         return marker != null && marker.isInstanceOf(name) ? onMatch : onMismatch;
     }
 
@@ -77,16 +77,16 @@ public final class MarkerFilter extends 
      * @return A MarkerFilter.
      */
     @PluginFactory
-    public static MarkerFilter createFilter(@PluginAttr("marker") String marker,
-                                            @PluginAttr("onMatch") String match,
-                                            @PluginAttr("onMismatch") String mismatch) {
+    public static MarkerFilter createFilter(@PluginAttr("marker") final String marker,
+                                            @PluginAttr("onMatch") final String match,
+                                            @PluginAttr("onMismatch") final String mismatch) {
 
         if (marker == null) {
             LOGGER.error("A marker must be provided for MarkerFilter");
             return null;
         }
-        Result onMatch = Result.toResult(match);
-        Result onMismatch = Result.toResult(mismatch);
+        final Result onMatch = Result.toResult(match);
+        final Result onMismatch = Result.toResult(mismatch);
         return new MarkerFilter(marker, onMatch, onMismatch);
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java Mon Dec 10 19:36:06 2012
@@ -42,45 +42,45 @@ public final class RegexFilter extends A
     private final Pattern pattern;
     private final boolean useRawMessage;
 
-    private RegexFilter(boolean raw, Pattern pattern, Result onMatch, Result onMismatch) {
+    private RegexFilter(final boolean raw, final Pattern pattern, final Result onMatch, final Result onMismatch) {
         super(onMatch, onMismatch);
         this.pattern = pattern;
         this.useRawMessage = raw;
     }
 
     @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(msg);
     }
 
     @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(msg.toString());
     }
 
     @Override
-    public Result filter(Logger logger, Level level, Marker marker, Message msg, Throwable t) {
-        String text = useRawMessage ? msg.getFormat() : msg.getFormattedMessage();
+    public Result filter(final Logger logger, final Level level, final Marker marker, final Message msg, final Throwable t) {
+        final String text = useRawMessage ? msg.getFormat() : msg.getFormattedMessage();
         return filter(text);
     }
 
     @Override
-    public Result filter(LogEvent event) {
-        String text = useRawMessage ? event.getMessage().getFormat() : event.getMessage().getFormattedMessage();
+    public Result filter(final LogEvent event) {
+        final String text = useRawMessage ? event.getMessage().getFormat() : event.getMessage().getFormattedMessage();
         return filter(text);
     }
 
-    private Result filter(String msg) {
+    private Result filter(final String msg) {
         if (msg == null) {
             return onMismatch;
         }
-        Matcher m = pattern.matcher(msg);
+        final Matcher m = pattern.matcher(msg);
         return m.matches() ? onMatch : onMismatch;
     }
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("useRaw=").append(useRawMessage);
         sb.append(", pattern=").append(pattern.toString());
         return sb.toString();
@@ -95,25 +95,25 @@ public final class RegexFilter extends A
      * @return The RegexFilter.
      */
     @PluginFactory
-    public static RegexFilter createFilter(@PluginAttr("regex") String regex,
-                                           @PluginAttr("useRawMsg") String useRawMsg,
-                                            @PluginAttr("onMatch") String match,
-                                            @PluginAttr("onMismatch") String mismatch) {
+    public static RegexFilter createFilter(@PluginAttr("regex") final String regex,
+                                           @PluginAttr("useRawMsg") final String useRawMsg,
+                                            @PluginAttr("onMatch") final String match,
+                                            @PluginAttr("onMismatch") final String mismatch) {
 
         if (regex == null) {
             LOGGER.error("A regular expression must be provided for RegexFilter");
             return null;
         }
-        boolean raw = useRawMsg == null ? false : Boolean.parseBoolean(useRawMsg);
+        final boolean raw = useRawMsg == null ? false : Boolean.parseBoolean(useRawMsg);
         Pattern pattern;
         try {
             pattern = Pattern.compile(regex);
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             LOGGER.error("RegexFilter caught exception compiling pattern: " + regex + " cause: " + ex.getMessage());
             return null;
         }
-        Result onMatch = Result.toResult(match);
-        Result onMismatch = Result.toResult(mismatch);
+        final Result onMatch = Result.toResult(match);
+        final Result onMismatch = Result.toResult(mismatch);
 
         return new RegexFilter(raw, pattern, onMatch, onMismatch);
     }



Mime
View raw message