logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1419697 [5/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/appender/OutputStreamManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java Mon Dec 10 19:36:06 2012
@@ -29,7 +29,7 @@ public class OutputStreamManager extends
 
     private byte[] footer = null;
 
-    protected OutputStreamManager(OutputStream os, String streamName) {
+    protected OutputStreamManager(final OutputStream os, final String streamName) {
         super(streamName);
         this.os = os;
     }
@@ -42,8 +42,8 @@ public class OutputStreamManager extends
      * @param factory The factory to use to create the Manager.
      * @return An OutputStreamManager.
      */
-    public static <T> OutputStreamManager getManager(String name, T data,
-                                                 ManagerFactory<? extends OutputStreamManager, T> factory) {
+    public static <T> OutputStreamManager getManager(final String name, final T data,
+                                                 final ManagerFactory<? extends OutputStreamManager, T> factory) {
         return AbstractManager.getManager(name, factory, data);
     }
 
@@ -51,11 +51,11 @@ public class OutputStreamManager extends
      * Set the header to write when the stream is opened.
      * @param header The header.
      */
-    public synchronized void setHeader(byte[] header) {
+    public synchronized void setHeader(final byte[] header) {
         if (header != null) {
             try {
                 this.os.write(header, 0, header.length);
-            } catch (IOException ioe) {
+            } catch (final IOException ioe) {
                 LOGGER.error("Unable to write header", ioe);
             }
         }
@@ -65,7 +65,7 @@ public class OutputStreamManager extends
      * Set the footer to write when the stream is closed.
      * @param footer The footer.
      */
-    public synchronized void setFooter(byte[] footer) {
+    public synchronized void setFooter(final byte[] footer) {
         if (footer != null) {
             this.footer = footer;
         }
@@ -94,7 +94,7 @@ public class OutputStreamManager extends
         return os;
     }
 
-    protected void setOutputStream(OutputStream os) {
+    protected void setOutputStream(final OutputStream os) {
         this.os = os;
     }
 
@@ -106,12 +106,12 @@ public class OutputStreamManager extends
      * @param length The number of bytes to write.
      * @throws AppenderRuntimeException if an error occurs.
      */
-    protected synchronized void write(byte[] bytes, int offset, int length)  {
+    protected synchronized void write(final byte[] bytes, final int offset, final int length)  {
         //System.out.println("write " + count);
         try {
             os.write(bytes, offset, length);
-        } catch (IOException ex) {
-            String msg = "Error writing to stream " + getName();
+        } catch (final IOException ex) {
+            final String msg = "Error writing to stream " + getName();
             throw new AppenderRuntimeException(msg, ex);
         }
     }
@@ -122,7 +122,7 @@ public class OutputStreamManager extends
      * @param bytes The serialized Log event.
      * @throws AppenderRuntimeException if an error occurs.
      */
-    protected void write(byte[] bytes)  {
+    protected void write(final byte[] bytes)  {
         write(bytes, 0, bytes.length);
     }
 
@@ -132,7 +132,7 @@ public class OutputStreamManager extends
         }
         try {
             os.close();
-        } catch (IOException ex) {
+        } catch (final IOException ex) {
             LOGGER.error("Unable to close stream " + getName() + ". " + ex);
         }
     }
@@ -143,8 +143,8 @@ public class OutputStreamManager extends
     public void flush() {
         try {
             os.flush();
-        } catch (IOException ex) {
-            String msg = "Error flushing stream " + getName();
+        } catch (final IOException ex) {
+            final String msg = "Error flushing stream " + getName();
             throw new AppenderRuntimeException(msg, ex);
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java Mon Dec 10 19:36:06 2012
@@ -41,8 +41,8 @@ public final class RollingFileAppender e
     private final String filePattern;
 
 
-    private RollingFileAppender(String name, Layout layout, Filter filter, RollingFileManager manager, String fileName,
-                                String filePattern, boolean handleException, boolean immediateFlush) {
+    private RollingFileAppender(final String name, final Layout layout, final Filter filter, final RollingFileManager manager, final String fileName,
+                                final String filePattern, final boolean handleException, final boolean immediateFlush) {
         super(name, layout, filter, handleException, immediateFlush, manager);
         this.fileName = fileName;
         this.filePattern = filePattern;
@@ -54,7 +54,7 @@ public final class RollingFileAppender e
      * @param event The LogEvent.
      */
     @Override
-    public void append(LogEvent event) {
+    public void append(final LogEvent event) {
         ((RollingFileManager) getManager()).checkRollover(event);
         super.append(event);
     }
@@ -94,23 +94,23 @@ public final class RollingFileAppender e
      * @return A RollingFileAppender.
      */
     @PluginFactory
-    public static RollingFileAppender createAppender(@PluginAttr("fileName") String fileName,
-                                              @PluginAttr("filePattern") String filePattern,
-                                              @PluginAttr("append") String append,
-                                              @PluginAttr("name") String name,
-                                              @PluginAttr("bufferedIO") String bufferedIO,
-                                              @PluginAttr("immediateFlush") String immediateFlush,
-                                              @PluginElement("policy") TriggeringPolicy policy,
+    public static RollingFileAppender createAppender(@PluginAttr("fileName") final String fileName,
+                                              @PluginAttr("filePattern") final String filePattern,
+                                              @PluginAttr("append") final String append,
+                                              @PluginAttr("name") final String name,
+                                              @PluginAttr("bufferedIO") final String bufferedIO,
+                                              @PluginAttr("immediateFlush") final String immediateFlush,
+                                              @PluginElement("policy") final TriggeringPolicy policy,
                                               @PluginElement("strategy") RolloverStrategy strategy,
                                               @PluginElement("layout") Layout layout,
-                                              @PluginElement("filter") Filter filter,
-                                              @PluginAttr("suppressExceptions") String suppress,
-                                              @PluginConfiguration Configuration config) {
-
-        boolean isAppend = append == null ? true : Boolean.valueOf(append);
-        boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
-        boolean isBuffered = bufferedIO == null ? true : Boolean.valueOf(bufferedIO);
-        boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
+                                              @PluginElement("filter") final Filter filter,
+                                              @PluginAttr("suppressExceptions") final String suppress,
+                                              @PluginConfiguration final Configuration config) {
+
+        final boolean isAppend = append == null ? true : Boolean.valueOf(append);
+        final boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
+        final boolean isBuffered = bufferedIO == null ? true : Boolean.valueOf(bufferedIO);
+        final boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
 
         if (name == null) {
             LOGGER.error("No name provided for FileAppender");
@@ -136,7 +136,7 @@ public final class RollingFileAppender e
             strategy = DefaultRolloverStrategy.createStrategy(null, null, "true", config);
         }
 
-        RollingFileManager manager = RollingFileManager.getFileManager(fileName, filePattern, isAppend, isBuffered,
+        final RollingFileManager manager = RollingFileManager.getFileManager(fileName, filePattern, isAppend, isBuffered,
             policy, strategy);
         if (manager == null) {
             return null;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java Mon Dec 10 19:36:06 2012
@@ -39,8 +39,8 @@ import org.apache.logging.log4j.util.Eng
 public class SocketAppender extends AbstractOutputStreamAppender {
 
 
-    protected SocketAppender(String name, Layout layout, Filter filter, AbstractSocketManager manager,
-                          boolean handleException, boolean immediateFlush) {
+    protected SocketAppender(final String name, final Layout layout, final Filter filter, final AbstractSocketManager manager,
+                          final boolean handleException, final boolean immediateFlush) {
         super(name, layout, filter, handleException, immediateFlush, manager);
 
     }
@@ -60,20 +60,20 @@ public class SocketAppender extends Abst
      * @return A SocketAppender.
      */
     @PluginFactory
-    public static SocketAppender createAppender(@PluginAttr("host") String host,
-                                                @PluginAttr("port") String portNum,
-                                                @PluginAttr("protocol") String protocol,
-                                                @PluginAttr("reconnectionDelay") String delay,
-                                                @PluginAttr("name") String name,
-                                                @PluginAttr("immediateFlush") String immediateFlush,
-                                                @PluginAttr("suppressExceptions") String suppress,
+    public static SocketAppender createAppender(@PluginAttr("host") final String host,
+                                                @PluginAttr("port") final String portNum,
+                                                @PluginAttr("protocol") final String protocol,
+                                                @PluginAttr("reconnectionDelay") final String delay,
+                                                @PluginAttr("name") final String name,
+                                                @PluginAttr("immediateFlush") final String immediateFlush,
+                                                @PluginAttr("suppressExceptions") final String suppress,
                                                 @PluginElement("layout") Layout layout,
-                                                @PluginElement("filters") Filter filter) {
+                                                @PluginElement("filters") final Filter filter) {
 
-        boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
-        boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
-        int reconnectDelay = delay == null ? 0 : Integer.parseInt(delay);
-        int port = portNum == null ? 0 : Integer.parseInt(portNum);
+        final boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
+        final boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
+        final int reconnectDelay = delay == null ? 0 : Integer.parseInt(delay);
+        final int port = portNum == null ? 0 : Integer.parseInt(portNum);
         if (layout == null) {
             layout = SerializedLayout.createLayout();
         }
@@ -83,15 +83,15 @@ public class SocketAppender extends Abst
             return null;
         }
 
-        AbstractSocketManager manager = createSocketManager(protocol, host, port, reconnectDelay);
+        final AbstractSocketManager manager = createSocketManager(protocol, host, port, reconnectDelay);
         if (manager == null) {
             return null;
         }
         return new SocketAppender(name, layout, filter, manager, handleExceptions, isFlush);
     }
 
-    protected static AbstractSocketManager createSocketManager(String protocol, String host, int port, int delay) {
-        Protocol p = EnglishEnums.valueOf(Protocol.class, protocol);
+    protected static AbstractSocketManager createSocketManager(final String protocol, final String host, final int port, final int delay) {
+        final Protocol p = EnglishEnums.valueOf(Protocol.class, protocol);
         switch (p) {
             case TCP:
                 return TCPSocketManager.getSocketManager(host, port, delay);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java Mon Dec 10 19:36:06 2012
@@ -40,8 +40,8 @@ public class SyslogAppender extends Sock
 
     private static final String RFC5424 = "RFC5424";
 
-    protected SyslogAppender(String name, Layout layout, Filter filter,
-                          boolean handleException, boolean immediateFlush, AbstractSocketManager manager) {
+    protected SyslogAppender(final String name, final Layout layout, final Filter filter,
+                          final boolean handleException, final boolean immediateFlush, final AbstractSocketManager manager) {
         super(name, layout, filter, manager, handleException, immediateFlush);
 
     }
@@ -76,33 +76,33 @@ public class SyslogAppender extends Sock
      * @return A SyslogAppender.
      */
     @PluginFactory
-    public static SyslogAppender createAppender(@PluginAttr("host") String host,
-                                                @PluginAttr("port") String portNum,
-                                                @PluginAttr("protocol") String protocol,
-                                                @PluginAttr("reconnectionDelay") String delay,
-                                                @PluginAttr("name") String name,
-                                                @PluginAttr("immediateFlush") String immediateFlush,
-                                                @PluginAttr("suppressExceptions") String suppress,
-                                                @PluginAttr("facility") String facility,
-                                                @PluginAttr("id") String id,
-                                                @PluginAttr("enterpriseNumber") String ein,
-                                                @PluginAttr("includeMDC") String includeMDC,
-                                                @PluginAttr("mdcId") String mdcId,
-                                                @PluginAttr("newLine") String includeNL,
-                                                @PluginAttr("appName") String appName,
-                                                @PluginAttr("messageId") String msgId,
-                                                @PluginAttr("mdcExcludes") String excludes,
-                                                @PluginAttr("mdcIncludes") String includes,
-                                                @PluginAttr("mdcRequired") String required,
-                                                @PluginAttr("format") String format,
-                                                @PluginElement("filters") Filter filter,
-                                                @PluginConfiguration Configuration config,
-                                                @PluginAttr("charset") String charset) {
-
-        boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
-        boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
-        int reconnectDelay = delay == null ? 0 : Integer.parseInt(delay);
-        int port = portNum == null ? 0 : Integer.parseInt(portNum);
+    public static SyslogAppender createAppender(@PluginAttr("host") final String host,
+                                                @PluginAttr("port") final String portNum,
+                                                @PluginAttr("protocol") final String protocol,
+                                                @PluginAttr("reconnectionDelay") final String delay,
+                                                @PluginAttr("name") final String name,
+                                                @PluginAttr("immediateFlush") final String immediateFlush,
+                                                @PluginAttr("suppressExceptions") final String suppress,
+                                                @PluginAttr("facility") final String facility,
+                                                @PluginAttr("id") final String id,
+                                                @PluginAttr("enterpriseNumber") final String ein,
+                                                @PluginAttr("includeMDC") final String includeMDC,
+                                                @PluginAttr("mdcId") final String mdcId,
+                                                @PluginAttr("newLine") final String includeNL,
+                                                @PluginAttr("appName") final String appName,
+                                                @PluginAttr("messageId") final String msgId,
+                                                @PluginAttr("mdcExcludes") final String excludes,
+                                                @PluginAttr("mdcIncludes") final String includes,
+                                                @PluginAttr("mdcRequired") final String required,
+                                                @PluginAttr("format") final String format,
+                                                @PluginElement("filters") final Filter filter,
+                                                @PluginConfiguration final Configuration config,
+                                                @PluginAttr("charset") final String charset) {
+
+        final boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
+        final boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
+        final int reconnectDelay = delay == null ? 0 : Integer.parseInt(delay);
+        final int port = portNum == null ? 0 : Integer.parseInt(portNum);
         Charset c = Charset.isSupported("UTF-8") ? Charset.forName("UTF-8") : Charset.defaultCharset();
         if (charset != null) {
             if (Charset.isSupported(charset)) {
@@ -111,7 +111,7 @@ public class SyslogAppender extends Sock
                 LOGGER.error("Charset " + charset + " is not supported for layout, using " + c.displayName());
             }
         }
-        Layout layout = (RFC5424.equalsIgnoreCase(format)) ?
+        final Layout layout = (RFC5424.equalsIgnoreCase(format)) ?
             RFC5424Layout.createLayout(facility, id, ein, includeMDC, mdcId, includeNL, appName,  msgId,
                 excludes, includes, required, charset, config) :
             SyslogLayout.createLayout(facility, includeNL, charset);
@@ -120,7 +120,7 @@ public class SyslogAppender extends Sock
             LOGGER.error("No name provided for SyslogAppender");
             return null;
         }
-        AbstractSocketManager manager = createSocketManager(protocol, host, port, reconnectDelay);
+        final AbstractSocketManager manager = createSocketManager(protocol, host, port, reconnectDelay);
         if (manager == null) {
             return null;
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicy.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicy.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicy.java Mon Dec 10 19:36:06 2012
@@ -45,7 +45,7 @@ public final class MapRewritePolicy impl
 
     private final Mode mode;
 
-    private MapRewritePolicy(Map<String, String> map, Mode mode) {
+    private MapRewritePolicy(final Map<String, String> map, final Mode mode) {
         this.map = map;
         this.mode = mode;
     }
@@ -56,27 +56,27 @@ public final class MapRewritePolicy impl
      * used to create a new logging event.
      * @return The LogEvent after rewriting.
      */
-    public LogEvent rewrite(LogEvent source) {
-        Message msg = source.getMessage();
+    public LogEvent rewrite(final LogEvent source) {
+        final Message msg = source.getMessage();
         if (msg == null || !(msg instanceof MapMessage)) {
             return source;
         }
 
-        Map<String, String> newMap = new HashMap<String, String>(((MapMessage) msg).getData());
+        final Map<String, String> newMap = new HashMap<String, String>(((MapMessage) msg).getData());
         switch (mode) {
             case Add: {
                 newMap.putAll(map);
                 break;
             }
             default: {
-                for (Map.Entry<String, String> entry : map.entrySet()) {
+                for (final Map.Entry<String, String> entry : map.entrySet()) {
                     if (newMap.containsKey(entry.getKey())) {
                         newMap.put(entry.getKey(), entry.getValue());
                     }
                 }
             }
         }
-        MapMessage message = ((MapMessage) msg).newInstance(newMap);
+        final MapMessage message = ((MapMessage) msg).newInstance(newMap);
         return new Log4jLogEvent(source.getLoggerName(), source.getMarker(), source.getFQCN(), source.getLevel(),
             message, source.getThrown(), source.getContextMap(), source.getContextStack(), source.getThreadName(),
             source.getSource(), source.getMillis());
@@ -99,11 +99,11 @@ public final class MapRewritePolicy impl
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("mode=").append(mode);
         sb.append(" {");
         boolean first = true;
-        for (Map.Entry<String, String> entry : map.entrySet()) {
+        for (final Map.Entry<String, String> entry : map.entrySet()) {
             if (!first) {
                 sb.append(", ");
             }
@@ -121,8 +121,8 @@ public final class MapRewritePolicy impl
      * @return The MapRewritePolicy.
      */
     @PluginFactory
-    public static MapRewritePolicy createPolicy(@PluginAttr("mode") String mode,
-                                                @PluginElement("KeyValuePair") KeyValuePair[] pairs) {
+    public static MapRewritePolicy createPolicy(@PluginAttr("mode") final String mode,
+                                                @PluginElement("KeyValuePair") final KeyValuePair[] pairs) {
         Mode op;
         if (mode == null) {
             op = Mode.Add;
@@ -137,14 +137,14 @@ public final class MapRewritePolicy impl
             LOGGER.error("keys and values must be specified for the MapRewritePolicy");
             return null;
         }
-        Map<String, String> map = new HashMap<String, String>();
-        for (KeyValuePair pair : pairs) {
-            String key = pair.getKey();
+        final Map<String, String> map = new HashMap<String, String>();
+        for (final KeyValuePair pair : pairs) {
+            final String key = pair.getKey();
             if (key == null) {
                 LOGGER.error("A null key is not valid in MapRewritePolicy");
                 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 MapRewritePolicy");
                 continue;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/PropertiesRewritePolicy.java Mon Dec 10 19:36:06 2012
@@ -46,11 +46,11 @@ public final class PropertiesRewritePoli
 
     private final Configuration config;
 
-    private PropertiesRewritePolicy(Configuration config, List<Property> props) {
+    private PropertiesRewritePolicy(final Configuration config, final List<Property> props) {
         this.config = config;
         this.properties = new HashMap<Property, Boolean>(props.size());
-        for (Property prop : props) {
-            boolean interpolate = prop.getValue().contains("${");
+        for (final Property prop : props) {
+            final boolean interpolate = prop.getValue().contains("${");
             properties.put(prop, interpolate);
         }
     }
@@ -61,10 +61,10 @@ public final class PropertiesRewritePoli
      * used to create a new logging event.
      * @return The LogEvent after rewriting.
      */
-    public LogEvent rewrite(LogEvent source) {
-        Map<String, String> props = new HashMap<String, String>(source.getContextMap());
-        for (Map.Entry<Property, Boolean> entry : properties.entrySet()) {
-            Property prop = entry.getKey();
+    public LogEvent rewrite(final LogEvent source) {
+        final Map<String, String> props = new HashMap<String, String>(source.getContextMap());
+        for (final Map.Entry<Property, Boolean> entry : properties.entrySet()) {
+            final Property prop = entry.getKey();
             props.put(prop.getName(), entry.getValue() ?
                 config.getSubst().replace(prop.getValue()) : prop.getValue());
         }
@@ -76,14 +76,14 @@ public final class PropertiesRewritePoli
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append(" {");
         boolean first = true;
-        for (Map.Entry<Property, Boolean> entry : properties.entrySet()) {
+        for (final Map.Entry<Property, Boolean> entry : properties.entrySet()) {
             if (!first) {
                 sb.append(", ");
             }
-            Property prop = entry.getKey();
+            final Property prop = entry.getKey();
             sb.append(prop.getName()).append("=").append(prop.getValue());
             first = false;
         }
@@ -98,13 +98,13 @@ public final class PropertiesRewritePoli
      * @return The PropertiesRewritePolicy.
      */
     @PluginFactory
-    public static PropertiesRewritePolicy createPolicy(@PluginConfiguration Configuration config,
-                                                @PluginElement("properties") Property[] props) {
+    public static PropertiesRewritePolicy createPolicy(@PluginConfiguration final Configuration config,
+                                                @PluginElement("properties") final Property[] props) {
         if (props == null || props.length == 0) {
             LOGGER.error("Properties must be specified for the PropertiesRewritePolicy");
             return null;
         }
-        List<Property> properties = Arrays.asList(props);
+        final List<Property> properties = Arrays.asList(props);
         return new PropertiesRewritePolicy(config, properties);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java Mon Dec 10 19:36:06 2012
@@ -43,8 +43,8 @@ public final class RewriteAppender exten
     private final RewritePolicy rewritePolicy;
     private final AppenderRef[] appenderRefs;
 
-    private RewriteAppender(String name, Filter filter, boolean handleException, AppenderRef[] appenderRefs,
-                            RewritePolicy rewritePolicy, Configuration config) {
+    private RewriteAppender(final String name, final Filter filter, final boolean handleException, final AppenderRef[] appenderRefs,
+                            final RewritePolicy rewritePolicy, final Configuration config) {
         super(name, filter, null, handleException);
         this.config = config;
         this.rewritePolicy = rewritePolicy;
@@ -53,10 +53,10 @@ public final class RewriteAppender exten
 
     @Override
     public void start() {
-        Map<String, Appender> map = config.getAppenders();
-        for (AppenderRef ref : appenderRefs) {
-            String name = ref.getRef();
-            Appender appender = map.get(name);
+        final Map<String, Appender> map = config.getAppenders();
+        for (final AppenderRef ref : appenderRefs) {
+            final String name = ref.getRef();
+            final Appender appender = map.get(name);
             if (appender != null) {
                 appenders.put(name, new AppenderControl(appender, ref.getLevel(), null));
             } else {
@@ -79,7 +79,7 @@ public final class RewriteAppender exten
         if (rewritePolicy != null) {
             event = rewritePolicy.rewrite(event);
         }
-        for (AppenderControl control : appenders.values()) {
+        for (final AppenderControl control : appenders.values()) {
             control.callAppender(event);
         }
     }
@@ -95,14 +95,14 @@ public final class RewriteAppender exten
      * @return The created RewriteAppender.
      */
     @PluginFactory
-    public static RewriteAppender createAppender(@PluginAttr("name") String name,
-                                          @PluginAttr("suppressExceptions") String suppress,
-                                          @PluginElement("appender-ref") AppenderRef[] appenderRefs,
-                                          @PluginConfiguration Configuration config,
-                                          @PluginElement("rewritePolicy") RewritePolicy rewritePolicy,
-                                          @PluginElement("filter") Filter filter) {
+    public static RewriteAppender createAppender(@PluginAttr("name") final String name,
+                                          @PluginAttr("suppressExceptions") final String suppress,
+                                          @PluginElement("appender-ref") final AppenderRef[] appenderRefs,
+                                          @PluginConfiguration final Configuration config,
+                                          @PluginElement("rewritePolicy") final RewritePolicy rewritePolicy,
+                                          @PluginElement("filter") final Filter filter) {
 
-        boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
+        final boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
 
         if (name == null) {
             LOGGER.error("No name provided for RewriteAppender");

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CompositeTriggeringPolicy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CompositeTriggeringPolicy.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CompositeTriggeringPolicy.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/CompositeTriggeringPolicy.java Mon Dec 10 19:36:06 2012
@@ -29,7 +29,7 @@ public final class CompositeTriggeringPo
 
     private final TriggeringPolicy[] policies;
 
-    private CompositeTriggeringPolicy(TriggeringPolicy... policies) {
+    private CompositeTriggeringPolicy(final TriggeringPolicy... policies) {
         this.policies = policies;
     }
 
@@ -37,8 +37,8 @@ public final class CompositeTriggeringPo
      * Initializes the policy.
      * @param manager The RollingFileManager.
      */
-    public void initialize(RollingFileManager manager) {
-        for (TriggeringPolicy policy : policies) {
+    public void initialize(final RollingFileManager manager) {
+        for (final TriggeringPolicy policy : policies) {
             policy.initialize(manager);
         }
     }
@@ -48,8 +48,8 @@ public final class CompositeTriggeringPo
      * @param event A reference to the currently event.
      * @return true if a rollover should occur, false otherwise.
      */
-    public boolean isTriggeringEvent(LogEvent event) {
-        for (TriggeringPolicy policy : policies) {
+    public boolean isTriggeringEvent(final LogEvent event) {
+        for (final TriggeringPolicy policy : policies) {
             if (policy.isTriggeringEvent(event)) {
                 return true;
             }
@@ -59,9 +59,9 @@ public final class CompositeTriggeringPo
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder("CompositeTriggeringPolicy{");
+        final StringBuilder sb = new StringBuilder("CompositeTriggeringPolicy{");
         boolean first = true;
-        for (TriggeringPolicy policy : policies) {
+        for (final TriggeringPolicy policy : policies) {
             if (!first) {
                 sb.append(", ");
             }
@@ -78,7 +78,7 @@ public final class CompositeTriggeringPo
      * @return A CompositeTriggeringPolicy.
      */
     @PluginFactory
-    public static CompositeTriggeringPolicy createPolicy(@PluginElement("policies") TriggeringPolicy... policies) {
+    public static CompositeTriggeringPolicy createPolicy(@PluginElement("policies") final TriggeringPolicy... policies) {
         return new CompositeTriggeringPolicy(policies);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java Mon Dec 10 19:36:06 2012
@@ -93,7 +93,7 @@ public class DefaultRolloverStrategy imp
      * @param min The minimum index.
      * @param max The maximum index.
      */
-    protected DefaultRolloverStrategy(int min, int max, boolean useMax, StrSubstitutor subst) {
+    protected DefaultRolloverStrategy(final int min, final int max, final boolean useMax, final StrSubstitutor subst) {
         minIndex = min;
         maxIndex = max;
         this.subst = subst;
@@ -106,7 +106,7 @@ public class DefaultRolloverStrategy imp
      * @return A RolloverDescription.
      * @throws SecurityException if an error occurs.
      */
-    public RolloverDescription rollover(RollingFileManager manager) throws SecurityException {
+    public RolloverDescription rollover(final RollingFileManager manager) throws SecurityException {
         if (maxIndex >= 0) {
             int fileIndex;
 
@@ -114,12 +114,12 @@ public class DefaultRolloverStrategy imp
                 return null;
             }
 
-            StringBuilder buf = new StringBuilder();
+            final StringBuilder buf = new StringBuilder();
             manager.getProcessor().formatFileName(buf, fileIndex);
-            String currentFileName = manager.getFileName();
+            final String currentFileName = manager.getFileName();
 
             String renameTo = subst.replace(buf);
-            String compressedName = renameTo;
+            final String compressedName = renameTo;
             Action compressAction = null;
 
             if (renameTo.endsWith(".gz")) {
@@ -130,7 +130,7 @@ public class DefaultRolloverStrategy imp
                 compressAction = new ZipCompressAction(new File(renameTo), new File(compressedName), true);
             }
 
-            FileRenameAction renameAction =
+            final FileRenameAction renameAction =
                 new FileRenameAction(new File(currentFileName), new File(renameTo), false);
 
             return new RolloverDescriptionImpl(currentFileName, false, renameAction, compressAction);
@@ -139,7 +139,7 @@ public class DefaultRolloverStrategy imp
         return null;
     }
 
-    private int purge(final int lowIndex, final int highIndex, RollingFileManager manager) {
+    private int purge(final int lowIndex, final int highIndex, final RollingFileManager manager) {
         return useMax ? purgeAscending(lowIndex, highIndex, manager) :
             purgeDescending(lowIndex, highIndex, manager);
     }
@@ -153,11 +153,11 @@ public class DefaultRolloverStrategy imp
      * @param manager The RollingFileManager
      * @return true if purge was successful and rollover should be attempted.
      */
-    private int purgeDescending(final int lowIndex, final int highIndex, RollingFileManager manager) {
+    private int purgeDescending(final int lowIndex, final int highIndex, final RollingFileManager manager) {
         int suffixLength = 0;
 
-        List<FileRenameAction> renames = new ArrayList<FileRenameAction>();
-        StringBuilder buf = new StringBuilder();
+        final List<FileRenameAction> renames = new ArrayList<FileRenameAction>();
+        final StringBuilder buf = new StringBuilder();
         manager.getProcessor().formatFileName(buf, lowIndex);
 
         String lowFilename = subst.replace(buf);
@@ -173,7 +173,7 @@ public class DefaultRolloverStrategy imp
             boolean isBase = false;
 
             if (suffixLength > 0) {
-                File toRenameBase =
+                final File toRenameBase =
                     new File(lowFilename.substring(0, lowFilename.length() - suffixLength));
 
                 if (toRename.exists()) {
@@ -205,7 +205,7 @@ public class DefaultRolloverStrategy imp
                 buf.setLength(0);
                 manager.getProcessor().formatFileName(buf, i + 1);
 
-                String highFilename = subst.replace(buf);
+                final String highFilename = subst.replace(buf);
                 String renameTo = highFilename;
 
                 if (isBase) {
@@ -223,13 +223,13 @@ public class DefaultRolloverStrategy imp
         //   work renames backwards
         //
         for (int i = renames.size() - 1; i >= 0; i--) {
-            Action action = renames.get(i);
+            final Action action = renames.get(i);
 
             try {
                 if (!action.execute()) {
                     return -1;
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 LOGGER.warn("Exception during purge in RollingFileAppender", ex);
                 return -1;
             }
@@ -247,11 +247,11 @@ public class DefaultRolloverStrategy imp
      * @param manager The RollingFileManager
      * @return true if purge was successful and rollover should be attempted.
      */
-    private int purgeAscending(final int lowIndex, final int highIndex, RollingFileManager manager) {
+    private int purgeAscending(final int lowIndex, final int highIndex, final RollingFileManager manager) {
         int suffixLength = 0;
 
-        List<FileRenameAction> renames = new ArrayList<FileRenameAction>();
-        StringBuilder buf = new StringBuilder();
+        final List<FileRenameAction> renames = new ArrayList<FileRenameAction>();
+        final StringBuilder buf = new StringBuilder();
         manager.getProcessor().formatFileName(buf, highIndex);
 
         String highFilename = subst.replace(buf);
@@ -276,7 +276,7 @@ public class DefaultRolloverStrategy imp
             boolean isBase = false;
 
             if (suffixLength > 0) {
-                File toRenameBase =
+                final File toRenameBase =
                     new File(highFilename.substring(0, highFilename.length() - suffixLength));
 
                 if (toRename.exists()) {
@@ -308,7 +308,7 @@ public class DefaultRolloverStrategy imp
                 buf.setLength(0);
                 manager.getProcessor().formatFileName(buf, i - 1);
 
-                String lowFilename = subst.replace(buf);
+                final String lowFilename = subst.replace(buf);
                 String renameTo = lowFilename;
 
                 if (isBase) {
@@ -332,13 +332,13 @@ public class DefaultRolloverStrategy imp
         //   work renames backwards
         //
         for (int i = renames.size() - 1; i >= 0; i--) {
-            Action action = renames.get(i);
+            final Action action = renames.get(i);
 
             try {
                 if (!action.execute()) {
                     return -1;
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 LOGGER.warn("Exception during purge in RollingFileAppender", ex);
                 return -1;
             }
@@ -359,11 +359,11 @@ public class DefaultRolloverStrategy imp
      * @return A DefaultRolloverStrategy.
      */
     @PluginFactory
-    public static DefaultRolloverStrategy createStrategy(@PluginAttr("max") String max,
-                                                         @PluginAttr("min") String min,
-                                                         @PluginAttr("fileIndex") String fileIndex,
-                                                         @PluginConfiguration Configuration config) {
-        boolean useMax = fileIndex == null ? true : fileIndex.equalsIgnoreCase("max");
+    public static DefaultRolloverStrategy createStrategy(@PluginAttr("max") final String max,
+                                                         @PluginAttr("min") final String min,
+                                                         @PluginAttr("fileIndex") final String fileIndex,
+                                                         @PluginConfiguration final Configuration config) {
+        final boolean useMax = fileIndex == null ? true : fileIndex.equalsIgnoreCase("max");
         int minIndex;
         if (min != null) {
             minIndex = Integer.parseInt(min);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/OnStartupTriggeringPolicy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/OnStartupTriggeringPolicy.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/OnStartupTriggeringPolicy.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/OnStartupTriggeringPolicy.java Mon Dec 10 19:36:06 2012
@@ -40,7 +40,7 @@ public class OnStartupTriggeringPolicy i
      * Provide the RollingFileManager to the policy.
      * @param manager The RollingFileManager.
      */
-    public void initialize(RollingFileManager manager) {
+    public void initialize(final RollingFileManager manager) {
         this.manager = manager;
     }
 
@@ -49,7 +49,7 @@ public class OnStartupTriggeringPolicy i
      * @param event   A reference to the current event.
      * @return true if the target file's timestamp is older than the JVM start time.
      */
-    public boolean isTriggeringEvent(LogEvent event) {
+    public boolean isTriggeringEvent(final LogEvent event) {
         if (evaluated) {
             return false;
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/PatternProcessor.java Mon Dec 10 19:36:06 2012
@@ -55,19 +55,19 @@ public class PatternProcessor {
      * Constructor.
      * @param pattern The file pattern.
      */
-    public PatternProcessor(String pattern) {
-        PatternParser parser = createPatternParser();
-        List<PatternConverter> converters = new ArrayList<PatternConverter>();
-        List<FormattingInfo> fields = new ArrayList<FormattingInfo>();
+    public PatternProcessor(final String pattern) {
+        final PatternParser parser = createPatternParser();
+        final List<PatternConverter> converters = new ArrayList<PatternConverter>();
+        final List<FormattingInfo> fields = new ArrayList<FormattingInfo>();
         parser.parse(pattern, converters, fields);
-        FormattingInfo[] infoArray = new FormattingInfo[fields.size()];
+        final FormattingInfo[] infoArray = new FormattingInfo[fields.size()];
         patternFields = fields.toArray(infoArray);
-        ArrayPatternConverter[] converterArray = new ArrayPatternConverter[converters.size()];
+        final ArrayPatternConverter[] converterArray = new ArrayPatternConverter[converters.size()];
         patternConverters = converters.toArray(converterArray);
 
-        for (ArrayPatternConverter converter : patternConverters) {
+        for (final ArrayPatternConverter converter : patternConverters) {
             if (converter instanceof DatePatternConverter) {
-                DatePatternConverter dateConverter = (DatePatternConverter) converter;
+                final DatePatternConverter dateConverter = (DatePatternConverter) converter;
                 frequency = calculateFrequency(dateConverter.getPattern());
             }
         }
@@ -79,16 +79,16 @@ public class PatternProcessor {
      * @param increment The increment to the next time.
      * @return the next potential rollover time and the timestamp for the target file.
      */
-    public long getNextTime(long current, int increment, boolean modulus) {
+    public long getNextTime(final long current, final int increment, final boolean modulus) {
         prevFileTime = nextFileTime;
         long nextTime;
 
         if (frequency == null) {
             throw new IllegalStateException("Pattern does not contain a date");
         }
-        Calendar currentCal = Calendar.getInstance();
+        final Calendar currentCal = Calendar.getInstance();
         currentCal.setTimeInMillis(current);
-        Calendar cal = Calendar.getInstance();
+        final Calendar cal = Calendar.getInstance();
         cal.set(currentCal.get(Calendar.YEAR), 0, 1, 0, 0, 0);
         cal.set(Calendar.MILLISECOND, 0);
         if (frequency == RolloverFrequency.ANNUALLY) {
@@ -151,8 +151,8 @@ public class PatternProcessor {
         return nextTime;
     }
 
-    private void increment(Calendar cal, int type, int increment, boolean modulate) {
-        int interval =  modulate ? increment - (cal.get(type) % increment) : increment;
+    private void increment(final Calendar cal, final int type, final int increment, final boolean modulate) {
+        final int interval =  modulate ? increment - (cal.get(type) % increment) : increment;
         cal.add(type, interval);
     }
 
@@ -162,7 +162,7 @@ public class PatternProcessor {
      * @param obj object to be evaluated in formatting, may not be null.
      */
     public final void formatFileName(final StringBuilder buf, final Object obj) {
-        long time = prevFileTime == 0 ? System.currentTimeMillis() : prevFileTime;
+        final long time = prevFileTime == 0 ? System.currentTimeMillis() : prevFileTime;
         formatFileName(buf, new Date(time), obj);
     }
 
@@ -173,7 +173,7 @@ public class PatternProcessor {
      */
     protected final void formatFileName(final StringBuilder buf, final Object... objects) {
         for (int i = 0; i < patternConverters.length; i++) {
-            int fieldStart = buf.length();
+            final int fieldStart = buf.length();
             patternConverters[i].format(buf, objects);
 
             if (patternFields[i] != null) {
@@ -182,7 +182,7 @@ public class PatternProcessor {
         }
     }
 
-    private RolloverFrequency calculateFrequency(String pattern) {
+    private RolloverFrequency calculateFrequency(final String pattern) {
         if (patternContains(pattern, MILLIS_CHAR)) {
             return RolloverFrequency.EVERY_MILLISECOND;
         }
@@ -215,8 +215,8 @@ public class PatternProcessor {
         return new PatternParser(null, KEY, null);
     }
 
-    private boolean patternContains(String pattern, char... chars) {
-        for (char character : chars) {
+    private boolean patternContains(final String pattern, final char... chars) {
+        for (final char character : chars) {
             if (patternContains(pattern, character)) {
                 return true;
             }
@@ -224,7 +224,7 @@ public class PatternProcessor {
         return false;
     }
 
-    private boolean patternContains(String pattern, char character) {
+    private boolean patternContains(final String pattern, final char character) {
         return pattern.indexOf(character) >= 0;
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java Mon Dec 10 19:36:06 2012
@@ -44,8 +44,8 @@ public class RollingFileManager extends 
     private final TriggeringPolicy policy;
     private final RolloverStrategy strategy;
 
-    protected RollingFileManager(String fileName, String pattern, OutputStream os, boolean append, long size,
-                                 long time, TriggeringPolicy policy, RolloverStrategy strategy) {
+    protected RollingFileManager(final String fileName, final String pattern, final OutputStream os, final boolean append, final long size,
+                                 final long time, final TriggeringPolicy policy, final RolloverStrategy strategy) {
         super(fileName, os, append, false);
         this.size = size;
         this.initialTime = time;
@@ -63,16 +63,16 @@ public class RollingFileManager extends 
      * @param bufferedIO true if data should be buffered.
      * @return A RollingFileManager.
      */
-    public static RollingFileManager getFileManager(String fileName, String pattern, boolean append,
-                                                    boolean bufferedIO, TriggeringPolicy policy,
-                                                    RolloverStrategy strategy) {
+    public static RollingFileManager getFileManager(final String fileName, final String pattern, final boolean append,
+                                                    final boolean bufferedIO, final TriggeringPolicy policy,
+                                                    final RolloverStrategy strategy) {
 
         return (RollingFileManager) getManager(fileName, new FactoryData(pattern, append,
             bufferedIO, policy, strategy), factory);
     }
 
     @Override
-    protected synchronized void write(byte[] bytes, int offset, int length) {
+    protected synchronized void write(final byte[] bytes, final int offset, final int length) {
         size += length;
         super.write(bytes, offset, length);
     }
@@ -97,14 +97,14 @@ public class RollingFileManager extends 
      * Determine if a rollover should occur.
      * @param event The LogEvent.
      */
-    public synchronized void checkRollover(LogEvent event) {
+    public synchronized void checkRollover(final LogEvent event) {
         if (policy.isTriggeringEvent(event) && rollover(strategy)) {
             try {
                 size = 0;
                 initialTime = System.currentTimeMillis();
-                OutputStream os = new FileOutputStream(getFileName(), isAppend());
+                final OutputStream os = new FileOutputStream(getFileName(), isAppend());
                 setOutputStream(os);
-            } catch (FileNotFoundException ex) {
+            } catch (final FileNotFoundException ex) {
                 LOGGER.error("FileManager (" + getFileName() + ") " + ex);
             }
         }
@@ -118,12 +118,12 @@ public class RollingFileManager extends 
         return processor;
     }
 
-    private boolean rollover(RolloverStrategy strategy) {
+    private boolean rollover(final RolloverStrategy strategy) {
 
         try {
             // Block until the asynchronous operation is completed.
             semaphore.acquire();
-        } catch (InterruptedException ie) {
+        } catch (final InterruptedException ie) {
             LOGGER.error("Thread interrupted while attempting to check rollover", ie);
             return false;
         }
@@ -132,7 +132,7 @@ public class RollingFileManager extends 
         Thread thread = null;
 
         try {
-            RolloverDescription descriptor = strategy.rollover(this);
+            final RolloverDescription descriptor = strategy.rollover(this);
 
             if (descriptor != null) {
 
@@ -142,7 +142,7 @@ public class RollingFileManager extends 
 
                     try {
                         success = descriptor.getSynchronous().execute();
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         LOGGER.error("Error in synchronous task", ex);
                     }
                 }
@@ -175,7 +175,7 @@ public class RollingFileManager extends 
          * @param act The action to perform.
          * @param manager The manager.
          */
-        public AsyncAction(Action act, RollingFileManager manager) {
+        public AsyncAction(final Action act, final RollingFileManager manager) {
             this.action = act;
             this.manager = manager;
         }
@@ -220,11 +220,11 @@ public class RollingFileManager extends 
      * Factory data.
      */
     private static class FactoryData {
-        private String pattern;
-        private boolean append;
-        private boolean bufferedIO;
-        private TriggeringPolicy policy;
-        private RolloverStrategy strategy;
+        private final String pattern;
+        private final boolean append;
+        private final boolean bufferedIO;
+        private final TriggeringPolicy policy;
+        private final RolloverStrategy strategy;
 
         /**
          * Create the data for the factory.
@@ -232,8 +232,8 @@ public class RollingFileManager extends 
          * @param append The append flag.
          * @param bufferedIO The bufferedIO flag.
          */
-        public FactoryData(String pattern, boolean append, boolean bufferedIO, TriggeringPolicy policy,
-                           RolloverStrategy strategy) {
+        public FactoryData(final String pattern, final boolean append, final boolean bufferedIO, final TriggeringPolicy policy,
+                           final RolloverStrategy strategy) {
             this.pattern = pattern;
             this.append = append;
             this.bufferedIO = bufferedIO;
@@ -253,20 +253,20 @@ public class RollingFileManager extends 
          * @param data The data required to create the entity.
          * @return a RollingFileManager.
          */
-        public RollingFileManager createManager(String name, FactoryData data) {
-            File file = new File(name);
+        public RollingFileManager createManager(final String name, final FactoryData data) {
+            final File file = new File(name);
             final File parent = file.getParentFile();
             if (null != parent && !parent.exists()) {
                 parent.mkdirs();
             }
             try {
                 file.createNewFile();
-            } catch (IOException ioe) {
+            } catch (final IOException ioe) {
                 LOGGER.error("Unable to create file " + name, ioe);
                 return null;
             }
-            long size = data.append ? file.length() : 0;
-            long time = file.lastModified();
+            final long size = data.append ? file.length() : 0;
+            final long time = file.lastModified();
 
             OutputStream os;
             try {
@@ -276,7 +276,7 @@ public class RollingFileManager extends 
                 }
                 return new RollingFileManager(name, data.pattern, os, data.append, size, time, data.policy,
                     data.strategy);
-            } catch (FileNotFoundException ex) {
+            } catch (final FileNotFoundException ex) {
                 LOGGER.error("FileManager (" + name + ") " + ex);
             }
             return null;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/SizeBasedTriggeringPolicy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/SizeBasedTriggeringPolicy.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/SizeBasedTriggeringPolicy.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/SizeBasedTriggeringPolicy.java Mon Dec 10 19:36:06 2012
@@ -79,7 +79,7 @@ public class SizeBasedTriggeringPolicy i
      * Initialize the TriggeringPolicy.
      * @param manager The RollingFileManager.
      */
-    public void initialize(RollingFileManager manager) {
+    public void initialize(final RollingFileManager manager) {
         this.manager = manager;
     }
 
@@ -89,7 +89,7 @@ public class SizeBasedTriggeringPolicy i
      * @param event   A reference to the currently event.
      * @return true if a rollover should take place, false otherwise.
      */
-    public boolean isTriggeringEvent(LogEvent event) {
+    public boolean isTriggeringEvent(final LogEvent event) {
         return manager.getFileSize() > maxFileSize;
     }
 
@@ -104,9 +104,9 @@ public class SizeBasedTriggeringPolicy i
      * @return A SizeBasedTriggeringPolicy.
      */
     @PluginFactory
-    public static SizeBasedTriggeringPolicy createPolicy(@PluginAttr("size") String size) {
+    public static SizeBasedTriggeringPolicy createPolicy(@PluginAttr("size") final String size) {
 
-        long maxSize = size == null ? MAX_FILE_SIZE : valueOf(size);
+        final long maxSize = size == null ? MAX_FILE_SIZE : valueOf(size);
         return new SizeBasedTriggeringPolicy(maxSize);
     }
 
@@ -143,7 +143,7 @@ public class SizeBasedTriggeringPolicy i
                     LOGGER.error("Units not recognized: " + string);
                     return MAX_FILE_SIZE;
                 }
-            } catch (ParseException e) {
+            } catch (final ParseException e) {
                 LOGGER.error("Unable to parse numeric part: " + string, e);
                 return MAX_FILE_SIZE;
             }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/TimeBasedTriggeringPolicy.java Mon Dec 10 19:36:06 2012
@@ -33,7 +33,7 @@ public final class TimeBasedTriggeringPo
 
     private RollingFileManager manager;
 
-    private TimeBasedTriggeringPolicy(int interval, boolean modulate) {
+    private TimeBasedTriggeringPolicy(final int interval, final boolean modulate) {
         this.interval = interval;
         this.modulate = modulate;
     }
@@ -42,7 +42,7 @@ public final class TimeBasedTriggeringPo
      * Initialize the policy.
      * @param manager The RollingFileManager.
      */
-    public void initialize(RollingFileManager manager) {
+    public void initialize(final RollingFileManager manager) {
         this.manager = manager;
         nextRollover = manager.getProcessor().getNextTime(manager.getFileTime(), interval, modulate);
     }
@@ -52,11 +52,11 @@ public final class TimeBasedTriggeringPo
      * @param event   A reference to the currently event.
      * @return true if a rollover should occur.
      */
-    public boolean isTriggeringEvent(LogEvent event) {
+    public boolean isTriggeringEvent(final LogEvent event) {
         if (manager.getFileSize() == 0) {
             return false;
         }
-        long now = System.currentTimeMillis();
+        final long now = System.currentTimeMillis();
         if (now > nextRollover) {
             nextRollover = manager.getProcessor().getNextTime(now, interval, modulate);
             return true;
@@ -74,10 +74,10 @@ public final class TimeBasedTriggeringPo
      * @return a TimeBasedTriggeringPolicy.
      */
     @PluginFactory
-    public static TimeBasedTriggeringPolicy createPolicy(@PluginAttr("interval") String interval,
-                                                         @PluginAttr("modulate") String modulate) {
-        int increment = interval == null ? 1 : Integer.parseInt(interval);
-        boolean mod = modulate == null ? false : Boolean.parseBoolean(modulate);
+    public static TimeBasedTriggeringPolicy createPolicy(@PluginAttr("interval") final String interval,
+                                                         @PluginAttr("modulate") final String modulate) {
+        final int increment = interval == null ? 1 : Integer.parseInt(interval);
+        final boolean mod = modulate == null ? false : Boolean.parseBoolean(modulate);
         return new TimeBasedTriggeringPolicy(increment, mod);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/AbstractAction.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/AbstractAction.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/AbstractAction.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/AbstractAction.java Mon Dec 10 19:36:06 2012
@@ -61,7 +61,7 @@ public abstract class AbstractAction imp
         if (!interrupted) {
             try {
                 execute();
-            } catch (IOException ex) {
+            } catch (final IOException ex) {
                 reportException(ex);
             }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/CompositeAction.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/CompositeAction.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/CompositeAction.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/CompositeAction.java Mon Dec 10 19:36:06 2012
@@ -55,7 +55,7 @@ public class CompositeAction extends Abs
     public void run() {
         try {
             execute();
-        } catch (IOException ex) {
+        } catch (final IOException ex) {
             LOGGER.warn("Exception during file rollover.", ex);
         }
     }
@@ -69,7 +69,7 @@ public class CompositeAction extends Abs
     @Override
     public boolean execute() throws IOException {
         if (stopOnError) {
-            for (Action action : actions) {
+            for (final Action action : actions) {
                 if (!action.execute()) {
                     return false;
                 }
@@ -80,10 +80,10 @@ public class CompositeAction extends Abs
             boolean status = true;
             IOException exception = null;
 
-            for (Action action : actions) {
+            for (final Action action : actions) {
                 try {
                     status &= action.execute();
-                } catch (IOException ex) {
+                } catch (final IOException ex) {
                     status = false;
 
                     if (exception == null) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/FileRenameAction.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/FileRenameAction.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/FileRenameAction.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/FileRenameAction.java Mon Dec 10 19:36:06 2012
@@ -49,7 +49,7 @@ public class FileRenameAction extends Ab
      * @param dst              new file name.
      * @param renameEmptyFiles if true, rename file even if empty, otherwise delete empty files.
      */
-    public FileRenameAction(final File src, final File dst, boolean renameEmptyFiles) {
+    public FileRenameAction(final File src, final File dst, final boolean renameEmptyFiles) {
         source = src;
         destination = dst;
         this.renameEmptyFiles = renameEmptyFiles;
@@ -73,9 +73,9 @@ public class FileRenameAction extends Ab
      * @param renameEmptyFiles if true, rename file even if empty, otherwise delete empty files.
      * @return true if successfully renamed.
      */
-    public static boolean execute(final File source, final File destination, boolean renameEmptyFiles) {
+    public static boolean execute(final File source, final File destination, final boolean renameEmptyFiles) {
         if (renameEmptyFiles || (source.length() > 0)) {
-            File parent = destination.getParentFile();
+            final File parent = destination.getParentFile();
             if (!parent.exists()) {
                 if (!parent.mkdirs()) {
                     LOGGER.error("Unable to create directory {}", parent.getAbsolutePath());
@@ -87,17 +87,17 @@ public class FileRenameAction extends Ab
                     try {
                         copyFile(source, destination);
                         return source.delete();
-                    } catch (IOException iex) {
+                    } catch (final IOException iex) {
                         LOGGER.error("Unable to rename file {} to {} - {}", source.getAbsolutePath(),
                             destination.getAbsolutePath(), iex.getMessage());
                     }
                 }
                 return true;
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 try {
                     copyFile(source, destination);
                     return source.delete();
-                } catch (IOException iex) {
+                } catch (final IOException iex) {
                     LOGGER.error("Unable to rename file {} to {} - {}", source.getAbsolutePath(),
                         destination.getAbsolutePath(), iex.getMessage());
                 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/GZCompressAction.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/GZCompressAction.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/GZCompressAction.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/GZCompressAction.java Mon Dec 10 19:36:06 2012
@@ -92,11 +92,11 @@ public final class GZCompressAction exte
     public static boolean execute(final File source, final File destination, final boolean deleteSource)
         throws IOException {
         if (source.exists()) {
-            FileInputStream fis = new FileInputStream(source);
-            FileOutputStream fos = new FileOutputStream(destination);
-            GZIPOutputStream gzos = new GZIPOutputStream(fos);
-            BufferedOutputStream os = new BufferedOutputStream(gzos);
-            byte[] inbuf = new byte[BUF_SIZE];
+            final FileInputStream fis = new FileInputStream(source);
+            final FileOutputStream fos = new FileOutputStream(destination);
+            final GZIPOutputStream gzos = new GZIPOutputStream(fos);
+            final BufferedOutputStream os = new BufferedOutputStream(gzos);
+            final byte[] inbuf = new byte[BUF_SIZE];
             int n;
 
             while ((n = fis.read(inbuf)) != -1) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/ZipCompressAction.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/ZipCompressAction.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/ZipCompressAction.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/rolling/helper/ZipCompressAction.java Mon Dec 10 19:36:06 2012
@@ -93,14 +93,14 @@ public final class ZipCompressAction ext
     public static boolean execute(final File source, final File destination, final boolean deleteSource)
         throws IOException {
         if (source.exists()) {
-            FileInputStream fis = new FileInputStream(source);
-            FileOutputStream fos = new FileOutputStream(destination);
-            ZipOutputStream zos = new ZipOutputStream(fos);
+            final FileInputStream fis = new FileInputStream(source);
+            final FileOutputStream fos = new FileOutputStream(destination);
+            final ZipOutputStream zos = new ZipOutputStream(fos);
 
-            ZipEntry zipEntry = new ZipEntry(source.getName());
+            final ZipEntry zipEntry = new ZipEntry(source.getName());
             zos.putNextEntry(zipEntry);
 
-            byte[] inbuf = new byte[BUF_SIZE];
+            final byte[] inbuf = new byte[BUF_SIZE];
             int n;
 
             while ((n = fis.read(inbuf)) != -1) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Route.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Route.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Route.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Route.java Mon Dec 10 19:36:06 2012
@@ -35,7 +35,7 @@ public final class Route {
     private final String appenderRef;
     private final String key;
 
-    private Route(Node node, String appenderRef, String key) {
+    private Route(final Node node, final String appenderRef, final String key) {
         this.node = node;
         this.appenderRef = appenderRef;
         this.key = key;
@@ -67,7 +67,7 @@ public final class Route {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder("Route(");
+        final StringBuilder sb = new StringBuilder("Route(");
         sb.append("type=");
         if (appenderRef != null) {
             sb.append("static Reference=").append(appenderRef);
@@ -93,11 +93,11 @@ public final class Route {
      * @return A Route.
      */
     @PluginFactory
-    public static Route createRoute(@PluginAttr("ref") String appenderRef,
-                                    @PluginAttr("key") String key,
-                                    @PluginNode Node node) {
+    public static Route createRoute(@PluginAttr("ref") final String appenderRef,
+                                    @PluginAttr("key") final String key,
+                                    @PluginNode final Node node) {
         if (node != null && node.hasChildren()) {
-            for (Node child : node.getChildren()) {
+            for (final Node child : node.getChildren()) {
 
             }
             if (appenderRef != null) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/Routes.java Mon Dec 10 19:36:06 2012
@@ -34,7 +34,7 @@ public final class Routes {
     private final String pattern;
     private final Route[] routes;
 
-    private Routes(String pattern, Route... routes) {
+    private Routes(final String pattern, final Route... routes) {
         this.pattern = pattern;
         this.routes = routes;
     }
@@ -57,9 +57,9 @@ public final class Routes {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder("{");
+        final StringBuilder sb = new StringBuilder("{");
         boolean first = true;
-        for (Route route : routes) {
+        for (final Route route : routes) {
             if ((!first)) {
                 sb.append(",");
             }
@@ -78,8 +78,8 @@ public final class Routes {
      * @return The Routes container.
      */
     @PluginFactory
-    public static Routes createRoutes(@PluginAttr("pattern") String pattern,
-                                      @PluginElement("routes") Route... routes) {
+    public static Routes createRoutes(@PluginAttr("pattern") final String pattern,
+                                      @PluginElement("routes") final Route... routes) {
         if (pattern == null) {
             LOGGER.error("A pattern is required");
             return null;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java Mon Dec 10 19:36:06 2012
@@ -48,17 +48,17 @@ public final class RoutingAppender exten
     private final Routes routes;
     private final Route defaultRoute;
     private final Configuration config;
-    private ConcurrentMap<String, AppenderControl> appenders = new ConcurrentHashMap<String, AppenderControl>();
+    private final ConcurrentMap<String, AppenderControl> appenders = new ConcurrentHashMap<String, AppenderControl>();
     private final RewritePolicy rewritePolicy;
 
-    private RoutingAppender(String name, Filter filter, boolean handleException, Routes routes,
-                            RewritePolicy rewritePolicy, Configuration config) {
+    private RoutingAppender(final String name, final Filter filter, final boolean handleException, final Routes routes,
+                            final RewritePolicy rewritePolicy, final Configuration config) {
         super(name, filter, null, handleException);
         this.routes = routes;
         this.config = config;
         this.rewritePolicy = rewritePolicy;
         Route defRoute = null;
-        for (Route route : routes.getRoutes()) {
+        for (final Route route : routes.getRoutes()) {
             if (route.getKey() == null) {
                 if (defRoute == null) {
                     defRoute = route;
@@ -72,13 +72,13 @@ public final class RoutingAppender exten
 
     @Override
     public void start() {
-        Map<String, Appender> map = config.getAppenders();
+        final Map<String, Appender> map = config.getAppenders();
         // Register all the static routes.
-        for (Route route : routes.getRoutes()) {
+        for (final Route route : routes.getRoutes()) {
             if (route.getAppenderRef() != null) {
-                Appender appender = map.get(route.getAppenderRef());
+                final Appender appender = map.get(route.getAppenderRef());
                 if (appender != null) {
-                    String key = route == defaultRoute ? DEFAULT_KEY : route.getKey();
+                    final String key = route == defaultRoute ? DEFAULT_KEY : route.getKey();
                     appenders.put(key, new AppenderControl(appender, null, null));
                 } else {
                     LOGGER.error("Appender " + route.getAppenderRef() + " cannot be located. Route ignored");
@@ -91,9 +91,9 @@ public final class RoutingAppender exten
     @Override
     public void stop() {
         super.stop();
-        Map<String, Appender> map = config.getAppenders();
-        for (Map.Entry<String, AppenderControl> entry : appenders.entrySet()) {
-            String name = entry.getValue().getAppender().getName();
+        final Map<String, Appender> map = config.getAppenders();
+        for (final Map.Entry<String, AppenderControl> entry : appenders.entrySet()) {
+            final String name = entry.getValue().getAppender().getName();
             if (!map.containsKey(name)) {
                 entry.getValue().getAppender().stop();
             }
@@ -104,20 +104,20 @@ public final class RoutingAppender exten
         if (rewritePolicy != null) {
             event = rewritePolicy.rewrite(event);
         }
-        String key = config.getSubst().replace(event, routes.getPattern());
-        AppenderControl control = getControl(key, event);
+        final String key = config.getSubst().replace(event, routes.getPattern());
+        final AppenderControl control = getControl(key, event);
         if (control != null) {
             control.callAppender(event);
         }
     }
 
-    private synchronized AppenderControl getControl(String key, LogEvent event) {
+    private synchronized AppenderControl getControl(final String key, final LogEvent event) {
         AppenderControl control = appenders.get(key);
         if (control != null) {
             return control;
         }
         Route route = null;
-        for (Route r : routes.getRoutes()) {
+        for (final Route r : routes.getRoutes()) {
             if (r.getAppenderRef() == null && key.equals(r.getKey())) {
                 route = r;
                 break;
@@ -127,7 +127,7 @@ public final class RoutingAppender exten
             route = defaultRoute;
         }
         if (route != null) {
-            Appender app = createAppender(route, event);
+            final Appender app = createAppender(route, event);
             if (app == null) {
                 return null;
             }
@@ -138,14 +138,14 @@ public final class RoutingAppender exten
         return control;
     }
 
-    private Appender createAppender(Route route, LogEvent event) {
-        Node routeNode = route.getNode();
-        for (Node node : routeNode.getChildren()) {
+    private Appender createAppender(final Route route, final LogEvent event) {
+        final Node routeNode = route.getNode();
+        for (final Node node : routeNode.getChildren()) {
             if (node.getType().getElementName().equals("appender")) {
-                Node appNode = new Node(node);
+                final Node appNode = new Node(node);
                 config.createConfiguration(appNode, event);
                 if (appNode.getObject() instanceof Appender) {
-                    Appender app = (Appender) appNode.getObject();
+                    final Appender app = (Appender) appNode.getObject();
                     app.start();
                     return app;
                 }
@@ -169,14 +169,14 @@ public final class RoutingAppender exten
      * @return The RoutingAppender
      */
     @PluginFactory
-    public static RoutingAppender createAppender(@PluginAttr("name") String name,
-                                          @PluginAttr("suppressExceptions") String suppress,
-                                          @PluginElement("routes") Routes routes,
-                                          @PluginConfiguration Configuration config,
-                                          @PluginElement("rewritePolicy") RewritePolicy rewritePolicy,
-                                          @PluginElement("filters") Filter filter) {
+    public static RoutingAppender createAppender(@PluginAttr("name") final String name,
+                                          @PluginAttr("suppressExceptions") final String suppress,
+                                          @PluginElement("routes") final Routes routes,
+                                          @PluginConfiguration final Configuration config,
+                                          @PluginElement("rewritePolicy") final RewritePolicy rewritePolicy,
+                                          @PluginElement("filters") final Filter filter) {
 
-        boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
+        final boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
 
         if (name == null) {
             LOGGER.error("No name provided for RoutingAppender");

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/AppenderControl.java Mon Dec 10 19:36:06 2012
@@ -42,7 +42,7 @@ public class AppenderControl extends Abs
      * @param level the Level to filter on.
      * @param filter the Filter(s) to apply.
      */
-    public AppenderControl(Appender appender, Level level, Filter filter) {
+    public AppenderControl(final Appender appender, final Level level, final Filter filter) {
         super(filter);
         this.appender = appender;
         this.level = level;
@@ -62,9 +62,9 @@ public class AppenderControl extends Abs
      * Call the appender.
      * @param event The event to process.
      */
-    public void callAppender(LogEvent event) {
+    public void callAppender(final LogEvent event) {
         if (getFilter() != null) {
-            Filter.Result r = getFilter().filter(event);
+            final Filter.Result r = getFilter().filter(event);
             if (r == Filter.Result.DENY) {
                 return;
             }
@@ -96,12 +96,12 @@ public class AppenderControl extends Abs
 
             try {
                 appender.append(event);
-            } catch (RuntimeException ex) {
+            } catch (final RuntimeException ex) {
                 appender.getHandler().error("An exception occurred processing Appender " + appender.getName(), ex);
                 if (!appender.isExceptionSuppressed()) {
                     throw ex;
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 appender.getHandler().error("An exception occurred processing Appender " + appender.getName(), ex);
                 if (!appender.isExceptionSuppressed()) {
                     throw new AppenderRuntimeException(ex);



Mime
View raw message