logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1419697 [12/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/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java Mon Dec 10 19:36:06 2012
@@ -49,7 +49,7 @@ public class AppenderRefLevelTest {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("LIST1")) {
                 app1 = (ListAppender) entry.getValue();
             } else if (entry.getKey().equals("LIST2")) {
@@ -112,7 +112,7 @@ public class AppenderRefLevelTest {
         logger3.info(testMarker, "Info Message");
         logger3.warn("warn Message");
         logger3.exit();
-        List<LogEvent> events = app1.getEvents();
+        final List<LogEvent> events = app1.getEvents();
         assertTrue("Incorrect number of events. Expected 4, actual " + events.size(), events.size() == 4);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/BasicConfigurationFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/BasicConfigurationFactory.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/BasicConfigurationFactory.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/BasicConfigurationFactory.java Mon Dec 10 19:36:06 2012
@@ -29,7 +29,7 @@ import java.net.URI;
 public class BasicConfigurationFactory extends ConfigurationFactory {
 
     @Override
-    public Configuration getConfiguration(String name, URI configLocation) {
+    public Configuration getConfiguration(final String name, final URI configLocation) {
         return new BasicConfiguration();
     }
 
@@ -39,7 +39,7 @@ public class BasicConfigurationFactory e
     }
 
     @Override
-    public Configuration getConfiguration(ConfigurationSource source) {
+    public Configuration getConfiguration(final ConfigurationSource source) {
         return null;
     }
 
@@ -49,9 +49,9 @@ public class BasicConfigurationFactory e
 
         public BasicConfiguration() {
 
-            LoggerConfig root = getRootLogger();
-            String l = System.getProperty(DEFAULT_LEVEL);
-            Level level = (l != null && Level.valueOf(l) != null) ? Level.valueOf(l) : Level.ERROR;
+            final LoggerConfig root = getRootLogger();
+            final String l = System.getProperty(DEFAULT_LEVEL);
+            final Level level = (l != null && Level.valueOf(l) != null) ? Level.valueOf(l) : Level.ERROR;
             root.setLevel(level);
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/BasicLoggingTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/BasicLoggingTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/BasicLoggingTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/BasicLoggingTest.java Mon Dec 10 19:36:06 2012
@@ -27,7 +27,7 @@ public class BasicLoggingTest {
 
     @Test
     public void test1() {
-        Logger logger = LogManager.getLogger(BasicLoggingTest.class.getName());
+        final Logger logger = LogManager.getLogger(BasicLoggingTest.class.getName());
         logger.debug("debug not set");
         logger.error("Test message");
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java Mon Dec 10 19:36:06 2012
@@ -34,16 +34,16 @@ public class CollectionLoggingTest {
 
     @Test
     public void testSystemProperties() {
-        Logger logger = LogManager.getLogger(CollectionLoggingTest.class.getName());
+        final Logger logger = LogManager.getLogger(CollectionLoggingTest.class.getName());
         logger.error(System.getProperties());
         // logger.error(new MapMessage(System.getProperties()));
     }
 
     @Test
     public void testSimpleMap() {
-        Logger logger = LogManager.getLogger(CollectionLoggingTest.class.getName());
+        final Logger logger = LogManager.getLogger(CollectionLoggingTest.class.getName());
         logger.error(System.getProperties());
-        Map<String, String> map = new HashMap<String, String>();
+        final Map<String, String> map = new HashMap<String, String>();
         map.put("MyKey1", "MyValue1");
         map.put("MyKey2", "MyValue2");
         logger.error(new MapMessage(map));
@@ -52,13 +52,13 @@ public class CollectionLoggingTest {
 
     @Test
     public void testNetworkInterfaces() throws SocketException {
-        Logger logger = LogManager.getLogger(CollectionLoggingTest.class.getName());
+        final Logger logger = LogManager.getLogger(CollectionLoggingTest.class.getName());
         logger.error(NetworkInterface.getNetworkInterfaces());
     }
 
     @Test
     public void testAvailableCharsets() throws SocketException {
-        Logger logger = LogManager.getLogger(CollectionLoggingTest.class.getName());
+        final Logger logger = LogManager.getLogger(CollectionLoggingTest.class.getName());
         logger.error(Charset.availableCharsets());
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/FileConfigTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/FileConfigTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/FileConfigTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/FileConfigTest.java Mon Dec 10 19:36:06 2012
@@ -42,7 +42,7 @@ public class FileConfigTest {
     private static ListAppender app;
     private static LoggerContext ctx;
 
-    private org.apache.logging.log4j.Logger logger = LogManager.getLogger("LoggerTest");
+    private final org.apache.logging.log4j.Logger logger = LogManager.getLogger("LoggerTest");
 
     @BeforeClass
     public static void setupClass() {
@@ -60,7 +60,7 @@ public class FileConfigTest {
     @Before
     public void before() {
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
                 app = (ListAppender) entry.getValue();
                 break;
@@ -72,15 +72,15 @@ public class FileConfigTest {
 
     @Test
     public void testReconfiguration() throws Exception {
-        File file = new File(CONFIG);
-        long orig = file.lastModified();
-        long newTime = orig + 10000;
+        final File file = new File(CONFIG);
+        final long orig = file.lastModified();
+        final long newTime = orig + 10000;
         file.setLastModified(newTime);
         Thread.sleep(6000);
         for (int i = 0; i < 17; ++i) {
             logger.debug("Reconfigure");
         }
-        Configuration cfg = ctx.getConfiguration();
+        final Configuration cfg = ctx.getConfiguration();
         assertNotNull("No configuration", cfg);
         assertTrue("Reconfiguration failed", cfg != config);
     }

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=1419697&r1=1419696&r2=1419697&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 Mon Dec 10 19:36:06 2012
@@ -68,7 +68,7 @@ public class LoggerTest {
     @Before
     public void before() {
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
                 app = (ListAppender) entry.getValue();
                 break;
@@ -85,7 +85,7 @@ public class LoggerTest {
     public void basicFlow() {
         logger.entry();
         logger.exit();
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 2, actual " + events.size(), events.size() == 2);
         app.clear();
     }
@@ -94,7 +94,7 @@ public class LoggerTest {
     public void simpleFlow() {
         logger.entry(CONFIG);
         logger.exit(0);
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 2, actual " + events.size(), events.size() == 2);
         app.clear();
     }
@@ -102,7 +102,7 @@ public class LoggerTest {
     @Test
     public void throwing() {
         logger.throwing(new IllegalArgumentException("Test Exception"));
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
     }
@@ -111,10 +111,10 @@ public class LoggerTest {
     public void catching() {
         try {
             throw new NullPointerException();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             logger.catching(e);
         }
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
     }
@@ -122,34 +122,34 @@ public class LoggerTest {
     @Test
     public void debug() {
         logger.debug("Debug message");
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
     }
 
     @Test
     public void getLogger_String_MessageFactoryMismatch() {
-        Logger testLogger =  testMessageFactoryMismatch("getLogger_String_MessageFactoryMismatch", new StringFormatterMessageFactory(), new ParameterizedMessageFactory());
+        final Logger testLogger =  testMessageFactoryMismatch("getLogger_String_MessageFactoryMismatch", new StringFormatterMessageFactory(), new ParameterizedMessageFactory());
         testLogger.debug("%,d", Integer.MAX_VALUE);
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);        
         assertEquals(String.format("%,d", Integer.MAX_VALUE), events.get(0).getMessage().getFormattedMessage());
     }
 
     @Test
     public void getLogger_String_MessageFactoryMismatchNull() {
-        Logger testLogger =  testMessageFactoryMismatch("getLogger_String_MessageFactoryMismatchNull", new StringFormatterMessageFactory(), null);
+        final Logger testLogger =  testMessageFactoryMismatch("getLogger_String_MessageFactoryMismatchNull", new StringFormatterMessageFactory(), null);
         testLogger.debug("%,d", Integer.MAX_VALUE);
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);        
         assertEquals(String.format("%,d", Integer.MAX_VALUE), events.get(0).getMessage().getFormattedMessage());
     }
 
-    private Logger testMessageFactoryMismatch(String name, MessageFactory messageFactory1, MessageFactory messageFactory2) {
-        Logger testLogger = (Logger) LogManager.getLogger(name, messageFactory1);
+    private Logger testMessageFactoryMismatch(final String name, final MessageFactory messageFactory1, final MessageFactory messageFactory2) {
+        final Logger testLogger = (Logger) LogManager.getLogger(name, messageFactory1);
         assertNotNull(testLogger);
         assertEquals(messageFactory1, testLogger.getMessageFactory());
-        Logger testLogger2 = (Logger) LogManager.getLogger(name, messageFactory2);
+        final Logger testLogger2 = (Logger) LogManager.getLogger(name, messageFactory2);
         assertEquals(messageFactory1, testLogger2.getMessageFactory());
         return testLogger;
     }
@@ -157,7 +157,7 @@ public class LoggerTest {
     @Test
     public void debugObject() {
         logger.debug(new Date());
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
     }
@@ -165,7 +165,7 @@ public class LoggerTest {
     @Test
     public void debugWithParms() {
         logger.debug("Hello, {}", "World");
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
     }
@@ -176,7 +176,7 @@ public class LoggerTest {
         logger.debug("Debug message");
         ThreadContext.clear();
         logger.debug("Debug message");
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 2, actual " + events.size(), events.size() == 2);
         app.clear();
     }
@@ -186,28 +186,28 @@ public class LoggerTest {
         ThreadContext.put("loginId", "JohnDoe");
         ThreadContext.put("ipAddress", "192.168.0.120");
         ThreadContext.put("locale", Locale.US.getDisplayName());
-        StructuredDataMessage msg = new StructuredDataMessage("Audit@18060", "Transfer Complete", "Transfer");
+        final StructuredDataMessage msg = new StructuredDataMessage("Audit@18060", "Transfer Complete", "Transfer");
         msg.put("ToAccount", "123456");
         msg.put("FromAccount", "123457");
         msg.put("Amount", "200.00");
         logger.info(MarkerManager.getMarker("EVENT"), msg);
         ThreadContext.clear();
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
     }
 
     @Test
     public void testReconfiguration() throws Exception {
-        File file = new File("target/test-classes/" + CONFIG);
-        long orig = file.lastModified();
-        long newTime = orig + 10000;
+        final File file = new File("target/test-classes/" + CONFIG);
+        final long orig = file.lastModified();
+        final long newTime = orig + 10000;
         file.setLastModified(newTime);
         Thread.sleep(6000);
         for (int i = 0; i < 17; ++i) {
             logger.debug("Reconfigure");
         }
-        Configuration cfg = ctx.getConfiguration();
+        final Configuration cfg = ctx.getConfiguration();
         assertNotNull("No configuration", cfg);
         assertTrue("Reconfiguration failed", cfg != config);
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java Mon Dec 10 19:36:06 2012
@@ -43,7 +43,7 @@ public class SimplePerfTest {
     @BeforeClass
     public static void setupClass() {
 
-        Configuration config = ((LoggerContext)LogManager.getContext()).getConfiguration();
+        final Configuration config = ((LoggerContext)LogManager.getContext()).getConfiguration();
         if (!DefaultConfiguration.DEFAULT_NAME.equals(config.getName())) {
             System.out.println("Configuration was " + config.getName());
             ((LoggerContext)LogManager.getContext()).setConfiguration(new DefaultConfiguration());
@@ -53,7 +53,7 @@ public class SimplePerfTest {
             overhead();
         }
         System.gc();
-        Timer timer = new Timer("Setup", LOOP_CNT);
+        final Timer timer = new Timer("Setup", LOOP_CNT);
         timer.start();
         for (int i=0; i < (LOOP_CNT / 150); ++i) {
             overhead();
@@ -67,7 +67,7 @@ public class SimplePerfTest {
     @Test
     public void debugDisabled() {
         System.gc();
-        Timer timer = new Timer("DebugDisabled", LOOP_CNT);
+        final Timer timer = new Timer("DebugDisabled", LOOP_CNT);
         timer.start();
         for (int i=0; i < LOOP_CNT; ++i) {
             logger.isDebugEnabled();
@@ -80,7 +80,7 @@ public class SimplePerfTest {
     @Test
     public void debugDisabledByLevel() {
         System.gc();
-        Timer timer = new Timer("DebugDisabled", LOOP_CNT);
+        final Timer timer = new Timer("DebugDisabled", LOOP_CNT);
         timer.start();
         for (int i=0; i < LOOP_CNT; ++i) {
             logger.isEnabled(Level.DEBUG);
@@ -93,8 +93,8 @@ public class SimplePerfTest {
     @Test
     public void debugLogger() {
         System.gc();
-        Timer timer = new Timer("DebugLogger", LOOP_CNT);
-        String msg = "This is a test";
+        final Timer timer = new Timer("DebugLogger", LOOP_CNT);
+        final String msg = "This is a test";
         timer.start();
         for (int i=0; i < LOOP_CNT; ++i) {
             logger.debug(msg);
@@ -120,8 +120,8 @@ public class SimplePerfTest {
      * but the point is simply to insure that changes made don't suddenly cause performance issues.
      */
     private static void overhead() {
-        int values[] = new int[RAND_SIZE];
-        Random rand = new SimpleRandom();
+        final int values[] = new int[RAND_SIZE];
+        final Random rand = new SimpleRandom();
 
         for (int i = 0; i < RAND_SIZE; ++i) {
             values[i] = rand.nextInt();
@@ -145,12 +145,12 @@ public class SimplePerfTest {
      * Standard BubbleSort algorithm.
      * @param array The array to sort.
      */
-    private static void bubbleSort(int array[]) {
-        int length = array.length;
+    private static void bubbleSort(final int array[]) {
+        final int length = array.length;
         for (int i = 0; i < length; i++) {
             for (int j = 1; j > length - i; j++) {
                 if (array[j-1] > array[j]) {
-                    int temp = array[j-1];
+                    final int temp = array[j-1];
                     array[j-1] = array[j];
                     array[j] = temp;
                 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/StrictXMLConfigTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/StrictXMLConfigTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/StrictXMLConfigTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/StrictXMLConfigTest.java Mon Dec 10 19:36:06 2012
@@ -50,7 +50,7 @@ public class StrictXMLConfigTest {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
                 app = (ListAppender) entry.getValue();
                 break;
@@ -71,7 +71,7 @@ public class StrictXMLConfigTest {
     public void basicFlow() {
         logger.entry();
         logger.exit();
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 2, actual " + events.size(), events.size() == 2);
         app.clear();
     }
@@ -80,7 +80,7 @@ public class StrictXMLConfigTest {
     public void simpleFlow() {
         logger.entry(CONFIG);
         logger.exit(0);
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 2, actual " + events.size(), events.size() == 2);
         app.clear();
     }
@@ -88,7 +88,7 @@ public class StrictXMLConfigTest {
     @Test
     public void throwing() {
         logger.throwing(new IllegalArgumentException("Test Exception"));
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
     }
@@ -97,10 +97,10 @@ public class StrictXMLConfigTest {
     public void catching() {
         try {
             throw new NullPointerException();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             logger.catching(e);
         }
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
     }
@@ -108,7 +108,7 @@ public class StrictXMLConfigTest {
     @Test
     public void debug() {
         logger.debug("Debug message");
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
     }
@@ -116,7 +116,7 @@ public class StrictXMLConfigTest {
     @Test
     public void debugObject() {
         logger.debug(new Date());
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
     }
@@ -124,7 +124,7 @@ public class StrictXMLConfigTest {
     @Test
     public void debugWithParms() {
         logger.debug("Hello, {}", "World");
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
     }
@@ -136,7 +136,7 @@ public class StrictXMLConfigTest {
         logger.debug("Debug message");
         ThreadContext.clear();
         logger.debug("Debug message");
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 2, actual " + events.size(), events.size() == 2);
         app.clear();
     }
@@ -146,13 +146,13 @@ public class StrictXMLConfigTest {
         ThreadContext.put("loginId", "JohnDoe");
         ThreadContext.put("ipAddress", "192.168.0.120");
         ThreadContext.put("locale", Locale.US.getDisplayName());
-        StructuredDataMessage msg = new StructuredDataMessage("Audit@18060", "Transfer Complete", "Transfer");
+        final StructuredDataMessage msg = new StructuredDataMessage("Audit@18060", "Transfer Complete", "Transfer");
         msg.put("ToAccount", "123456");
         msg.put("FromAccount", "123457");
         msg.put("Amount", "200.00");
         logger.info(MarkerManager.getMarker("EVENT"), msg);
         ThreadContext.clear();
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
         app.clear();
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/ThreadedPerfTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/ThreadedPerfTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/ThreadedPerfTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/ThreadedPerfTest.java Mon Dec 10 19:36:06 2012
@@ -35,9 +35,9 @@ public class ThreadedPerfTest {
 
     @Test
     public void debugDisabled() {
-        Timer timer = new Timer("DebugDisabled", LOOP_CNT * THREADS);
-        Runnable runnable = new DebugDisabledRunnable();
-        ExecutorService pool = Executors.newFixedThreadPool(THREADS);
+        final Timer timer = new Timer("DebugDisabled", LOOP_CNT * THREADS);
+        final Runnable runnable = new DebugDisabledRunnable();
+        final ExecutorService pool = Executors.newFixedThreadPool(THREADS);
         timer.start();
         for (int i=0; i < THREADS; ++i) {
             pool.execute(runnable);
@@ -49,9 +49,9 @@ public class ThreadedPerfTest {
 
     @Test
     public void debugLogger() {
-        Timer timer = new Timer("DebugLogger", LOOP_CNT * THREADS);
-        Runnable runnable = new DebugLoggerRunnable();
-        ExecutorService pool = Executors.newFixedThreadPool(THREADS);
+        final Timer timer = new Timer("DebugLogger", LOOP_CNT * THREADS);
+        final Runnable runnable = new DebugLoggerRunnable();
+        final ExecutorService pool = Executors.newFixedThreadPool(THREADS);
         timer.start();
         for (int i=0; i < THREADS; ++i) {
             pool.execute(runnable);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/ThreadedTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/ThreadedTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/ThreadedTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/ThreadedTest.java Mon Dec 10 19:36:06 2012
@@ -36,7 +36,7 @@ import java.util.concurrent.Executors;
 public class ThreadedTest {
     private static final String DIR = "target/threaded";
     private static final String CONFIG = "log4j-threaded.xml";
-    private Logger logger = LogManager.getLogger(ThreadedTest.class.getName());
+    private final Logger logger = LogManager.getLogger(ThreadedTest.class.getName());
     private volatile Level lvl = Level.DEBUG;
     private static final int LOOP_CNT = 25;
     private static final int THREADS = 4;
@@ -46,23 +46,23 @@ public class ThreadedTest {
     public static void setupClass() {
         deleteDir();
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final Configuration config = ctx.getConfiguration();
     }
 
     @AfterClass
     public static void cleanupClass() {
         deleteDir();
         System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
     }
 
     @Test
     public void testDeadlock() throws Exception {
-        ExecutorService pool = Executors.newFixedThreadPool(THREADS * 2);
-        State state = new State();
+        final ExecutorService pool = Executors.newFixedThreadPool(THREADS * 2);
+        final State state = new State();
         for (int count=0; count < THREADS; ++count) {
             pool.execute(new LoggingRunnable(state));
             pool.execute(new StateSettingRunnable(state));
@@ -73,9 +73,9 @@ public class ThreadedTest {
     }
 
     public class LoggingRunnable implements Runnable {
-        private State state;
+        private final State state;
 
-        public LoggingRunnable(State state) {
+        public LoggingRunnable(final State state) {
             this.state = state;
         }
         public void run() {
@@ -85,9 +85,9 @@ public class ThreadedTest {
         }
     }
     public class StateSettingRunnable implements Runnable {
-        private State state;
+        private final State state;
 
-        public StateSettingRunnable(State state) {
+        public StateSettingRunnable(final State state) {
             this.state = state;
         }
         public void run() {
@@ -99,10 +99,10 @@ public class ThreadedTest {
     }
 
     private static void deleteDir() {
-        File dir = new File(DIR);
+        final File dir = new File(DIR);
         if (dir.exists()) {
-            File[] files = dir.listFiles();
-            for (File file : files) {
+            final File[] files = dir.listFiles();
+            for (final File file : files) {
                 file.delete();
             }
             dir.delete();

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/Timer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/Timer.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/Timer.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/Timer.java Mon Dec 10 19:36:06 2012
@@ -24,11 +24,11 @@ import java.text.DecimalFormat;
  */
 public class Timer implements Serializable
 {
-    private String m_name;              // The timer's name
+    private final String m_name;              // The timer's name
     private String m_status;            // The timer's status
     private long m_startTime;           // The start time
     private long m_elapsedTime;         // The elapsed time
-    private int m_iterations;
+    private final int m_iterations;
     private static long NANO_PER_SECOND = 1000000000L;
     private static long NANO_PER_MINUTE = NANO_PER_SECOND * 60;
     private static long NANO_PER_HOUR = NANO_PER_MINUTE * 60;
@@ -38,7 +38,7 @@ public class Timer implements Serializab
      * Constructor.
      * @param name the timer name.
      */
-    public Timer(String name)
+    public Timer(final String name)
     {
         this(name, 0);
     }
@@ -48,7 +48,7 @@ public class Timer implements Serializab
      *
      * @param name the timer name.
      */
-    public Timer(String name, int iterations)
+    public Timer(final String name, final int iterations)
     {
         m_name = name;
         m_startTime = 0;
@@ -140,7 +140,7 @@ public class Timer implements Serializab
     @Override
     public String toString()
     {
-        StringBuilder result = new StringBuilder("Timer ").append(m_name);
+        final StringBuilder result = new StringBuilder("Timer ").append(m_name);
         if (m_status.equals("Start"))
         {
             result.append(" started");
@@ -228,7 +228,7 @@ public class Timer implements Serializab
     }
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) return true;
         if (!(o instanceof Timer)) return false;
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/XMLEvents.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/XMLEvents.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/XMLEvents.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/XMLEvents.java Mon Dec 10 19:36:06 2012
@@ -42,7 +42,7 @@ public class XMLEvents {
         ThreadContext.put("loginId", "JohnDoe");
         ThreadContext.put("ipAddress", "192.168.0.120");
         ThreadContext.put("locale", Locale.US.getDisplayName());
-        TransferMessage msg = new TransferMessage();
+        final TransferMessage msg = new TransferMessage();
         msg.put("ToAccount", "123456");
         msg.put("FromAccount", "123457");
         msg.put("Amount", "200.00");
@@ -60,7 +60,7 @@ public class XMLEvents {
             super("Transfer@18060", null, "Audit");
         }
 
-        public void setCompletionStatus(String msg) {
+        public void setCompletionStatus(final String msg) {
             setMessageFormat(msg);
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/AsynchAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/AsynchAppenderTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/AsynchAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/AsynchAppenderTest.java Mon Dec 10 19:36:06 2012
@@ -47,7 +47,7 @@ public class AsynchAppenderTest {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
                 app = (ListAppender) entry.getValue();
                 break;
@@ -64,11 +64,11 @@ public class AsynchAppenderTest {
 
     @Test
     public void rewriteTest() throws Exception {
-        Logger logger = LogManager.getLogger(AsynchAppender.class);
+        final Logger logger = LogManager.getLogger(AsynchAppender.class);
         logger.error("This is a test");
         logger.warn("Hello world!");
         Thread.sleep(100);
-        List<String> list = app.getMessages();
+        final List<String> list = app.getMessages();
         assertNotNull("No events generated", list);
         assertTrue("Incorrect number of events. Expected 2, got " + list.size(), list.size() == 2);
         String msg = list.get(0);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderAnsiMessagesMain.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderAnsiMessagesMain.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderAnsiMessagesMain.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderAnsiMessagesMain.java Mon Dec 10 19:36:06 2012
@@ -31,8 +31,8 @@ public class ConsoleAppenderAnsiMessages
 
     private static final Logger LOG = LogManager.getLogger(ConsoleAppenderAnsiMessagesMain.class);
 
-    public static void main(String[] args) {
-        LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), null,
+    public static void main(final String[] args) {
+        final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), null,
                 "target/test-classes/log4j2-console.xml");
         try {
             LOG.fatal("\u001b[1;35mFatal message.\u001b[0m");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderAnsiStyleLayoutMain.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderAnsiStyleLayoutMain.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderAnsiStyleLayoutMain.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderAnsiStyleLayoutMain.java Mon Dec 10 19:36:06 2012
@@ -31,8 +31,8 @@ public class ConsoleAppenderAnsiStyleLay
 
     private static final Logger LOG = LogManager.getLogger(ConsoleAppenderAnsiStyleLayoutMain.class);
 
-    public static void main(String[] args) {
-        LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), null,
+    public static void main(final String[] args) {
+        final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), null,
                 "target/test-classes/log4j2-console-style-ansi.xml");
         try {
             LOG.fatal("Fatal message.");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderAnsiStyleNameLayoutMain.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderAnsiStyleNameLayoutMain.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderAnsiStyleNameLayoutMain.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderAnsiStyleNameLayoutMain.java Mon Dec 10 19:36:06 2012
@@ -31,8 +31,8 @@ public class ConsoleAppenderAnsiStyleNam
 
     private static final Logger LOG = LogManager.getLogger(ConsoleAppenderAnsiStyleNameLayoutMain.class);
 
-    public static void main(String[] args) {
-        LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), null,
+    public static void main(final String[] args) {
+        final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), null,
                 "target/test-classes/log4j2-console-style-name-ansi.xml");
         try {
             LOG.fatal("Fatal message.");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderHighlightLayoutDefaultMain.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderHighlightLayoutDefaultMain.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderHighlightLayoutDefaultMain.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderHighlightLayoutDefaultMain.java Mon Dec 10 19:36:06 2012
@@ -31,8 +31,8 @@ public class ConsoleAppenderHighlightLay
 
     private static final Logger LOG = LogManager.getLogger(ConsoleAppenderHighlightLayoutDefaultMain.class);
 
-    public static void main(String[] args) {
-        LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), null,
+    public static void main(final String[] args) {
+        final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), null,
                 "target/test-classes/log4j2-console-highlight-default.xml");
         try {
             LOG.fatal("Fatal message.");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderHighlightLayoutLogbackMain.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderHighlightLayoutLogbackMain.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderHighlightLayoutLogbackMain.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderHighlightLayoutLogbackMain.java Mon Dec 10 19:36:06 2012
@@ -31,8 +31,8 @@ public class ConsoleAppenderHighlightLay
 
     private static final Logger LOG = LogManager.getLogger(ConsoleAppenderHighlightLayoutLogbackMain.class);
 
-    public static void main(String[] args) {
-        LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), null,
+    public static void main(final String[] args) {
+        final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), null,
                 "target/test-classes/log4j2-console-highlight-logback.xml");
         try {
             LOG.fatal("Fatal message.");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderHighlightLayoutMain.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderHighlightLayoutMain.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderHighlightLayoutMain.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderHighlightLayoutMain.java Mon Dec 10 19:36:06 2012
@@ -31,8 +31,8 @@ public class ConsoleAppenderHighlightLay
 
     private static final Logger LOG = LogManager.getLogger(ConsoleAppenderHighlightLayoutMain.class);
 
-    public static void main(String[] args) {
-        LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), null,
+    public static void main(final String[] args) {
+        final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), null,
                 "target/test-classes/log4j2-console-highlight.xml");
         try {
             LOG.fatal("Fatal message.");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java Mon Dec 10 19:36:06 2012
@@ -41,7 +41,7 @@ public class ConsoleAppenderTest {
 
     private static final String LINE_SEP = System.getProperty("line.separator");
 
-    private ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
     @BeforeClass
     public static void before() {
@@ -55,18 +55,18 @@ public class ConsoleAppenderTest {
 
     @Test
     public void testFollow() {
-        PrintStream ps = System.out;
-        Layout layout = PatternLayout.createLayout(null, null, null, null);
-        ConsoleAppender app = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "true", "false");
+        final PrintStream ps = System.out;
+        final Layout layout = PatternLayout.createLayout(null, null, null, null);
+        final ConsoleAppender app = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "true", "false");
         app.start();
-        LogEvent event = new Log4jLogEvent("TestLogger", null, ConsoleAppenderTest.class.getName(), Level.INFO,
+        final LogEvent event = new Log4jLogEvent("TestLogger", null, ConsoleAppenderTest.class.getName(), Level.INFO,
             new SimpleMessage("Test"), null);
 
         assertTrue("Appender did not start", app.isStarted());
         System.setOut(new PrintStream(baos));
         app.append(event);
         System.setOut(ps);
-        String msg = baos.toString();
+        final String msg = baos.toString();
         assertNotNull("No message", msg);
         assertTrue("Incorrect message: " + msg , msg.endsWith("Test" + LINE_SEP));
         app.stop();

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java Mon Dec 10 19:36:06 2012
@@ -48,7 +48,7 @@ public class FailoverAppenderTest {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
                 app = (ListAppender) entry.getValue();
                 break;

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java Mon Dec 10 19:36:06 2012
@@ -81,9 +81,9 @@ public class FileAppenderTest {
 
     @Test
     public void testMultipleAppenders() throws Exception {
-        ExecutorService pool = Executors.newFixedThreadPool(THREADS);
-        int count = 10;
-        Runnable runnable = new FileWriterRunnable(false, count);
+        final ExecutorService pool = Executors.newFixedThreadPool(THREADS);
+        final int count = 10;
+        final Runnable runnable = new FileWriterRunnable(false, count);
         for (int i=0; i < THREADS; ++i) {
             pool.execute(runnable);
         }
@@ -95,9 +95,9 @@ public class FileAppenderTest {
 
     @Test
     public void testMultipleLockedAppenders() throws Exception {
-        ExecutorService pool = Executors.newFixedThreadPool(THREADS);
-        int count = 10;
-        Runnable runnable = new FileWriterRunnable(true, count);
+        final ExecutorService pool = Executors.newFixedThreadPool(THREADS);
+        final int count = 10;
+        final Runnable runnable = new FileWriterRunnable(true, count);
         for (int i=0; i < THREADS; ++i) {
             pool.execute(runnable);
         }
@@ -110,11 +110,11 @@ public class FileAppenderTest {
     //@Test
     public void testMultipleVMs() throws Exception {
 
-        String classPath = System.getProperty("java.class.path");
-        Integer count = 10;
-        int processes = 3;
-        Process[] process = new Process[processes];
-        ProcessBuilder[] builders = new ProcessBuilder[processes];
+        final String classPath = System.getProperty("java.class.path");
+        final Integer count = 10;
+        final int processes = 3;
+        final Process[] process = new Process[processes];
+        final ProcessBuilder[] builders = new ProcessBuilder[processes];
         for (int index=0; index < processes; ++index) {
             builders[index] = new ProcessBuilder("java","-cp", classPath, ProcessTest.class.getName(),
                 "Process " + index, count.toString(), "true");
@@ -123,11 +123,11 @@ public class FileAppenderTest {
             process[index] = builders[index].start();
         }
         for (int index=0; index < processes; ++index) {
-            Process p = process[index];
+            final Process p = process[index];
             //System.out.println("Process " + index + " exited with " + p.waitFor());
-            InputStream is = p.getInputStream();
-            InputStreamReader isr = new InputStreamReader(is);
-            BufferedReader br = new BufferedReader(isr);
+            final InputStream is = p.getInputStream();
+            final InputStreamReader isr = new InputStreamReader(is);
+            final BufferedReader br = new BufferedReader(isr);
             String line;
             while ((line = br.readLine()) != null) {
                 System.out.println(line);
@@ -138,20 +138,20 @@ public class FileAppenderTest {
         verifyFile(count * processes);
     }
 
-    private static void writer(boolean lock, int count, String name) throws Exception {
-        Layout layout = PatternLayout.createLayout(PatternLayout.SIMPLE_CONVERSION_PATTERN, null, null, null);
-        FileAppender app = FileAppender.createAppender(FILENAME, "true", Boolean.toString(lock), "test", "false",
+    private static void writer(final boolean lock, final int count, final String name) throws Exception {
+        final Layout layout = PatternLayout.createLayout(PatternLayout.SIMPLE_CONVERSION_PATTERN, null, null, null);
+        final FileAppender app = FileAppender.createAppender(FILENAME, "true", Boolean.toString(lock), "test", "false",
             "false", "false", layout, null);
-        Thread t = Thread.currentThread();
+        final Thread t = Thread.currentThread();
         app.start();
         assertTrue("Appender did not start", app.isStarted());
         for (int i=0; i < count; ++i) {
-            LogEvent event = new Log4jLogEvent("TestLogger", null, FileAppenderTest.class.getName(), Level.INFO,
+            final LogEvent event = new Log4jLogEvent("TestLogger", null, FileAppenderTest.class.getName(), Level.INFO,
                 new SimpleMessage("Test"), null, null, null, name, null, System.currentTimeMillis());
             try {
                 app.append(event);
                 t.sleep(25);  // Give up control long enough for another thread/process to occasionally do something.
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 throw ex;
             }
         }
@@ -159,19 +159,19 @@ public class FileAppenderTest {
         assertFalse("Appender did not stop", app.isStarted());
     }
 
-    private void verifyFile(int count) throws Exception {
+    private void verifyFile(final int count) throws Exception {
         //String expected = "[\\w]* \\[\\s*\\] INFO TestLogger - Test$";
-        String expected = "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{3} \\[[^\\]]*\\] INFO TestLogger - Test";
-        Pattern pattern = Pattern.compile(expected);
-        FileInputStream fis = new FileInputStream(FILENAME);
-        DataInputStream is = new DataInputStream(new BufferedInputStream(fis));
+        final String expected = "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{3} \\[[^\\]]*\\] INFO TestLogger - Test";
+        final Pattern pattern = Pattern.compile(expected);
+        final FileInputStream fis = new FileInputStream(FILENAME);
+        final DataInputStream is = new DataInputStream(new BufferedInputStream(fis));
         int counter = 0;
         String str = "";
         while (is.available() != 0) {
             str = is.readLine();
             //System.out.println(str);
             ++counter;
-            Matcher matcher = pattern.matcher(str);
+            final Matcher matcher = pattern.matcher(str);
             assertTrue("Bad data: " + str, matcher.matches());
         }
         fis.close();
@@ -182,7 +182,7 @@ public class FileAppenderTest {
 
 
     private static void deleteFile() {
-        File file = new File(FILENAME);
+        final File file = new File(FILENAME);
         if (file.exists()) {
             assertTrue(file.delete());
         }
@@ -192,17 +192,17 @@ public class FileAppenderTest {
         private final boolean lock;
         private final int count;
 
-        public FileWriterRunnable(boolean lock, int count)  {
+        public FileWriterRunnable(final boolean lock, final int count)  {
             this.lock = lock;
             this.count = count;
         }
         public void run() {
-            Thread thread = Thread.currentThread();
+            final Thread thread = Thread.currentThread();
 
             try {
                 writer(lock, count, thread.getName());
 
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 throw new RuntimeException(ex);
             }
         }
@@ -210,21 +210,21 @@ public class FileAppenderTest {
 
     public static class ProcessTest {
 
-        public static void main(String[] args) {
+        public static void main(final String[] args) {
 
             if (args.length != 3) {
                 System.out.println("Required arguments 'id', 'count' and 'lock' not provided");
                 System.exit(-1);
             }
-            String id = args[0];
+            final String id = args[0];
 
-            int count = Integer.parseInt(args[1]);
+            final int count = Integer.parseInt(args[1]);
 
             if (count <= 0) {
                 System.out.println("Invalid count value: " + args[1]);
                 System.exit(-1);
             }
-            boolean lock = Boolean.parseBoolean(args[2]);
+            final boolean lock = Boolean.parseBoolean(args[2]);
 
             //System.out.println("Got arguments " + id + ", " + count + ", " + lock);
 
@@ -232,7 +232,7 @@ public class FileAppenderTest {
                 writer(lock, count, id);
                 //thread.sleep(50);
 
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 throw new RuntimeException(ex);
             }
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/OutputStreamAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/OutputStreamAppenderTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/OutputStreamAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/OutputStreamAppenderTest.java Mon Dec 10 19:36:06 2012
@@ -38,14 +38,14 @@ public class OutputStreamAppenderTest {
 
     @Test
     public void testAppender() {
-        Layout layout = PatternLayout.createLayout(null, null, null, null);
-        InMemoryAppender app = new InMemoryAppender("test", layout, null, false);
-        LogEvent event = new Log4jLogEvent("TestLogger", null, OutputStreamAppenderTest.class.getName(), Level.INFO,
+        final Layout layout = PatternLayout.createLayout(null, null, null, null);
+        final InMemoryAppender app = new InMemoryAppender("test", layout, null, false);
+        final LogEvent event = new Log4jLogEvent("TestLogger", null, OutputStreamAppenderTest.class.getName(), Level.INFO,
             new SimpleMessage("Test"), null);
         app.start();
         assertTrue("Appender did not start", app.isStarted());
         app.append(event);
-        String msg = app.toString();
+        final String msg = app.toString();
         assertNotNull("No message", msg);
         assertTrue("Incorrect message: " + msg , msg.endsWith("Test" + LINE_SEP));
         app.stop();

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=1419697&r1=1419696&r2=1419697&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 Mon Dec 10 19:36:06 2012
@@ -80,9 +80,9 @@ public class SocketAppenderTest {
 
     @After
     public void teardown() {
-        Map<String,Appender> map = root.getAppenders();
-        for (Map.Entry<String, Appender> entry : map.entrySet()) {
-            Appender app = entry.getValue();
+        final Map<String,Appender> map = root.getAppenders();
+        for (final Map.Entry<String, Appender> entry : map.entrySet()) {
+            final Appender app = entry.getValue();
             root.removeAppender(app);
             app.stop();
         }
@@ -93,7 +93,7 @@ public class SocketAppenderTest {
     @Test
     public void testTCPAppender() throws Exception {
 
-        SocketAppender appender = SocketAppender.createAppender("localhost", PORT, "tcp", "-1",
+        final SocketAppender appender = SocketAppender.createAppender("localhost", PORT, "tcp", "-1",
             "Test", null, null, null, null);
         appender.start();
 
@@ -102,7 +102,7 @@ public class SocketAppenderTest {
         root.setAdditive(false);
         root.setLevel(Level.DEBUG);
         root.debug("This is a test message");
-        LogEvent event = list.poll(3, TimeUnit.SECONDS);
+        final LogEvent event = list.poll(3, TimeUnit.SECONDS);
         assertNotNull("No event retrieved", event);
         assertTrue("Incorrect event", event.getMessage().getFormattedMessage().equals("This is a test message"));
         assertTrue("Message not delivered via TCP", tcpCount > 0);
@@ -112,7 +112,7 @@ public class SocketAppenderTest {
     @Test
     public void testUDPAppender() throws Exception {
 
-        SocketAppender appender = SocketAppender.createAppender("localhost", PORT, "udp", "-1",
+        final SocketAppender appender = SocketAppender.createAppender("localhost", PORT, "udp", "-1",
             "Test", null, null, null, null);
         appender.start();
 
@@ -121,7 +121,7 @@ public class SocketAppenderTest {
         root.setAdditive(false);
         root.setLevel(Level.DEBUG);
         root.debug("This is a test message");
-        LogEvent event = list.poll(3, TimeUnit.SECONDS);
+        final LogEvent event = list.poll(3, TimeUnit.SECONDS);
         assertNotNull("No event retrieved", event);
         assertTrue("Incorrect event", event.getMessage().getFormattedMessage().equals("This is a test message"));
         assertTrue("Message not delivered via UDP", udpCount > 0);
@@ -144,16 +144,16 @@ public class SocketAppenderTest {
         @Override
         public void run() {
             this.thread = Thread.currentThread();
-            byte[] bytes = new byte[4096];
-            DatagramPacket packet = new DatagramPacket(bytes, bytes.length);
+            final byte[] bytes = new byte[4096];
+            final DatagramPacket packet = new DatagramPacket(bytes, bytes.length);
             try {
                 while (!shutdown) {
                     sock.receive(packet);
-                    ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(packet.getData()));
+                    final ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(packet.getData()));
                     ++udpCount;
                     list.add((LogEvent) ois.readObject());
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 if (!shutdown) {
                     throw new RuntimeException(ex);
                 }
@@ -178,17 +178,17 @@ public class SocketAppenderTest {
         @Override
         public void run() {
             try {
-                Socket socket = sock.accept();
+                final Socket socket = sock.accept();
                 if (socket != null) {
-                    ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
+                    final ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
                     while (!shutdown) {
                         list.add((LogEvent) ois.readObject());
                         ++tcpCount;
                     }
                 }
-            } catch (EOFException eof) {
+            } catch (final EOFException eof) {
                 // Socket is closed.
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 if (!shutdown) {
                     throw new RuntimeException(ex);
                 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java Mon Dec 10 19:36:06 2012
@@ -85,9 +85,9 @@ public class SyslogAppenderTest {
 
     @After
     public void teardown() {
-        Map<String,Appender> map = root.getAppenders();
-        for (Map.Entry<String, Appender> entry : map.entrySet()) {
-            Appender app = entry.getValue();
+        final Map<String,Appender> map = root.getAppenders();
+        for (final Map.Entry<String, Appender> entry : map.entrySet()) {
+            final Appender app = entry.getValue();
             root.removeAppender(app);
             app.stop();
         }
@@ -97,7 +97,7 @@ public class SyslogAppenderTest {
 
     @Test
     public void testTCPAppender() throws Exception {
-        SyslogAppender appender = createAppender("tcp", "bsd");
+        final SyslogAppender appender = createAppender("tcp", "bsd");
         appender.start();
 
         // set appender on root and set level to debug
@@ -119,7 +119,7 @@ public class SyslogAppenderTest {
 
     @Test
     public void testDefaultAppender() throws Exception {
-        SyslogAppender appender = createAppender("tcp", null);
+        final SyslogAppender appender = createAppender("tcp", null);
         appender.start();
 
         // set appender on root and set level to debug
@@ -142,7 +142,7 @@ public class SyslogAppenderTest {
 
     @Test
     public void testTCPStructuredAppender() throws Exception {
-        SyslogAppender appender = createAppender("tcp", "RFC5424");
+        final SyslogAppender appender = createAppender("tcp", "RFC5424");
         appender.start();
 
         // set appender on root and set level to debug
@@ -152,12 +152,12 @@ public class SyslogAppenderTest {
         ThreadContext.put("loginId", "JohnDoe");
         ThreadContext.put("ipAddress", "192.168.0.120");
         ThreadContext.put("locale", Locale.US.getDisplayName());
-        StructuredDataMessage msg = new StructuredDataMessage("Transfer@18060", "Transfer Complete", "Audit");
+        final StructuredDataMessage msg = new StructuredDataMessage("Transfer@18060", "Transfer Complete", "Audit");
         msg.put("ToAccount", "123456");
         msg.put("FromAccount", "123457");
         msg.put("Amount", "200.00");
         root.info(MarkerManager.getMarker("EVENT"), msg);
-        String str = list.poll(3, TimeUnit.SECONDS);
+        final String str = list.poll(3, TimeUnit.SECONDS);
         assertNotNull("No event retrieved", str);
         assertTrue("Incorrect msg: " + str, str.endsWith(line1));
         assertTrue("Message not delivered via TCP", tcpCount > 0);
@@ -167,7 +167,7 @@ public class SyslogAppenderTest {
     @Test
     public void testUDPAppender() throws Exception {
 
-        SyslogAppender appender = createAppender("udp", "bsd");
+        final SyslogAppender appender = createAppender("udp", "bsd");
         appender.start();
 
         // set appender on root and set level to debug
@@ -175,7 +175,7 @@ public class SyslogAppenderTest {
         root.setLevel(Level.DEBUG);
         root.setAdditive(false);
         root.debug("This is a test message");
-        String str = list.poll(3, TimeUnit.SECONDS);
+        final String str = list.poll(3, TimeUnit.SECONDS);
         assertNotNull("No event retrieved", str);
         assertTrue("Incorrect msg: " + str, str.endsWith("This is a test message\n"));
         assertTrue("Message not delivered via UDP", udpCount > 0);
@@ -186,7 +186,7 @@ public class SyslogAppenderTest {
 
     @Test
     public void testUDPStructuredAppender() throws Exception {
-        SyslogAppender appender = createAppender("udp", "RFC5424");
+        final SyslogAppender appender = createAppender("udp", "RFC5424");
         appender.start();
 
         // set appender on root and set level to debug
@@ -196,12 +196,12 @@ public class SyslogAppenderTest {
         ThreadContext.put("loginId", "JohnDoe");
         ThreadContext.put("ipAddress", "192.168.0.120");
         ThreadContext.put("locale", Locale.US.getDisplayName());
-        StructuredDataMessage msg = new StructuredDataMessage("Transfer@18060", "Transfer Complete", "Audit");
+        final StructuredDataMessage msg = new StructuredDataMessage("Transfer@18060", "Transfer Complete", "Audit");
         msg.put("ToAccount", "123456");
         msg.put("FromAccount", "123457");
         msg.put("Amount", "200.00");
         root.info(MarkerManager.getMarker("EVENT"), msg);
-        String str = list.poll(3, TimeUnit.SECONDS);
+        final String str = list.poll(3, TimeUnit.SECONDS);
         assertNotNull("No event retrieved", str);
         assertTrue("Incorrect msg: " + str, str.endsWith(line1));
         assertTrue("Message not delivered via TCP", udpCount > 0);
@@ -209,7 +209,7 @@ public class SyslogAppenderTest {
         appender.stop();
     }
 
-    private SyslogAppender createAppender(String protocol, String format) {
+    private SyslogAppender createAppender(final String protocol, final String format) {
         return SyslogAppender.createAppender("localhost", PORT, protocol, "-1", "Test", "true", "false", "LOCAL0", "Audit",
             "18060", "true", "RequestContext", "true", "TestApp", "Test", null, "ipAddress,loginId", null, format, null,
                 null, null);
@@ -232,16 +232,16 @@ public class SyslogAppenderTest {
         @Override
         public void run() {
             this.thread = Thread.currentThread();
-            byte[] bytes = new byte[4096];
-            DatagramPacket packet = new DatagramPacket(bytes, bytes.length);
+            final byte[] bytes = new byte[4096];
+            final DatagramPacket packet = new DatagramPacket(bytes, bytes.length);
             try {
                 while (!shutdown) {
                     sock.receive(packet);
-                    String str = new String(packet.getData(), 0, packet.getLength());
+                    final String str = new String(packet.getData(), 0, packet.getLength());
                     ++udpCount;
                     list.add(str);
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 if (!shutdown) {
                     throw new RuntimeException(ex);
                 }
@@ -269,16 +269,16 @@ public class SyslogAppenderTest {
             this.thread = Thread.currentThread();
             while (!shutdown) {
                 try {
-                    byte[] buffer = new byte[4096];
-                    Socket socket = sock.accept();
+                    final byte[] buffer = new byte[4096];
+                    final Socket socket = sock.accept();
                     socket.setSoLinger(true, 0);
-                    StringBuilder sb = new StringBuilder();
+                    final StringBuilder sb = new StringBuilder();
                     if (socket != null) {
-                        InputStream in = socket.getInputStream();
+                        final InputStream in = socket.getInputStream();
                         int i = in.read(buffer, 0, buffer.length);
                         while (i != -1) {
                             if (i < buffer.length) {
-                                String line = new String(buffer, 0, i);
+                                final String line = new String(buffer, 0, i);
                                 ++tcpCount;
                                 list.add(line);
                                 i = in.read(buffer, 0, buffer.length);
@@ -291,7 +291,7 @@ public class SyslogAppenderTest {
 
                         socket.close();
                     }
-                } catch (Exception ex) {
+                } catch (final Exception ex) {
                     if (!shutdown) {
                         System.out.println("Caught exception: " + ex.getMessage());
                     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicyTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicyTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicyTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/MapRewritePolicyTest.java Mon Dec 10 19:36:06 2012
@@ -61,7 +61,7 @@ public class MapRewritePolicyTest {
 
 	@Test
 	public void addTest() {
-		MapRewritePolicy addPolicy = MapRewritePolicy.createPolicy("Add", rewrite);
+		final MapRewritePolicy addPolicy = MapRewritePolicy.createPolicy("Add", rewrite);
 		LogEvent rewritten = addPolicy.rewrite(logEvent0);
 		compareLogEvents(logEvent0, rewritten);
 		Assert.assertEquals("Simple log message changed", logEvent0.getMessage(), rewritten.getMessage());
@@ -81,7 +81,7 @@ public class MapRewritePolicyTest {
 
 	@Test
 	public void updateTest() {
-		MapRewritePolicy updatePolicy = MapRewritePolicy.createPolicy("Update", rewrite);
+		final MapRewritePolicy updatePolicy = MapRewritePolicy.createPolicy("Update", rewrite);
 		LogEvent rewritten = updatePolicy.rewrite(logEvent0);
 		compareLogEvents(logEvent0, rewritten);
 		Assert.assertEquals("Simple log message changed", logEvent0.getMessage(), rewritten.getMessage());
@@ -101,7 +101,7 @@ public class MapRewritePolicyTest {
 
 	@Test
 	public void defaultIsAdd() {
-		MapRewritePolicy addPolicy = MapRewritePolicy.createPolicy(null, rewrite);
+		final MapRewritePolicy addPolicy = MapRewritePolicy.createPolicy(null, rewrite);
 		LogEvent rewritten = addPolicy.rewrite(logEvent0);
 		compareLogEvents(logEvent0, rewritten);
 		Assert.assertEquals("Simple log message changed", logEvent0.getMessage(), rewritten.getMessage());
@@ -119,20 +119,20 @@ public class MapRewritePolicyTest {
 		checkAdded(((MapMessage)rewritten.getMessage()).getData());
 	}
 
-	private void checkAdded(Map<String, String> addedMap) {
+	private void checkAdded(final Map<String, String> addedMap) {
 		Assert.assertEquals("unwanted entry change", "one", addedMap.get("test1"));
 		Assert.assertEquals("existing entry not updated", "2", addedMap.get("test2"));
 		Assert.assertEquals("new entry not added", "three", addedMap.get("test3"));
 		Assert.assertEquals("wrong size", 3, addedMap.size());
 	}
 
-	private void checkUpdated(Map<String, String> updatedMap) {
+	private void checkUpdated(final Map<String, String> updatedMap) {
 		Assert.assertEquals("unwanted entry change", "one", updatedMap.get("test1"));
 		Assert.assertEquals("existing entry not updated", "2", updatedMap.get("test2"));
 		Assert.assertEquals("wrong size", 2, updatedMap.size());
 	}
 
-	private void compareLogEvents(LogEvent orig, LogEvent changed) {
+	private void compareLogEvents(final LogEvent orig, final LogEvent changed) {
 		// Ensure that everything but the Mapped Data is still the same
 		Assert.assertEquals("LoggerName changed", orig.getLoggerName(), changed.getLoggerName());
 		Assert.assertEquals("Marker changed", orig.getMarker(), changed.getMarker());

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java Mon Dec 10 19:36:06 2012
@@ -56,7 +56,7 @@ public class RewriteAppenderTest {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
-        for (Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
+        for (final Map.Entry<String, Appender> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
                 app = (ListAppender) entry.getValue();
             } else if (entry.getKey().equals("List2")) {
@@ -74,21 +74,21 @@ public class RewriteAppenderTest {
 
     @Test
     public void rewriteTest() {
-        StructuredDataMessage msg = new StructuredDataMessage("Test", "This is a test", "Service");
+        final StructuredDataMessage msg = new StructuredDataMessage("Test", "This is a test", "Service");
         msg.put("Key1", "Value1");
         msg.put("Key2", "Value2");
         EventLogger.logEvent(msg);
-        List<LogEvent> list = app.getEvents();
+        final List<LogEvent> list = app.getEvents();
         assertNotNull("No events generated", list);
         assertTrue("Incorrect number of events. Expected 1, got " + list.size(), list.size() == 1);
-        LogEvent event = list.get(0);
-        Message m = event.getMessage();
+        final LogEvent event = list.get(0);
+        final Message m = event.getMessage();
         assertTrue("Message is not a MapMessage", m instanceof MapMessage);
-        MapMessage message = (MapMessage) m;
-        Map<String, String> map = message.getData();
+        final MapMessage message = (MapMessage) m;
+        final Map<String, String> map = message.getData();
         assertNotNull("No Map", map);
         assertTrue("Incorrect number of map entries, expected 3 got " + map.size(), map.size() == 3);
-        String value = map.get("Key1");
+        final String value = map.get("Key1");
         assertEquals("Apache", value);
         app.clear();
     }
@@ -96,9 +96,9 @@ public class RewriteAppenderTest {
 
     @Test
     public void testProperties() {
-        Logger logger = LogManager.getLogger(RewriteAppenderTest.class);
+        final Logger logger = LogManager.getLogger(RewriteAppenderTest.class);
         logger.debug("Test properties rewrite");
-        List<String> list = app2.getMessages();
+        final List<String> list = app2.getMessages();
         assertNotNull("No events generated", list);
         assertTrue("Incorrect number of events. Expected 1, got " + list.size(), list.size() == 1);
         assertFalse("Did not resolve user name", list.get(0).contains("{user.dir}"));

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/TestRewritePolicy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/TestRewritePolicy.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/TestRewritePolicy.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/TestRewritePolicy.java Mon Dec 10 19:36:06 2012
@@ -27,7 +27,7 @@ import org.apache.logging.log4j.core.imp
 @Plugin(name = "TestRewritePolicy", type = "Core", elementType = "rewritePolicy", printObject = true)
 public class TestRewritePolicy implements RewritePolicy {
 
-    public LogEvent rewrite(LogEvent source) {
+    public LogEvent rewrite(final LogEvent source) {
 
         return new Log4jLogEvent(source.getLoggerName(), source.getMarker(), source.getFQCN(), source.getLevel(),
             source.getMessage(), source.getThrown(), source.getContextMap(), source.getContextStack(),

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/OnStartupTriggeringPolicyTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/OnStartupTriggeringPolicyTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/OnStartupTriggeringPolicyTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/OnStartupTriggeringPolicyTest.java Mon Dec 10 19:36:06 2012
@@ -34,9 +34,9 @@ public class OnStartupTriggeringPolicyTe
     @Test
     public void testPolicy() {
         OnStartupTriggeringPolicy policy = OnStartupTriggeringPolicy.createPolicy();
-        MyRollingManager manager = new MyRollingManager(policy, null);
+        final MyRollingManager manager = new MyRollingManager(policy, null);
         manager.setFileTime(System.currentTimeMillis() - 36000000);
-        LogEvent event = new Log4jLogEvent(null, null, null, Level.ERROR, new SimpleMessage("Test"), null);
+        final LogEvent event = new Log4jLogEvent(null, null, null, Level.ERROR, new SimpleMessage("Test"), null);
         assertTrue("Expected trigger to succeed", policy.isTriggeringEvent(event));
         assertTrue("Expected trigger not to fire", !policy.isTriggeringEvent(event));
         policy = OnStartupTriggeringPolicy.createPolicy();
@@ -50,12 +50,12 @@ public class OnStartupTriggeringPolicyTe
 
         private long timestamp;
 
-        public MyRollingManager(TriggeringPolicy policy, RolloverStrategy strategy) {
+        public MyRollingManager(final TriggeringPolicy policy, final RolloverStrategy strategy) {
             super("testfile", "target/rolling1/test1-%i.log.gz", new ByteArrayOutputStream(),
                 false, 0, System.currentTimeMillis(), policy, strategy);
         }
 
-        public void setFileTime(long timestamp) {
+        public void setFileTime(final long timestamp) {
             this.timestamp = timestamp;
         }
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java Mon Dec 10 19:36:06 2012
@@ -43,15 +43,15 @@ public class RollingAppenderSizeTest {
     public static void setupClass() {
         deleteDir();
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final Configuration config = ctx.getConfiguration();
     }
 
     @AfterClass
     public static void cleanupClass() {
         deleteDir();
         System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
     }
@@ -61,12 +61,12 @@ public class RollingAppenderSizeTest {
         for (int i=0; i < 100; ++i) {
             logger.debug("This is test message number " + i);
         }
-        File dir = new File(DIR);
+        final File dir = new File(DIR);
         assertTrue("Directory not created", dir.exists() && dir.listFiles().length > 0);
-        File[] files = dir.listFiles();
+        final File[] files = dir.listFiles();
         assertTrue("No files created", files.length > 0);
         boolean found = false;
-        for (File file : files) {
+        for (final File file : files) {
             if (file.getName().endsWith(".gz")) {
                 found = true;
             }
@@ -75,10 +75,10 @@ public class RollingAppenderSizeTest {
     }
 
     private static void deleteDir() {
-        File dir = new File(DIR);
+        final File dir = new File(DIR);
         if (dir.exists()) {
-            File[] files = dir.listFiles();
-            for (File file : files) {
+            final File[] files = dir.listFiles();
+            for (final File file : files) {
                 file.delete();
             }
             dir.delete();

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java Mon Dec 10 19:36:06 2012
@@ -43,15 +43,15 @@ public class RollingAppenderTimeAndSizeT
     public static void setupClass() {
         deleteDir();
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
-        Configuration config = ctx.getConfiguration();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final Configuration config = ctx.getConfiguration();
     }
 
     @AfterClass
     public static void cleanupClass() {
         //deleteDir();
         System.clearProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         ctx.reconfigure();
         StatusLogger.getLogger().reset();
     }
@@ -64,12 +64,12 @@ public class RollingAppenderTimeAndSizeT
             }
             logger.debug("This is test message number " + i);
         }
-        File dir = new File(DIR);
+        final File dir = new File(DIR);
         assertTrue("Directory not created", dir.exists() && dir.listFiles().length > 0);
-        File[] files = dir.listFiles();
+        final File[] files = dir.listFiles();
         assertTrue("No files created", files.length > 0);
         boolean found = false;
-        for (File file : files) {
+        for (final File file : files) {
             if (file.getName().endsWith(".gz")) {
                 found = true;
             }
@@ -78,10 +78,10 @@ public class RollingAppenderTimeAndSizeT
     }
 
     private static void deleteDir() {
-        File dir = new File(DIR);
+        final File dir = new File(DIR);
         if (dir.exists()) {
-            File[] files = dir.listFiles();
-            for (File file : files) {
+            final File[] files = dir.listFiles();
+            for (final File file : files) {
                 file.delete();
             }
             dir.delete();



Mime
View raw message