logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1501104 [3/5] - 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/s...
Date Tue, 09 Jul 2013 06:08:28 GMT
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/LoggerContextAdmin.java Tue Jul  9 06:08:25 2013
@@ -67,24 +67,24 @@ public class LoggerContextAdmin extends 
      * @param executor used to send notifications asynchronously
      * @param loggerContext the instrumented object
      */
-    public LoggerContextAdmin(LoggerContext loggerContext, Executor executor) {
+    public LoggerContextAdmin(final LoggerContext loggerContext, final Executor executor) {
         super(executor, createNotificationInfo());
         this.loggerContext = Assert.isNotNull(loggerContext, "loggerContext");
         try {
-            String ctxName = Server.escape(loggerContext.getName());
-            String name = String.format(PATTERN, ctxName);
+            final String ctxName = Server.escape(loggerContext.getName());
+            final String name = String.format(PATTERN, ctxName);
             objectName = new ObjectName(name);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new IllegalStateException(e);
         }
         loggerContext.addPropertyChangeListener(this);
     }
 
     private static MBeanNotificationInfo createNotificationInfo() {
-        String[] notifTypes = new String[] {//
+        final String[] notifTypes = new String[] {//
                 NOTIF_TYPE_RECONFIGURED };
-        String name = Notification.class.getName();
-        String description = "Configuration reconfigured";
+        final String name = Notification.class.getName();
+        final String description = "Configuration reconfigured";
         return new MBeanNotificationInfo(notifTypes, name, description);
     }
 
@@ -114,12 +114,12 @@ public class LoggerContextAdmin extends 
     }
 
     @Override
-    public void setConfigLocationURI(String configLocation)
+    public void setConfigLocationURI(final String configLocation)
             throws URISyntaxException, IOException {
         LOGGER.debug("---------");
         LOGGER.debug("Remote request to reconfigure using location "
                 + configLocation);
-        URI uri = new URI(configLocation);
+        final URI uri = new URI(configLocation);
 
         // validate the location first: invalid location will result in
         // default configuration being configured, try to avoid that...
@@ -130,7 +130,7 @@ public class LoggerContextAdmin extends 
     }
 
     @Override
-    public void propertyChange(PropertyChangeEvent evt) {
+    public void propertyChange(final PropertyChangeEvent evt) {
         if (!LoggerContext.PROPERTY_CONFIG.equals(evt.getPropertyName())) {
             return;
         }
@@ -138,7 +138,7 @@ public class LoggerContextAdmin extends 
         if (loggerContext.getConfiguration().getName() != null) {
             customConfigText = null;
         }
-        Notification notif = new Notification(NOTIF_TYPE_RECONFIGURED,
+        final Notification notif = new Notification(NOTIF_TYPE_RECONFIGURED,
                 getObjectName(), nextSeqNo(), now(), null);
         sendNotification(notif);
     }
@@ -149,50 +149,50 @@ public class LoggerContextAdmin extends 
     }
 
     @Override
-    public String getConfigText(String charsetName) throws IOException {
+    public String getConfigText(final String charsetName) throws IOException {
         if (customConfigText != null) {
             return customConfigText;
         }
         try {
-            Charset charset = Charset.forName(charsetName);
+            final Charset charset = Charset.forName(charsetName);
             return readContents(new URI(getConfigLocationURI()), charset);
-        } catch (Exception ex) {
-            StringWriter sw = new StringWriter(BUFFER_SIZE);
+        } catch (final Exception ex) {
+            final StringWriter sw = new StringWriter(BUFFER_SIZE);
             ex.printStackTrace(new PrintWriter(sw));
             return sw.toString();
         }
     }
 
     @Override
-    public void setConfigText(String configText, String charsetName) {
-        String old = customConfigText;
+    public void setConfigText(final String configText, final String charsetName) {
+        final String old = customConfigText;
         customConfigText = Assert.isNotNull(configText, "configText");
         LOGGER.debug("---------");
         LOGGER.debug("Remote request to reconfigure from config text.");
 
         try {
-            InputStream in = new ByteArrayInputStream(
+            final InputStream in = new ByteArrayInputStream(
                     configText.getBytes(charsetName));
-            ConfigurationSource source = new ConfigurationSource(in);
-            Configuration updated = ConfigurationFactory.getInstance()
+            final ConfigurationSource source = new ConfigurationSource(in);
+            final Configuration updated = ConfigurationFactory.getInstance()
                     .getConfiguration(source);
             loggerContext.start(updated);
             LOGGER.debug("Completed remote request to reconfigure from config text.");
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             customConfigText = old;
-            String msg = "Could not reconfigure from config text";
+            final String msg = "Could not reconfigure from config text";
             LOGGER.error(msg, ex);
             throw new IllegalArgumentException(msg, ex);
         }
     }
 
-    private String readContents(URI uri, Charset charset) throws IOException {
+    private String readContents(final URI uri, final Charset charset) throws IOException {
         InputStream in = null;
         try {
             in = uri.toURL().openStream();
-            Reader reader = new InputStreamReader(in, charset);
-            StringBuilder result = new StringBuilder(TEXT_BUFFER);
-            char[] buff = new char[PAGE];
+            final Reader reader = new InputStreamReader(in, charset);
+            final StringBuilder result = new StringBuilder(TEXT_BUFFER);
+            final char[] buff = new char[PAGE];
             int count = -1;
             while ((count = reader.read(buff)) >= 0) {
                 result.append(buff, 0, count);
@@ -201,7 +201,7 @@ public class LoggerContextAdmin extends 
         } finally {
             try {
                 in.close();
-            } catch (Exception ignored) {
+            } catch (final Exception ignored) {
                 // ignored
             }
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java Tue Jul  9 06:08:25 2013
@@ -61,11 +61,11 @@ public final class Server {
      *            {@link ObjectName}.
      * @return the escaped name
      */
-    public static String escape(String name) {
-        StringBuilder sb = new StringBuilder(name.length() * 2);
+    public static String escape(final String name) {
+        final StringBuilder sb = new StringBuilder(name.length() * 2);
         boolean needsQuotes = false;
         for (int i = 0; i < name.length(); i++) {
-            char c = name.charAt(i);
+            final char c = name.charAt(i);
             switch (c) {
             case ',':
             case '=':
@@ -95,7 +95,7 @@ public final class Server {
      * @throws JMException
      *             if a problem occurs during registration
      */
-    public static void registerMBeans(ContextSelector selector)
+    public static void registerMBeans(final ContextSelector selector)
             throws JMException {
 
         // avoid creating Platform MBean Server if JMX disabled
@@ -104,7 +104,7 @@ public final class Server {
                     "JMX disabled for log4j2. Not registering MBeans.");
             return;
         }
-        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+        final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
         registerMBeans(selector, mbs);
     }
 
@@ -120,7 +120,7 @@ public final class Server {
      * @throws JMException
      *             if a problem occurs during registration
      */
-    public static void registerMBeans(ContextSelector selector,
+    public static void registerMBeans(final ContextSelector selector,
             final MBeanServer mbs) throws JMException {
 
         if (Boolean.getBoolean(PROPERTY_DISABLE_JMX)) {
@@ -132,14 +132,14 @@ public final class Server {
         registerStatusLogger(mbs, executor);
         registerContextSelector(selector, mbs, executor);
 
-        List<LoggerContext> contexts = selector.getLoggerContexts();
+        final List<LoggerContext> contexts = selector.getLoggerContexts();
         registerContexts(contexts, mbs, executor);
 
         for (final LoggerContext context : contexts) {
             context.addPropertyChangeListener(new PropertyChangeListener() {
 
                 @Override
-                public void propertyChange(PropertyChangeEvent evt) {
+                public void propertyChange(final PropertyChangeEvent evt) {
                     if (!LoggerContext.PROPERTY_CONFIG.equals(evt
                             .getPropertyName())) {
                         return;
@@ -154,7 +154,7 @@ public final class Server {
                     try {
                         registerLoggerConfigs(context, mbs, executor);
                         registerAppenders(context, mbs, executor);
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         StatusLogger.getLogger().error(
                                 "Could not register mbeans", ex);
                     }
@@ -163,87 +163,87 @@ public final class Server {
         }
     }
 
-    private static void registerStatusLogger(MBeanServer mbs, Executor executor)
+    private static void registerStatusLogger(final MBeanServer mbs, final Executor executor)
             throws MalformedObjectNameException,
             InstanceAlreadyExistsException, MBeanRegistrationException,
             NotCompliantMBeanException {
 
-        StatusLoggerAdmin mbean = new StatusLoggerAdmin(executor);
+        final StatusLoggerAdmin mbean = new StatusLoggerAdmin(executor);
         mbs.registerMBean(mbean, mbean.getObjectName());
     }
 
-    private static void registerContextSelector(ContextSelector selector,
-            MBeanServer mbs, Executor executor)
+    private static void registerContextSelector(final ContextSelector selector,
+            final MBeanServer mbs, final Executor executor)
             throws MalformedObjectNameException,
             InstanceAlreadyExistsException, MBeanRegistrationException,
             NotCompliantMBeanException {
 
-        ContextSelectorAdmin mbean = new ContextSelectorAdmin(selector);
+        final ContextSelectorAdmin mbean = new ContextSelectorAdmin(selector);
         mbs.registerMBean(mbean, mbean.getObjectName());
     }
 
-    private static void registerContexts(List<LoggerContext> contexts,
-            MBeanServer mbs, Executor executor)
+    private static void registerContexts(final List<LoggerContext> contexts,
+            final MBeanServer mbs, final Executor executor)
             throws MalformedObjectNameException,
             InstanceAlreadyExistsException, MBeanRegistrationException,
             NotCompliantMBeanException {
 
-        for (LoggerContext ctx : contexts) {
-            LoggerContextAdmin mbean = new LoggerContextAdmin(ctx, executor);
+        for (final LoggerContext ctx : contexts) {
+            final LoggerContextAdmin mbean = new LoggerContextAdmin(ctx, executor);
             mbs.registerMBean(mbean, mbean.getObjectName());
         }
     }
 
-    private static void unregisterLoggerConfigs(LoggerContext context,
-            MBeanServer mbs) {
-        String pattern = LoggerConfigAdminMBean.PATTERN;
-        String search = String.format(pattern, context.getName(), "*");
+    private static void unregisterLoggerConfigs(final LoggerContext context,
+            final MBeanServer mbs) {
+        final String pattern = LoggerConfigAdminMBean.PATTERN;
+        final String search = String.format(pattern, context.getName(), "*");
         unregisterAllMatching(search, mbs);
     }
 
-    private static void unregisterAppenders(LoggerContext context,
-            MBeanServer mbs) {
-        String pattern = AppenderAdminMBean.PATTERN;
-        String search = String.format(pattern, context.getName(), "*");
+    private static void unregisterAppenders(final LoggerContext context,
+            final MBeanServer mbs) {
+        final String pattern = AppenderAdminMBean.PATTERN;
+        final String search = String.format(pattern, context.getName(), "*");
         unregisterAllMatching(search, mbs);
     }
 
-    private static void unregisterAllMatching(String search, MBeanServer mbs) {
+    private static void unregisterAllMatching(final String search, final MBeanServer mbs) {
         try {
-            ObjectName pattern = new ObjectName(search);
-            Set<ObjectName> found = mbs.queryNames(pattern, null);
-            for (ObjectName objectName : found) {
+            final ObjectName pattern = new ObjectName(search);
+            final Set<ObjectName> found = mbs.queryNames(pattern, null);
+            for (final ObjectName objectName : found) {
                 mbs.unregisterMBean(objectName);
             }
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             StatusLogger.getLogger()
                     .error("Could not unregister " + search, ex);
         }
     }
 
-    private static void registerLoggerConfigs(LoggerContext ctx,
-            MBeanServer mbs, Executor executor)
+    private static void registerLoggerConfigs(final LoggerContext ctx,
+            final MBeanServer mbs, final Executor executor)
             throws MalformedObjectNameException,
             InstanceAlreadyExistsException, MBeanRegistrationException,
             NotCompliantMBeanException {
 
-        Map<String, LoggerConfig> map = ctx.getConfiguration().getLoggers();
-        for (String name : map.keySet()) {
-            LoggerConfig cfg = map.get(name);
-            LoggerConfigAdmin mbean = new LoggerConfigAdmin(ctx.getName(), cfg);
+        final Map<String, LoggerConfig> map = ctx.getConfiguration().getLoggers();
+        for (final String name : map.keySet()) {
+            final LoggerConfig cfg = map.get(name);
+            final LoggerConfigAdmin mbean = new LoggerConfigAdmin(ctx.getName(), cfg);
             mbs.registerMBean(mbean, mbean.getObjectName());
         }
     }
 
-    private static void registerAppenders(LoggerContext ctx, MBeanServer mbs,
-            Executor executor) throws MalformedObjectNameException,
+    private static void registerAppenders(final LoggerContext ctx, final MBeanServer mbs,
+            final Executor executor) throws MalformedObjectNameException,
             InstanceAlreadyExistsException, MBeanRegistrationException,
             NotCompliantMBeanException {
 
-        Map<String, Appender<?>> map = ctx.getConfiguration().getAppenders();
-        for (String name : map.keySet()) {
-            Appender<?> appender = map.get(name);
-            AppenderAdmin mbean = new AppenderAdmin(ctx.getName(), appender);
+        final Map<String, Appender<?>> map = ctx.getConfiguration().getAppenders();
+        for (final String name : map.keySet()) {
+            final Appender<?> appender = map.get(name);
+            final AppenderAdmin mbean = new AppenderAdmin(ctx.getName(), appender);
             mbs.registerMBean(mbean, mbean.getObjectName());
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/jmx/StatusLoggerAdmin.java Tue Jul  9 06:08:25 2013
@@ -44,28 +44,28 @@ public class StatusLoggerAdmin extends N
      * 
      * @param executor used to send notifications asynchronously
      */
-    public StatusLoggerAdmin(Executor executor) {
+    public StatusLoggerAdmin(final Executor executor) {
         super(executor, createNotificationInfo());
         try {
             objectName = new ObjectName(NAME);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new IllegalStateException(e);
         }
         StatusLogger.getLogger().registerListener(this);
     }
 
     private static MBeanNotificationInfo createNotificationInfo() {
-        String[] notifTypes = new String[] {//
+        final String[] notifTypes = new String[] {//
         NOTIF_TYPE_DATA, NOTIF_TYPE_MESSAGE };
-        String name = Notification.class.getName();
-        String description = "StatusLogger has logged an event";
+        final String name = Notification.class.getName();
+        final String description = "StatusLogger has logged an event";
         return new MBeanNotificationInfo(notifTypes, name, description);
     }
 
     @Override
     public String[] getStatusDataHistory() {
-        List<StatusData> data = getStatusData();
-        String[] result = new String[data.size()];
+        final List<StatusData> data = getStatusData();
+        final String[] result = new String[data.size()];
         for (int i = 0; i < result.length; i++) {
             result[i] = data.get(i).getFormattedStatus();
         }
@@ -83,7 +83,7 @@ public class StatusLoggerAdmin extends N
     }
 
     @Override
-    public void setLevel(String level) {
+    public void setLevel(final String level) {
         StatusLogger.getLogger().setLevel(Level.valueOf(level));
     }
 
@@ -95,12 +95,12 @@ public class StatusLoggerAdmin extends N
      * .log4j.status.StatusData)
      */
     @Override
-    public void log(StatusData data) {
-        Notification notifMsg = new Notification(NOTIF_TYPE_MESSAGE,
+    public void log(final StatusData data) {
+        final Notification notifMsg = new Notification(NOTIF_TYPE_MESSAGE,
                 getObjectName(), nextSeqNo(), now(), data.getFormattedStatus());
         sendNotification(notifMsg);
 
-        Notification notifData = new Notification(NOTIF_TYPE_DATA,
+        final Notification notifData = new Notification(NOTIF_TYPE_DATA,
                 getObjectName(), nextSeqNo(), now());
         notifData.setUserData(data);
         sendNotification(notifData);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/LoggerFields.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/LoggerFields.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/LoggerFields.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/LoggerFields.java Tue Jul  9 06:08:25 2013
@@ -31,9 +31,9 @@ import org.apache.logging.log4j.core.hel
 @Plugin(name = "LoggerFields", category = "Core", printObject = true)
 public final class LoggerFields {
 
-    private Map<String, String> map;
+    private final Map<String, String> map;
 
-    private LoggerFields(Map<String, String> map) {
+    private LoggerFields(final Map<String, String> map) {
         this.map = Collections.unmodifiableMap(map);
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java Tue Jul  9 06:08:25 2013
@@ -178,9 +178,9 @@ public final class RFC5424Layout extends
         if (loggerFields != null && !loggerFields.isEmpty()) {
             final PatternParser fieldParser = createPatternParser(config, null);
 
-            Map<String, List<PatternFormatter>> map = new HashMap<String, List<PatternFormatter>>();
-            for (Map.Entry<String, String> entry : loggerFields.entrySet()) {
-                List<PatternFormatter> formatters = fieldParser.parse(entry.getValue(), false);
+            final Map<String, List<PatternFormatter>> map = new HashMap<String, List<PatternFormatter>>();
+            for (final Map.Entry<String, String> entry : loggerFields.entrySet()) {
+                final List<PatternFormatter> formatters = fieldParser.parse(entry.getValue(), false);
                 map.put(entry.getKey(), formatters);
             }
             this.fieldFormatters = map;
@@ -219,7 +219,7 @@ public final class RFC5424Layout extends
      */
     @Override
     public Map<String, String> getContentFormat() {
-        Map<String, String> result = new HashMap<String, String>();
+        final Map<String, String> result = new HashMap<String, String>();
         result.put("structured", "true");
         result.put("formatType", "RFC5424");
         return result;
@@ -451,7 +451,7 @@ public final class RFC5424Layout extends
         }
     }
 
-    private String escapeSDParams(String value) {
+    private String escapeSDParams(final String value) {
         return PARAM_VALUE_ESCAPE_PATTERN.matcher(value).replaceAll("\\\\$0");
     }
 
@@ -534,8 +534,8 @@ public final class RFC5424Layout extends
                                              @PluginAttr("enterpriseNumber") final String ein,
                                              @PluginAttr("includeMDC") final String includeMDC,
                                              @PluginAttr("mdcId") String mdcId,
-                                             @PluginAttr("mdcPrefix") String mdcPrefix,
-                                             @PluginAttr("eventPrefix") String eventPrefix,
+                                             @PluginAttr("mdcPrefix") final String mdcPrefix,
+                                             @PluginAttr("eventPrefix") final String eventPrefix,
                                              @PluginAttr("newLine") final String includeNL,
                                              @PluginAttr("newLineEscape") final String escapeNL,
                                              @PluginAttr("appName") final String appName,

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/SyslogLayout.java Tue Jul  9 06:08:25 2013
@@ -135,7 +135,7 @@ public class SyslogLayout extends Abstra
     @Override
     public Map<String, String> getContentFormat()
     {
-        Map<String, String> result = new HashMap<String, String>();
+        final Map<String, String> result = new HashMap<String, String>();
         result.put("structured", "false");
         result.put("formatType", "logfilepatternreceiver");
         result.put("dateFormat", dateFormat.toPattern());

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java Tue Jul  9 06:08:25 2013
@@ -227,7 +227,7 @@ public class XMLLayout extends AbstractS
      */
     @Override
     public Map<String, String> getContentFormat() {
-        Map<String, String> result = new HashMap<String, String>();
+        final Map<String, String> result = new HashMap<String, String>();
         result.put("dtd", "log4j.dtd");
         result.put("version", "1.2");
         return result;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/lookup/SystemPropertiesLookup.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/lookup/SystemPropertiesLookup.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/lookup/SystemPropertiesLookup.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/lookup/SystemPropertiesLookup.java Tue Jul  9 06:08:25 2013
@@ -34,7 +34,7 @@ public class SystemPropertiesLookup impl
     public String lookup(final String key) {
         try {
             return System.getProperty(key);
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             return null;
         }
     }
@@ -49,7 +49,7 @@ public class SystemPropertiesLookup impl
     public String lookup(final LogEvent event, final String key) {
         try {
             return System.getProperty(key);
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             return null;
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketManager.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/AbstractSocketManager.java Tue Jul  9 06:08:25 2013
@@ -67,7 +67,7 @@ public abstract class AbstractSocketMana
     @Override
     public Map<String, String> getContentFormat()
     {
-        Map<String, String> result = new HashMap<String, String>(super.getContentFormat());
+        final Map<String, String> result = new HashMap<String, String>(super.getContentFormat());
         result.put("port", Integer.toString(port));
         result.put("address", address.getHostAddress());
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/DatagramSocketManager.java Tue Jul  9 06:08:25 2013
@@ -41,7 +41,7 @@ public class DatagramSocketManager exten
      * @param port The port on the host.
      * @param layout The layout
      */
-    protected DatagramSocketManager(final String name, final OutputStream os, InetAddress address, final String host,
+    protected DatagramSocketManager(final String name, final OutputStream os, final InetAddress address, final String host,
                                     final int port, final Layout layout) {
         super(name, os, address, host, port, layout);
     }
@@ -73,7 +73,7 @@ public class DatagramSocketManager exten
     @Override
     public Map<String, String> getContentFormat()
     {
-        Map<String, String> result = new HashMap<String, String>(super.getContentFormat());
+        final Map<String, String> result = new HashMap<String, String>(super.getContentFormat());
         result.put("protocol", "udp");
         result.put("direction", "out");
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/MulticastDNSAdvertiser.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/MulticastDNSAdvertiser.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/MulticastDNSAdvertiser.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/MulticastDNSAdvertiser.java Tue Jul  9 06:08:25 2013
@@ -60,23 +60,23 @@ public class MulticastDNSAdvertiser impl
      * @return the object which can be used to unadvertise, or null if advertisement was unsuccessful
      */
     @Override
-    public Object advertise(Map<String, String> properties) {
+    public Object advertise(final Map<String, String> properties) {
         //default to tcp if "protocol" was not set
-        Map<String, String> truncatedProperties = new HashMap<String, String>();
-        for (Map.Entry<String, String> entry:properties.entrySet())
+        final Map<String, String> truncatedProperties = new HashMap<String, String>();
+        for (final Map.Entry<String, String> entry:properties.entrySet())
         {
             if (entry.getKey().length() <= 255 && entry.getValue().length() <= 255)
             {
                 truncatedProperties.put(entry.getKey(), entry.getValue());
             }
         }
-        String protocol = truncatedProperties.get("protocol");
-        String zone = "._log4j._"+(protocol != null ? protocol : "tcp") + ".local.";
+        final String protocol = truncatedProperties.get("protocol");
+        final String zone = "._log4j._"+(protocol != null ? protocol : "tcp") + ".local.";
         //default to 4555 if "port" was not set
-        String portString = truncatedProperties.get("port");
-        int port = (portString != null ? Integer.parseInt(portString) : 4555);
+        final String portString = truncatedProperties.get("port");
+        final int port = (portString != null ? Integer.parseInt(portString) : 4555);
 
-        String name = truncatedProperties.get("name");
+        final String name = truncatedProperties.get("name");
 
         //if version 3 is available, use it to construct a serviceInfo instance, otherwise support the version1 API
         if (jmDNS != null)
@@ -86,7 +86,7 @@ public class MulticastDNSAdvertiser impl
                 //create method is in version 3, not version 1
                 jmDNSClass.getMethod("create", (Class[])null);
                 isVersion3 = true;
-            } catch (NoSuchMethodException e) {
+            } catch (final NoSuchMethodException e) {
                 //no-op
             }
             Object serviceInfo;
@@ -97,13 +97,13 @@ public class MulticastDNSAdvertiser impl
             }
 
             try {
-                Method method = jmDNSClass.getMethod("registerService", new Class[]{serviceInfoClass});
+                final Method method = jmDNSClass.getMethod("registerService", new Class[]{serviceInfoClass});
                 method.invoke(jmDNS, serviceInfo);
-            } catch(IllegalAccessException e) {
+            } catch(final IllegalAccessException e) {
                 LOGGER.warn("Unable to invoke registerService method", e);
-            } catch(NoSuchMethodException e) {
+            } catch(final NoSuchMethodException e) {
                 LOGGER.warn("No registerService method", e);
-            } catch(InvocationTargetException e) {
+            } catch(final InvocationTargetException e) {
                 LOGGER.warn("Unable to invoke registerService method", e);
             }
             return serviceInfo;
@@ -120,16 +120,16 @@ public class MulticastDNSAdvertiser impl
      * @param serviceInfo
      */
     @Override
-    public void unadvertise(Object serviceInfo) {
+    public void unadvertise(final Object serviceInfo) {
         if (jmDNS != null) {
             try {
-                Method method = jmDNSClass.getMethod("unregisterService", new Class[]{serviceInfoClass});
+                final Method method = jmDNSClass.getMethod("unregisterService", new Class[]{serviceInfoClass});
                 method.invoke(jmDNS, serviceInfo);
-            } catch(IllegalAccessException e) {
+            } catch(final IllegalAccessException e) {
                 LOGGER.warn("Unable to invoke unregisterService method", e);
-            } catch(NoSuchMethodException e) {
+            } catch(final NoSuchMethodException e) {
                 LOGGER.warn("No unregisterService method", e);
-            } catch(InvocationTargetException e) {
+            } catch(final InvocationTargetException e) {
                 LOGGER.warn("Unable to invoke unregisterService method", e);
             }
         }
@@ -139,9 +139,9 @@ public class MulticastDNSAdvertiser impl
     {
         try {
             return jmDNSClass.newInstance();
-        } catch (InstantiationException e) {
+        } catch (final InstantiationException e) {
             LOGGER.warn("Unable to instantiate JMDNS", e);
-        } catch (IllegalAccessException e) {
+        } catch (final IllegalAccessException e) {
             LOGGER.warn("Unable to instantiate JMDNS", e);
         }
         return null;
@@ -150,31 +150,31 @@ public class MulticastDNSAdvertiser impl
     private static Object createJmDNSVersion3()
     {
         try {
-            Method jmDNSCreateMethod = jmDNSClass.getMethod("create", (Class[])null);
+            final Method jmDNSCreateMethod = jmDNSClass.getMethod("create", (Class[])null);
             return jmDNSCreateMethod.invoke(null, (Object[])null);
-        } catch (IllegalAccessException e) {
+        } catch (final IllegalAccessException e) {
             LOGGER.warn("Unable to instantiate jmdns class", e);
-        } catch (NoSuchMethodException e) {
+        } catch (final NoSuchMethodException e) {
             LOGGER.warn("Unable to access constructor", e);
-        } catch (InvocationTargetException e) {
+        } catch (final InvocationTargetException e) {
             LOGGER.warn("Unable to call constructor", e);
         }
         return null;
     }
 
-    private Object buildServiceInfoVersion1(String zone, int port, String name, Map<String, String> properties) {
+    private Object buildServiceInfoVersion1(final String zone, final int port, final String name, final Map<String, String> properties) {
         //version 1 uses a hashtable
-        Hashtable<String, String> hashtableProperties = new Hashtable<String, String>(properties);
+        final Hashtable<String, String> hashtableProperties = new Hashtable<String, String>(properties);
         try {
-            Class[] args = new Class[6];
+            final Class[] args = new Class[6];
             args[0] = String.class;
             args[1] = String.class;
             args[2] = int.class;
             args[3] = int.class; //weight (0)
             args[4] = int.class; //priority (0)
             args[5] = Hashtable.class;
-            Constructor<?> constructor  = serviceInfoClass.getConstructor(args);
-            Object[] values = new Object[6];
+            final Constructor<?> constructor  = serviceInfoClass.getConstructor(args);
+            final Object[] values = new Object[6];
             values[0] = zone;
             values[1] = name;
             values[2] = port;
@@ -182,29 +182,29 @@ public class MulticastDNSAdvertiser impl
             values[4] = 0;
             values[5] = hashtableProperties;
             return constructor.newInstance(values);
-        } catch (IllegalAccessException e) {
+        } catch (final IllegalAccessException e) {
             LOGGER.warn("Unable to construct ServiceInfo instance", e);
-        } catch (NoSuchMethodException e) {
+        } catch (final NoSuchMethodException e) {
             LOGGER.warn("Unable to get ServiceInfo constructor", e);
-        } catch (InstantiationException e) {
+        } catch (final InstantiationException e) {
             LOGGER.warn("Unable to construct ServiceInfo instance", e);
-        } catch (InvocationTargetException e) {
+        } catch (final InvocationTargetException e) {
             LOGGER.warn("Unable to construct ServiceInfo instance", e);
         }
         return null;
     }
 
-    private Object buildServiceInfoVersion3(String zone, int port, String name, Map<String, String> properties) {
+    private Object buildServiceInfoVersion3(final String zone, final int port, final String name, final Map<String, String> properties) {
         try {
-            Class[] args = new Class[6];
+            final Class[] args = new Class[6];
             args[0] = String.class; //zone/type
             args[1] = String.class; //display name
             args[2] = int.class; //port
             args[3] = int.class; //weight (0)
             args[4] = int.class; //priority (0)
             args[5] = Map.class;
-            Method serviceInfoCreateMethod = serviceInfoClass.getMethod("create", args);
-            Object[] values = new Object[6];
+            final Method serviceInfoCreateMethod = serviceInfoClass.getMethod("create", args);
+            final Object[] values = new Object[6];
             values[0] = zone;
             values[1] = name;
             values[2] = port;
@@ -212,11 +212,11 @@ public class MulticastDNSAdvertiser impl
             values[4] = 0;
             values[5] = properties;
             return serviceInfoCreateMethod.invoke(null, values);
-        } catch (IllegalAccessException e) {
+        } catch (final IllegalAccessException e) {
             LOGGER.warn("Unable to invoke create method", e);
-        } catch (NoSuchMethodException e) {
+        } catch (final NoSuchMethodException e) {
             LOGGER.warn("Unable to find create method", e);
-        } catch (InvocationTargetException e) {
+        } catch (final InvocationTargetException e) {
             LOGGER.warn("Unable to invoke create method", e);
         }
         return null;
@@ -232,7 +232,7 @@ public class MulticastDNSAdvertiser impl
                 //create method is in version 3, not version 1
                 jmDNSClass.getMethod("create", (Class[])null);
                 isVersion3 = true;
-            } catch (NoSuchMethodException e) {
+            } catch (final NoSuchMethodException e) {
                 //no-op
             }
 
@@ -241,9 +241,9 @@ public class MulticastDNSAdvertiser impl
             } else {
                 return createJmDNSVersion1();
             }
-        } catch (ClassNotFoundException e) {
+        } catch (final ClassNotFoundException e) {
             LOGGER.warn("JmDNS or serviceInfo class not found", e);
-        } catch (ExceptionInInitializerError e2) {
+        } catch (final ExceptionInInitializerError e2) {
             LOGGER.warn("JmDNS or serviceInfo class not found", e2);
         }
         return null;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/TCPSocketManager.java Tue Jul  9 06:08:25 2013
@@ -153,7 +153,7 @@ public class TCPSocketManager extends Ab
     @Override
     public Map<String, String> getContentFormat()
     {
-        Map<String, String> result = new HashMap<String, String>(super.getContentFormat());
+        final Map<String, String> result = new HashMap<String, String>(super.getContentFormat());
         result.put("protocol", "tcp");
         result.put("direction", "out");
         return result;
@@ -164,7 +164,7 @@ public class TCPSocketManager extends Ab
      */
     private class Reconnector extends Thread {
 
-        private CountDownLatch latch = new CountDownLatch(1);
+        private final CountDownLatch latch = new CountDownLatch(1);
 
         private boolean shutdown = false;
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/UDPSocketServer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/UDPSocketServer.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/UDPSocketServer.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/UDPSocketServer.java Tue Jul  9 06:08:25 2013
@@ -55,7 +55,7 @@ public class UDPSocketServer extends Abs
     private final DatagramSocket server;
 
     // max size so we only have to deal with one packet
-    private int maxBufferSize = 1024 * 65 + 1024;
+    private final int maxBufferSize = 1024 * 65 + 1024;
 
     /**
      * Constructor.
@@ -126,10 +126,10 @@ public class UDPSocketServer extends Abs
     public void run() {
         while (isActive) {
             try {
-                byte[] buf = new byte[maxBufferSize];
-                DatagramPacket packet = new DatagramPacket(buf, buf.length);
+                final byte[] buf = new byte[maxBufferSize];
+                final DatagramPacket packet = new DatagramPacket(buf, buf.length);
                 server.receive(packet);
-                ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(packet.getData(), packet.getOffset(), packet.getLength()));
+                final ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(packet.getData(), packet.getOffset(), packet.getLength()));
                 final LogEvent event = (LogEvent) ois.readObject();
                 if (event != null) {
                     log(event);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/BasicContextSelector.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/BasicContextSelector.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/BasicContextSelector.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/BasicContextSelector.java Tue Jul  9 06:08:25 2013
@@ -41,7 +41,7 @@ public class BasicContextSelector implem
 
     @Override
     public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext,
-                                    URI configLocation) {
+                                    final URI configLocation) {
 
         final LoggerContext ctx = ContextAnchor.THREAD_CONTEXT.get();
         return ctx != null ? ctx : CONTEXT;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java Tue Jul  9 06:08:25 2013
@@ -69,7 +69,7 @@ public class ClassLoaderContextSelector 
 
     @Override
     public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext,
-                                    URI configLocation) {
+                                    final URI configLocation) {
         if (currentContext) {
             final LoggerContext ctx = ContextAnchor.THREAD_CONTEXT.get();
             if (ctx != null) {
@@ -176,7 +176,7 @@ public class ClassLoaderContextSelector 
                     ref = CONTEXT_MAP.get(parent.toString());
                     if (ref != null) {
                         final WeakReference<LoggerContext> r = ref.get();
-                        LoggerContext ctx = r.get();
+                        final LoggerContext ctx = r.get();
                         if (ctx != null) {
                             return ctx;
                         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/JNDIContextSelector.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/JNDIContextSelector.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/JNDIContextSelector.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/JNDIContextSelector.java Tue Jul  9 06:08:25 2013
@@ -101,7 +101,7 @@ public class JNDIContextSelector impleme
 
     @Override
     public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext,
-                                    URI configLocation) {
+                                    final URI configLocation) {
 
         final LoggerContext lc = ContextAnchor.THREAD_CONTEXT.get();
         if (lc != null) {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jServletContainerInitializer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jServletContainerInitializer.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jServletContainerInitializer.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jServletContainerInitializer.java Tue Jul  9 06:08:25 2013
@@ -31,16 +31,16 @@ import javax.servlet.ServletException;
 public class Log4jServletContainerInitializer implements ServletContainerInitializer {
 
     @Override
-    public void onStartup(Set<Class<?>> classes, ServletContext servletContext) throws ServletException {
+    public void onStartup(final Set<Class<?>> classes, final ServletContext servletContext) throws ServletException {
         servletContext.log("Log4jServletContainerInitializer starting up Log4j in Servlet 3.0+ environment.");
 
-        Log4jWebInitializer initializer = Log4jWebInitializerImpl.getLog4jWebInitializer(servletContext);
+        final Log4jWebInitializer initializer = Log4jWebInitializerImpl.getLog4jWebInitializer(servletContext);
         initializer.initialize();
         initializer.setLoggerContext(); // the application is just now starting to start up
 
         servletContext.addListener(new Log4jServletContextListener());
 
-        FilterRegistration.Dynamic filter = servletContext.addFilter("log4jServletFilter", new Log4jServletFilter());
+        final FilterRegistration.Dynamic filter = servletContext.addFilter("log4jServletFilter", new Log4jServletFilter());
         filter.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), false, "/*");
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jServletContextListener.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jServletContextListener.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jServletContextListener.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jServletContextListener.java Tue Jul  9 06:08:25 2013
@@ -32,7 +32,7 @@ public class Log4jServletContextListener
     private Log4jWebInitializer initializer;
 
     @Override
-    public void contextInitialized(ServletContextEvent event) {
+    public void contextInitialized(final ServletContextEvent event) {
         this.servletContext = event.getServletContext();
         this.servletContext.log("Log4jServletContextListener ensuring that Log4j starts up properly.");
 
@@ -40,13 +40,13 @@ public class Log4jServletContextListener
         try {
             this.initializer.initialize();
             this.initializer.setLoggerContext(); // the application is just now starting to start up
-        } catch (UnavailableException e) {
+        } catch (final UnavailableException e) {
             throw new RuntimeException("Failed to initialize Log4j properly.", e);
         }
     }
 
     @Override
-    public void contextDestroyed(ServletContextEvent event) {
+    public void contextDestroyed(final ServletContextEvent event) {
         if (this.servletContext == null || this.initializer == null) {
             throw new IllegalStateException("Context destroyed before it was initialized.");
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jServletFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jServletFilter.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jServletFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jServletFilter.java Tue Jul  9 06:08:25 2013
@@ -44,7 +44,7 @@ public class Log4jServletFilter implemen
     private Log4jWebInitializer initializer;
 
     @Override
-    public void init(FilterConfig filterConfig) throws ServletException {
+    public void init(final FilterConfig filterConfig) throws ServletException {
         this.servletContext = filterConfig.getServletContext();
         this.servletContext.log("Log4jServletFilter initialized.");
 
@@ -53,7 +53,7 @@ public class Log4jServletFilter implemen
     }
 
     @Override
-    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+    public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
             throws IOException, ServletException {
         if (request.getAttribute(ALREADY_FILTERED_ATTRIBUTE) != null) {
             chain.doFilter(request, response);

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jWebInitializerImpl.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jWebInitializerImpl.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jWebInitializerImpl.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/web/Log4jWebInitializerImpl.java Tue Jul  9 06:08:25 2013
@@ -43,7 +43,7 @@ final class Log4jWebInitializerImpl impl
             throw new IllegalStateException("You are using Log4j 2 in a web application with the old, extinct " +
                     "log4j-web artifact. This is not supported and could cause serious runtime problems. Please" +
                     "remove the log4j-web JAR file from your application.");
-        } catch (ClassNotFoundException ignore) {
+        } catch (final ClassNotFoundException ignore) {
             /* Good. They don't have the old log4j-web artifact loaded. */
         }
     }
@@ -58,7 +58,7 @@ final class Log4jWebInitializerImpl impl
     private boolean initialized = false;
     private boolean deinitialized = false;
 
-    private Log4jWebInitializerImpl(ServletContext servletContext) {
+    private Log4jWebInitializerImpl(final ServletContext servletContext) {
         this.servletContext = servletContext;
     }
 
@@ -73,8 +73,8 @@ final class Log4jWebInitializerImpl impl
             this.initialized = true;
 
             this.name = this.substitutor.replace(this.servletContext.getInitParameter(LOG4J_CONTEXT_NAME));
-            String location = this.substitutor.replace(this.servletContext.getInitParameter(LOG4J_CONFIG_LOCATION));
-            boolean isJndi = "true".equals(this.servletContext.getInitParameter(IS_LOG4J_CONTEXT_SELECTOR_NAMED));
+            final String location = this.substitutor.replace(this.servletContext.getInitParameter(LOG4J_CONFIG_LOCATION));
+            final boolean isJndi = "true".equals(this.servletContext.getInitParameter(IS_LOG4J_CONTEXT_SELECTOR_NAMED));
 
             if (isJndi) {
                 this.initializeJndi(location);
@@ -84,12 +84,12 @@ final class Log4jWebInitializerImpl impl
         }
     }
 
-    private void initializeJndi(String location) throws UnavailableException {
+    private void initializeJndi(final String location) throws UnavailableException {
         URI configLocation = null;
         if (location != null) {
             try {
                 configLocation = new URI(location);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 this.servletContext.log("Unable to convert configuration location [" + location + "] to a URI!", e);
             }
         }
@@ -99,9 +99,9 @@ final class Log4jWebInitializerImpl impl
         }
 
         LoggerContext loggerContext;
-        LoggerContextFactory factory = LogManager.getFactory();
+        final LoggerContextFactory factory = LogManager.getFactory();
         if (factory instanceof Log4jContextFactory) {
-            ContextSelector selector = ((Log4jContextFactory) factory).getSelector();
+            final ContextSelector selector = ((Log4jContextFactory) factory).getSelector();
             if (selector instanceof NamedContextSelector) {
                 this.selector = (NamedContextSelector) selector;
                 loggerContext = this.selector.locateContext(this.name, configLocation);
@@ -118,7 +118,7 @@ final class Log4jWebInitializerImpl impl
                 loggerContext.getClass().getClassLoader() + "].");
     }
 
-    private void initializeNonJndi(String location) {
+    private void initializeNonJndi(final String location) {
         if (this.name == null) {
             this.name = this.servletContext.getServletContextName();
         }
@@ -170,7 +170,7 @@ final class Log4jWebInitializerImpl impl
             // this may look odd, but the call below will throw NoSuchMethodError if user is on Servlet 2.5
             // we compile against 3.0 to support Log4jServletContainerInitializer, but we don't require 3.0
             return this.servletContext.getClassLoader();
-        } catch (Throwable ignore) {
+        } catch (final Throwable ignore) {
             // otherwise, use this class's class loader
             return Log4jWebInitializerImpl.class.getClassLoader();
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/dumbster/smtp/SmtpMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/dumbster/smtp/SmtpMessage.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/dumbster/smtp/SmtpMessage.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/dumbster/smtp/SmtpMessage.java Tue Jul  9 06:08:25 2013
@@ -139,9 +139,9 @@ public class SmtpMessage {
     public String toString() {
         final StringBuilder msg = new StringBuilder();
         for (final Map.Entry<String, List<String>> entry : headers.entrySet()) {
-            String name = entry.getKey();
-            List<String> values = entry.getValue();
-            for (String value : values) {
+            final String name = entry.getKey();
+            final List<String> values = entry.getValue();
+            for (final String value : values) {
                 msg.append(name);
                 msg.append(": ");
                 msg.append(value);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/LocationPerfCheck.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/LocationPerfCheck.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/LocationPerfCheck.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/LocationPerfCheck.java Tue Jul  9 06:08:25 2013
@@ -32,13 +32,13 @@ public class LocationPerfCheck {
 
     @Test
     public void testLocation() {
-        Timer timer = new Timer("LogEvent", LOOP_COUNT);
+        final Timer timer = new Timer("LogEvent", LOOP_COUNT);
         timer.start();
         for (int i = 0; i < LOOP_COUNT; ++i) {
             final LogEvent event1 = new Log4jLogEvent(this.getClass().getName(), null,
                 "org.apache.logging.log4j.core.impl.Log4jLogEvent",
                 Level.INFO, new SimpleMessage("Hello, world!"), null);
-            StackTraceElement element = event1.getSource();
+            final StackTraceElement element = event1.getSource();
         }
         timer.stop();
         System.out.println(timer.toString());

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/Log4jInitPerformance.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/Log4jInitPerformance.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/Log4jInitPerformance.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/Log4jInitPerformance.java Tue Jul  9 06:08:25 2013
@@ -29,7 +29,7 @@ public class Log4jInitPerformance {
 
     @Test
     public void testInitialize() throws Exception {
-        String log4jConfigString =
+        final String log4jConfigString =
             "<configuration name=\"ConfigTest\" status=\"debug\" >" +
                 "<appenders>" +
                 " <Console name=\"STDOUT\">" +
@@ -45,9 +45,9 @@ public class Log4jInitPerformance {
         final InputStream is = new ByteArrayInputStream(log4jConfigString.getBytes());
         final ConfigurationFactory.ConfigurationSource source =
             new ConfigurationFactory.ConfigurationSource(is);
-        long begin = System.currentTimeMillis();
+        final long begin = System.currentTimeMillis();
         Configurator.initialize(null, source);
-        long tookForInit = System.currentTimeMillis() - begin;
+        final long tookForInit = System.currentTimeMillis() - begin;
         System.out.println("log4j 2.0 initialization took " + tookForInit + "ms");
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java Tue Jul  9 06:08:25 2013
@@ -82,12 +82,12 @@ public class LogEventFactoryTest {
 
     @Test
     public void testEvent() {
-        org.apache.logging.log4j.Logger logger = LogManager.getLogger("org.apache.test.LogEventFactory");
+        final org.apache.logging.log4j.Logger logger = LogManager.getLogger("org.apache.test.LogEventFactory");
         logger.error("error message");
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertNotNull("No events", events);
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
-        LogEvent event = events.get(0);
+        final LogEvent event = events.get(0);
         assertTrue("Test LogEventFactory wasn't used", event.getLoggerName().equals("Test"));
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java Tue Jul  9 06:08:25 2013
@@ -257,7 +257,7 @@ public class LoggerTest {
 
     @Test
     public void testAdditivity() throws Exception {
-        Logger localLogger = (Logger) LogManager.getLogger("org.apache.test");
+        final Logger localLogger = (Logger) LogManager.getLogger("org.apache.test");
         localLogger.error("Test parent additivity");
         final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java Tue Jul  9 06:08:25 2013
@@ -97,9 +97,9 @@ public class LoggerUpdateTest {
         List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
-        LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
-        Configuration config = ctx.getConfiguration();
-        LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
+        final Configuration config = ctx.getConfiguration();
+        final LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
         /* You could also specify the actual logger name as below and it will return the LoggerConfig used by the Logger.
            LoggerConfig loggerConfig = getLoggerConfig("com.apache.test");
         */

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastFileAppenderLocationTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastFileAppenderLocationTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastFileAppenderLocationTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastFileAppenderLocationTest.java Tue Jul  9 06:08:25 2013
@@ -39,22 +39,22 @@ public class FastFileAppenderLocationTes
 
     @Test
     public void testLocationIncluded() throws Exception {
-        File f = new File("target", "FastFileAppenderLocationTest.log");
+        final File f = new File("target", "FastFileAppenderLocationTest.log");
         // System.out.println(f.getAbsolutePath());
         f.delete();
-        Logger log = LogManager.getLogger("com.foo.Bar");
-        String msg = "Message with location, flushed with immediate flush=false";
+        final Logger log = LogManager.getLogger("com.foo.Bar");
+        final String msg = "Message with location, flushed with immediate flush=false";
         log.info(msg);
         ((LifeCycle) LogManager.getContext()).stop(); // stop async thread
 
-        BufferedReader reader = new BufferedReader(new FileReader(f));
-        String line1 = reader.readLine();
+        final BufferedReader reader = new BufferedReader(new FileReader(f));
+        final String line1 = reader.readLine();
         reader.close();
         f.delete();
         assertNotNull("line1", line1);
         assertTrue("line1 correct", line1.contains(msg));
 
-        String location = "testLocationIncluded";
+        final String location = "testLocationIncluded";
         assertTrue("has location", line1.contains(location));
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastFileAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastFileAppenderTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastFileAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastFileAppenderTest.java Tue Jul  9 06:08:25 2013
@@ -39,22 +39,22 @@ public class FastFileAppenderTest {
 
     @Test
     public void testFlushAtEndOfBatch() throws Exception {
-        File f = new File("target", "FastFileAppenderTest.log");
+        final File f = new File("target", "FastFileAppenderTest.log");
         // System.out.println(f.getAbsolutePath());
         f.delete();
-        Logger log = LogManager.getLogger("com.foo.Bar");
-        String msg = "Message flushed with immediate flush=false";
+        final Logger log = LogManager.getLogger("com.foo.Bar");
+        final String msg = "Message flushed with immediate flush=false";
         log.info(msg);
         ((LifeCycle) LogManager.getContext()).stop(); // stop async thread
 
-        BufferedReader reader = new BufferedReader(new FileReader(f));
-        String line1 = reader.readLine();
+        final BufferedReader reader = new BufferedReader(new FileReader(f));
+        final String line1 = reader.readLine();
         reader.close();
         f.delete();
         assertNotNull("line1", line1);
         assertTrue("line1 correct", line1.contains(msg));
 
-        String location = "testFlushAtEndOfBatch";
+        final String location = "testFlushAtEndOfBatch";
         assertTrue("no location", !line1.contains(location));
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastFileManagerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastFileManagerTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastFileManagerTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastFileManagerTest.java Tue Jul  9 06:08:25 2013
@@ -38,15 +38,15 @@ public class FastFileManagerTest {
      */
     @Test
     public void testWrite_multiplesOfBufferSize() throws IOException {
-        File file = File.createTempFile("log4j2", "test");
+        final File file = File.createTempFile("log4j2", "test");
         file.deleteOnExit();
-        RandomAccessFile raf = new RandomAccessFile(file, "rw");
-        OutputStream os = new FastFileManager.DummyOutputStream();
-        FastFileManager manager = new FastFileManager(raf, file.getName(), os,
+        final RandomAccessFile raf = new RandomAccessFile(file, "rw");
+        final OutputStream os = new FastFileManager.DummyOutputStream();
+        final FastFileManager manager = new FastFileManager(raf, file.getName(), os,
                 false, null, null);
 
-        int size = FastFileManager.DEFAULT_BUFFER_SIZE * 3;
-        byte[] data = new byte[size];
+        final int size = FastFileManager.DEFAULT_BUFFER_SIZE * 3;
+        final byte[] data = new byte[size];
         manager.write(data); // no buffer overflow exception
 
         // buffer is full but not flushed yet
@@ -60,15 +60,15 @@ public class FastFileManagerTest {
      */
     @Test
     public void testWrite_dataExceedingBufferSize() throws IOException {
-        File file = File.createTempFile("log4j2", "test");
+        final File file = File.createTempFile("log4j2", "test");
         file.deleteOnExit();
-        RandomAccessFile raf = new RandomAccessFile(file, "rw");
-        OutputStream os = new FastFileManager.DummyOutputStream();
-        FastFileManager manager = new FastFileManager(raf, file.getName(), os,
+        final RandomAccessFile raf = new RandomAccessFile(file, "rw");
+        final OutputStream os = new FastFileManager.DummyOutputStream();
+        final FastFileManager manager = new FastFileManager(raf, file.getName(), os,
                 false, null, null);
 
-        int size = FastFileManager.DEFAULT_BUFFER_SIZE * 3 + 1;
-        byte[] data = new byte[size];
+        final int size = FastFileManager.DEFAULT_BUFFER_SIZE * 3 + 1;
+        final byte[] data = new byte[size];
         manager.write(data); // no exception
         assertEquals(FastFileManager.DEFAULT_BUFFER_SIZE * 3, raf.length());
 
@@ -78,12 +78,12 @@ public class FastFileManagerTest {
 
     @Test
     public void testAppendDoesNotOverwriteExistingFile() throws IOException {
-        boolean isAppend = true;
-        File file = File.createTempFile("log4j2", "test");
+        final boolean isAppend = true;
+        final File file = File.createTempFile("log4j2", "test");
         file.deleteOnExit();
         assertEquals(0, file.length());
 
-        byte[] bytes = new byte[4 * 1024];
+        final byte[] bytes = new byte[4 * 1024];
 
         // create existing file
         FileOutputStream fos = null;
@@ -96,10 +96,10 @@ public class FastFileManagerTest {
         }
         assertEquals("all flushed to disk", bytes.length, file.length());
 
-        FastFileManager manager = FastFileManager.getFileManager(
+        final FastFileManager manager = FastFileManager.getFileManager(
                 file.getAbsolutePath(), isAppend, true, null, null);
         manager.write(bytes, 0, bytes.length);
-        int expected = bytes.length * 2;
+        final int expected = bytes.length * 2;
         assertEquals("appended, not overwritten", expected, file.length());
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastRollingFileAppenderLocationTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastRollingFileAppenderLocationTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastRollingFileAppenderLocationTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastRollingFileAppenderLocationTest.java Tue Jul  9 06:08:25 2013
@@ -39,22 +39,22 @@ public class FastRollingFileAppenderLoca
 
     @Test
     public void testLocationIncluded() throws Exception {
-        File f = new File("target", "FastRollingFileAppenderLocationTest.log");
+        final File f = new File("target", "FastRollingFileAppenderLocationTest.log");
         // System.out.println(f.getAbsolutePath());
         f.delete();
-        Logger log = LogManager.getLogger("com.foo.Bar");
-        String msg = "Message with location, flushed with immediate flush=false";
+        final Logger log = LogManager.getLogger("com.foo.Bar");
+        final String msg = "Message with location, flushed with immediate flush=false";
         log.info(msg);
         ((LifeCycle) LogManager.getContext()).stop(); // stop async thread
 
-        BufferedReader reader = new BufferedReader(new FileReader(f));
-        String line1 = reader.readLine();
+        final BufferedReader reader = new BufferedReader(new FileReader(f));
+        final String line1 = reader.readLine();
         reader.close();
         f.delete();
         assertNotNull("line1", line1);
         assertTrue("line1 correct", line1.contains(msg));
 
-        String location = "testLocationIncluded";
+        final String location = "testLocationIncluded";
         assertTrue("has location", line1.contains(location));
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastRollingFileAppenderRolloverTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastRollingFileAppenderRolloverTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastRollingFileAppenderRolloverTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastRollingFileAppenderRolloverTest.java Tue Jul  9 06:08:25 2013
@@ -40,32 +40,32 @@ public class FastRollingFileAppenderRoll
 
     @Test
     public void testRollover() throws Exception {
-        File f = new File("target", "FastRollingFileAppenderTest.log");
+        final File f = new File("target", "FastRollingFileAppenderTest.log");
         // System.out.println(f.getAbsolutePath());
-        File after1 = new File("target", "afterRollover-1.log");
+        final File after1 = new File("target", "afterRollover-1.log");
         f.delete();
         after1.delete();
 
-        Logger log = LogManager.getLogger("com.foo.Bar");
-        String msg = "First a short message that does not trigger rollover";
+        final Logger log = LogManager.getLogger("com.foo.Bar");
+        final String msg = "First a short message that does not trigger rollover";
         log.info(msg);
         Thread.sleep(50);
 
         BufferedReader reader = new BufferedReader(new FileReader(f));
-        String line1 = reader.readLine();
+        final String line1 = reader.readLine();
         assertTrue(line1.contains(msg));
         reader.close();
 
         assertFalse("afterRollover-1.log not created yet", after1.exists());
 
         String exceed = "Long message that exceeds rollover size... ";
-        char[] padding = new char[250];
+        final char[] padding = new char[250];
         Arrays.fill(padding, 'X');
         exceed += new String(padding);
         log.warn(exceed);
         assertFalse("exceeded size but afterRollover-1.log not created yet", after1.exists());
 
-        String trigger = "This message triggers rollover.";
+        final String trigger = "This message triggers rollover.";
         log.warn(trigger);
 
         ((LifeCycle) LogManager.getContext()).stop(); // stop async thread
@@ -73,18 +73,18 @@ public class FastRollingFileAppenderRoll
         assertTrue("afterRollover-1.log created", after1.exists());
 
         reader = new BufferedReader(new FileReader(f));
-        String new1 = reader.readLine();
+        final String new1 = reader.readLine();
         assertTrue("after rollover only new msg", new1.contains(trigger));
         assertNull("No more lines", reader.readLine());
         reader.close();
         f.delete();
 
         reader = new BufferedReader(new FileReader(after1));
-        String old1 = reader.readLine();
+        final String old1 = reader.readLine();
         assertTrue("renamed file line 1", old1.contains(msg));
-        String old2 = reader.readLine();
+        final String old2 = reader.readLine();
         assertTrue("renamed file line 2", old2.contains(exceed));
-        String line = reader.readLine();
+        final String line = reader.readLine();
         assertNull("No more lines", line);
         reader.close();
         after1.delete();

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastRollingFileAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastRollingFileAppenderTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastRollingFileAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastRollingFileAppenderTest.java Tue Jul  9 06:08:25 2013
@@ -39,22 +39,22 @@ public class FastRollingFileAppenderTest
 
     @Test
     public void testFlushAtEndOfBatch() throws Exception {
-        File f = new File("target", "FastRollingFileAppenderTest.log");
+        final File f = new File("target", "FastRollingFileAppenderTest.log");
         // System.out.println(f.getAbsolutePath());
         f.delete();
-        Logger log = LogManager.getLogger("com.foo.Bar");
-        String msg = "Message flushed with immediate flush=false";
+        final Logger log = LogManager.getLogger("com.foo.Bar");
+        final String msg = "Message flushed with immediate flush=false";
         log.info(msg);
         ((LifeCycle) LogManager.getContext()).stop(); // stop async thread
 
-        BufferedReader reader = new BufferedReader(new FileReader(f));
-        String line1 = reader.readLine();
+        final BufferedReader reader = new BufferedReader(new FileReader(f));
+        final String line1 = reader.readLine();
         reader.close();
         f.delete();
         assertNotNull("line1", line1);
         assertTrue("line1 correct", line1.contains(msg));
 
-        String location = "testFlushAtEndOfBatch";
+        final String location = "testFlushAtEndOfBatch";
         assertTrue("no location", !line1.contains(location));
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java Tue Jul  9 06:08:25 2013
@@ -165,7 +165,7 @@ public class SocketAppenderTest {
 
             root.debug("This message is written because a deadlock never.");
 
-            LogEvent event = list.poll(3, TimeUnit.SECONDS);
+            final LogEvent event = list.poll(3, TimeUnit.SECONDS);
             assertNotNull("No event retrieved", event);
     }
 
@@ -183,7 +183,7 @@ public class SocketAppenderTest {
         try {
             root.debug("This message is written because a deadlock never.");
             fail("No Exception was thrown");
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             // Failure is expected.
         }
     }
@@ -228,7 +228,7 @@ public class SocketAppenderTest {
         private final ServerSocket sock;
         private boolean shutdown = false;
 
-        public TCPSocketServer(int port) throws IOException {
+        public TCPSocketServer(final int port) throws IOException {
             this.sock = new ServerSocket(port);
         }
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcH2AppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcH2AppenderTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcH2AppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcH2AppenderTest.java Tue Jul  9 06:08:25 2013
@@ -45,7 +45,7 @@ public class JdbcH2AppenderTest extends 
     }
 
     @Override
-    protected String toCreateTableSqlString(String tableName) {
+    protected String toCreateTableSqlString(final String tableName) {
         return "CREATE TABLE " + tableName + " ( " +
                     "id INTEGER IDENTITY, eventDate DATETIME, literalColumn VARCHAR(255), level NVARCHAR(10), " +
                     "logger NVARCHAR(255), message VARCHAR(1024), exception NCLOB" +

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcHyperSqlAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcHyperSqlAppenderTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcHyperSqlAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcHyperSqlAppenderTest.java Tue Jul  9 06:08:25 2013
@@ -45,7 +45,7 @@ public class JdbcHyperSqlAppenderTest ex
     }
 
     @Override
-    protected String toCreateTableSqlString(String tableName) {
+    protected String toCreateTableSqlString(final String tableName) {
         return "CREATE TABLE " + tableName + " ( " +
                     "id INTEGER IDENTITY, eventDate DATETIME, literalColumn VARCHAR(255), level VARCHAR(10), " +
                     "logger VARCHAR(255), message VARCHAR(1024), exception CLOB" +

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapAttributeConverterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapAttributeConverterTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapAttributeConverterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapAttributeConverterTest.java Tue Jul  9 06:08:25 2013
@@ -41,7 +41,7 @@ public class ContextMapAttributeConverte
 
     @Test
     public void testConvertToDatabaseColumn01() {
-        Map<String, String> map = new HashMap<String, String>();
+        final Map<String, String> map = new HashMap<String, String>();
         map.put("test1", "another1");
         map.put("key2", "value2");
 
@@ -51,7 +51,7 @@ public class ContextMapAttributeConverte
 
     @Test
     public void testConvertToDatabaseColumn02() {
-        Map<String, String> map = new HashMap<String, String>();
+        final Map<String, String> map = new HashMap<String, String>();
         map.put("someKey", "coolValue");
         map.put("anotherKey", "testValue");
         map.put("myKey", "yourValue");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapJsonAttributeConverterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapJsonAttributeConverterTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapJsonAttributeConverterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/db/jpa/converter/ContextMapJsonAttributeConverterTest.java Tue Jul  9 06:08:25 2013
@@ -40,15 +40,15 @@ public class ContextMapJsonAttributeConv
 
     @Test
     public void testConvert01() {
-        Map<String, String> map = new HashMap<String, String>();
+        final Map<String, String> map = new HashMap<String, String>();
         map.put("test1", "another1");
         map.put("key2", "value2");
 
-        String converted = this.converter.convertToDatabaseColumn(map);
+        final String converted = this.converter.convertToDatabaseColumn(map);
 
         assertNotNull("The converted value should not be null.", converted);
 
-        Map<String, String> reversed = this.converter.convertToEntityAttribute(converted);
+        final Map<String, String> reversed = this.converter.convertToEntityAttribute(converted);
 
         assertNotNull("The reversed value should not be null.", reversed);
         assertEquals("The reversed value is not correct.", map, reversed);
@@ -56,16 +56,16 @@ public class ContextMapJsonAttributeConv
 
     @Test
     public void testConvert02() {
-        Map<String, String> map = new HashMap<String, String>();
+        final Map<String, String> map = new HashMap<String, String>();
         map.put("someKey", "coolValue");
         map.put("anotherKey", "testValue");
         map.put("myKey", "yourValue");
 
-        String converted = this.converter.convertToDatabaseColumn(map);
+        final String converted = this.converter.convertToDatabaseColumn(map);
 
         assertNotNull("The converted value should not be null.", converted);
 
-        Map<String, String> reversed = this.converter.convertToEntityAttribute(converted);
+        final Map<String, String> reversed = this.converter.convertToEntityAttribute(converted);
 
         assertNotNull("The reversed value should not be null.", reversed);
         assertEquals("The reversed value is not correct.", map, reversed);



Mime
View raw message