logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1419697 [14/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/net/JMSQueueTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueTest.java Mon Dec 10 19:36:06 2012
@@ -66,7 +66,7 @@ public class JMSQueueTest {
     @BeforeClass
     public static void setupClass() throws Exception {
         // MockContextFactory becomes the primary JNDI provider
-        StatusConsoleListener l = new StatusConsoleListener(Level.ERROR);
+        final StatusConsoleListener l = new StatusConsoleListener(Level.ERROR);
         StatusLogger.getLogger().registerListener(l);
         MockContextFactory.setAsInitial();
         context = new InitialContext();
@@ -83,9 +83,9 @@ public class JMSQueueTest {
 
     @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,19 +93,19 @@ public class JMSQueueTest {
 
     @Test
     public void testServer() throws Exception {
-        Filter clientFilter = new MessageFilter(Filter.Result.NEUTRAL, Filter.Result.DENY);
-        Filter serverFilter = new MessageFilter(Filter.Result.DENY, Filter.Result.NEUTRAL);
-        CompositeFilter clientFilters = CompositeFilter.createFilters(new Filter[]{clientFilter});
-        JMSQueueAppender appender = JMSQueueAppender.createAppender("Test", null, null, null, null, null, FACTORY_NAME,
+        final Filter clientFilter = new MessageFilter(Filter.Result.NEUTRAL, Filter.Result.DENY);
+        final Filter serverFilter = new MessageFilter(Filter.Result.DENY, Filter.Result.NEUTRAL);
+        final CompositeFilter clientFilters = CompositeFilter.createFilters(new Filter[]{clientFilter});
+        final JMSQueueAppender appender = JMSQueueAppender.createAppender("Test", null, null, null, null, null, FACTORY_NAME,
                 QUEUE_NAME, null, null, null, clientFilters, "true");
         appender.start();
-        CompositeFilter serverFilters = CompositeFilter.createFilters(new Filter[]{serverFilter});
-        ListAppender listApp = new ListAppender("Events", serverFilters, null, false, false);
+        final CompositeFilter serverFilters = CompositeFilter.createFilters(new Filter[]{serverFilter});
+        final ListAppender listApp = new ListAppender("Events", serverFilters, null, false, false);
         listApp.start();
-        PatternLayout layout = PatternLayout.createLayout("%m %ex%n", null, null, null);
-        ConsoleAppender console = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "false", "true");
+        final PatternLayout layout = PatternLayout.createLayout("%m %ex%n", null, null, null);
+        final ConsoleAppender console = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "false", "true");
         console.start();
-        Logger serverLogger = ctx.getLogger(JMSTopicReceiver.class.getName());
+        final Logger serverLogger = ctx.getLogger(JMSTopicReceiver.class.getName());
         serverLogger.addAppender(console);
         serverLogger.setAdditive(false);
 
@@ -117,21 +117,21 @@ public class JMSQueueTest {
         root.setLevel(Level.DEBUG);
         root.debug("This is a test message");
         Thread.sleep(100);
-        List<LogEvent> events = listApp.getEvents();
+        final List<LogEvent> events = listApp.getEvents();
         assertNotNull("No event retrieved", events);
         assertTrue("No events retrieved", events.size() > 0);
         assertTrue("Incorrect event", events.get(0).getMessage().getFormattedMessage().equals("This is a test message"));
     }
 
     private class MessageFilter extends AbstractFilter {
-        public MessageFilter(Result onMatch, Result onMismatch) {
+        public MessageFilter(final Result onMatch, final Result onMismatch) {
             super(onMatch, onMismatch);
         }
 
         @Override
-        public Result filter(LogEvent event) {
-            StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
-            for (StackTraceElement element : stackTrace) {
+        public Result filter(final LogEvent event) {
+            final StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
+            for (final StackTraceElement element : stackTrace) {
                 if (element.getMethodName().equals("onMessage")) {
                     return onMatch;
                 } else if (element.getMethodName().equals("testServer")) {

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicFailoverTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicFailoverTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicFailoverTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicFailoverTest.java Mon Dec 10 19:36:06 2012
@@ -77,7 +77,7 @@ public class JMSTopicFailoverTest {
     @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;
@@ -90,7 +90,7 @@ public class JMSTopicFailoverTest {
 
     private static void setupQueue() throws Exception {
         // MockContextFactory becomes the primary JNDI provider
-        StatusConsoleListener l = new StatusConsoleListener(Level.ERROR);
+        final StatusConsoleListener l = new StatusConsoleListener(Level.ERROR);
         StatusLogger.getLogger().registerListener(l);
         MockContextFactory.setAsInitial();
         context = new InitialContext();
@@ -103,9 +103,9 @@ public class JMSTopicFailoverTest {
     @Test
     public void testFailover() throws Exception {
         ThreadContext.put("appender", "Failover");
-        Logger logger = LogManager.getLogger(JMSTopicFailoverTest.class);
+        final Logger logger = LogManager.getLogger(JMSTopicFailoverTest.class);
         logger.debug("Test Message");
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertNotNull("No events returned", events);
         assertTrue("No events returned", events.size() > 0);
         assertTrue("Incorrect event", "Test Message".equals(events.get(0).getMessage().getFormattedMessage()));
@@ -114,11 +114,11 @@ public class JMSTopicFailoverTest {
     @Test
     public void testReconnect() throws Exception {
         context.rebind(TOPIC_NAME, new MockTopic(TOPIC_NAME));
-        AbstractJMSReceiver receiver = new JMSTopicReceiver(FACTORY_NAME, TOPIC_NAME, null, null);
+        final AbstractJMSReceiver receiver = new JMSTopicReceiver(FACTORY_NAME, TOPIC_NAME, null, null);
         ThreadContext.put("appender", "Failover");
-        Logger logger = LogManager.getLogger(JMSTopicFailoverTest.class);
+        final Logger logger = LogManager.getLogger(JMSTopicFailoverTest.class);
         logger.debug("Test Message");
-        List<LogEvent> events = app.getEvents();
+        final List<LogEvent> events = app.getEvents();
         assertNotNull("No events returned", events);
         assertTrue("No events returned", events.size() > 0);
         assertTrue("Incorrect event", "Test Message".equals(events.get(0).getMessage().getFormattedMessage()));

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicTest.java Mon Dec 10 19:36:06 2012
@@ -66,7 +66,7 @@ public class JMSTopicTest {
     @BeforeClass
     public static void setupClass() throws Exception {
         // MockContextFactory becomes the primary JNDI provider
-        StatusConsoleListener l = new StatusConsoleListener(Level.ERROR);
+        final StatusConsoleListener l = new StatusConsoleListener(Level.ERROR);
         StatusLogger.getLogger().registerListener(l);
         MockContextFactory.setAsInitial();
         context = new InitialContext();
@@ -83,9 +83,9 @@ public class JMSTopicTest {
 
     @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,19 +93,19 @@ public class JMSTopicTest {
 
     @Test
     public void testServer() throws Exception {
-        Filter clientFilter = new MessageFilter(Filter.Result.NEUTRAL, Filter.Result.DENY);
-        Filter serverFilter = new MessageFilter(Filter.Result.DENY, Filter.Result.NEUTRAL);
-        CompositeFilter clientFilters = CompositeFilter.createFilters(new Filter[]{clientFilter});
-        JMSTopicAppender appender = JMSTopicAppender.createAppender("Test", null, null, null, null, null, FACTORY_NAME,
+        final Filter clientFilter = new MessageFilter(Filter.Result.NEUTRAL, Filter.Result.DENY);
+        final Filter serverFilter = new MessageFilter(Filter.Result.DENY, Filter.Result.NEUTRAL);
+        final CompositeFilter clientFilters = CompositeFilter.createFilters(new Filter[]{clientFilter});
+        final JMSTopicAppender appender = JMSTopicAppender.createAppender("Test", null, null, null, null, null, FACTORY_NAME,
                 TOPIC_NAME, null, null, null, clientFilters, "true");
         appender.start();
-        CompositeFilter serverFilters = CompositeFilter.createFilters(new Filter[]{serverFilter});
-        ListAppender listApp = new ListAppender("Events", serverFilters, null, false, false);
+        final CompositeFilter serverFilters = CompositeFilter.createFilters(new Filter[]{serverFilter});
+        final ListAppender listApp = new ListAppender("Events", serverFilters, null, false, false);
         listApp.start();
-        PatternLayout layout = PatternLayout.createLayout("%m %ex%n", null, null, null);
-        ConsoleAppender console = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "false", "true");
+        final PatternLayout layout = PatternLayout.createLayout("%m %ex%n", null, null, null);
+        final ConsoleAppender console = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "false", "true");
         console.start();
-        Logger serverLogger = ctx.getLogger(JMSTopicReceiver.class.getName());
+        final Logger serverLogger = ctx.getLogger(JMSTopicReceiver.class.getName());
         serverLogger.addAppender(console);
         serverLogger.setAdditive(false);
 
@@ -117,21 +117,21 @@ public class JMSTopicTest {
         root.setLevel(Level.DEBUG);
         root.debug("This is a test message");
         Thread.sleep(100);
-        List<LogEvent> events = listApp.getEvents();
+        final List<LogEvent> events = listApp.getEvents();
         assertNotNull("No event retrieved", events);
         assertTrue("No events retrieved", events.size() > 0);
         assertTrue("Incorrect event", events.get(0).getMessage().getFormattedMessage().equals("This is a test message"));
     }
 
     private class MessageFilter extends AbstractFilter {
-        public MessageFilter(Result onMatch, Result onMismatch) {
+        public MessageFilter(final Result onMatch, final Result onMismatch) {
             super(onMatch, onMismatch);
         }
 
         @Override
-        public Result filter(LogEvent event) {
-            StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
-            for (StackTraceElement element : stackTrace) {
+        public Result filter(final LogEvent event) {
+            final StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
+            for (final StackTraceElement element : stackTrace) {
                 if (element.getMethodName().equals("onMessage")) {
                     return onMatch;
                 } else if (element.getMethodName().equals("testServer")) {

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/PriorityTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/PriorityTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/PriorityTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/PriorityTest.java Mon Dec 10 19:36:06 2012
@@ -28,7 +28,7 @@ public class PriorityTest {
 
     @Test
     public void testP1() {
-        int p = Priority.getPriority(Facility.AUTH, Level.INFO);
+        final int p = Priority.getPriority(Facility.AUTH, Level.INFO);
         assertTrue("Expected priority value is 38, got "+ p, p == 38);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java Mon Dec 10 19:36:06 2012
@@ -61,12 +61,12 @@ public class SocketMessageLossTest {
             futureIn = executor.submit(testServer);
 
             //System.err.println("Initializing logger");
-            Logger logger = LogManager.getLogger(SocketMessageLossTest.class);
+            final Logger logger = LogManager.getLogger(SocketMessageLossTest.class);
 
             String message = "Log #1";
             logger.error(message);
 
-            BufferedReader reader = new BufferedReader(new InputStreamReader(futureIn.get()));
+            final BufferedReader reader = new BufferedReader(new InputStreamReader(futureIn.get()));
             assertEquals(message, reader.readLine());
 
             //System.err.println("Closing server");
@@ -80,7 +80,7 @@ public class SocketMessageLossTest {
             try {
                 logger.error(message);
                 fail("Expected exception not thrown");
-            } catch (AppenderRuntimeException e) {
+            } catch (final AppenderRuntimeException e) {
                 // An exception is expected.
             }
 
@@ -88,7 +88,7 @@ public class SocketMessageLossTest {
             try {
                 logger.error(message);
                 fail("Expected exception not thrown");
-            } catch (AppenderRuntimeException e) {
+            } catch (final AppenderRuntimeException e) {
                 // An exception is expected.
             }
         } finally {
@@ -98,7 +98,7 @@ public class SocketMessageLossTest {
 
 
     private static class TestSocketServer implements Callable<InputStream> {
-        private ServerSocket server;
+        private final ServerSocket server;
         private Socket client;
 
         public TestSocketServer() throws Exception {
@@ -115,33 +115,33 @@ public class SocketMessageLossTest {
             closeQuietly(server);
         }
 
-        private void closeQuietly(ServerSocket socket) {
+        private void closeQuietly(final ServerSocket socket) {
             if (null != socket) {
                 try {
                     socket.close();
-                } catch (IOException ignore) {
+                } catch (final IOException ignore) {
                 }
             }
         }
 
-        private void closeQuietly(Socket socket) {
+        private void closeQuietly(final Socket socket) {
             if (null != socket) {
                 try {
                     socket.setSoLinger(true, 0);
                     socket.close();
-                } catch (IOException ignore) {
+                } catch (final IOException ignore) {
                 }
             }
         }
     }
 
-    private static void closeQuietly(ExecutorService executor) {
+    private static void closeQuietly(final ExecutorService executor) {
         if (null != executor) {
             executor.shutdownNow();
         }
     }
 
-    private static void closeQuietly(TestSocketServer testServer) {
+    private static void closeQuietly(final TestSocketServer testServer) {
         if (null != testServer) {
             testServer.close();
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketServerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketServerTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketServerTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketServerTest.java Mon Dec 10 19:36:06 2012
@@ -72,16 +72,16 @@ public class SocketServerTest {
         tcp.shutdown();
         try {
             thread.join();
-        } catch (InterruptedException iex) {
+        } catch (final InterruptedException iex) {
 
         }
     }
 
     @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();
         }
@@ -89,16 +89,16 @@ public class SocketServerTest {
 
     @Test
     public void testServer() throws Exception {
-        Filter socketFilter = new ThreadFilter(Filter.Result.NEUTRAL, Filter.Result.DENY);
-        Filter serverFilter = new ThreadFilter(Filter.Result.DENY, Filter.Result.NEUTRAL);
-        SocketAppender appender = SocketAppender.createAppender("localhost", PORT, "tcp", "-1",
+        final Filter socketFilter = new ThreadFilter(Filter.Result.NEUTRAL, Filter.Result.DENY);
+        final Filter serverFilter = new ThreadFilter(Filter.Result.DENY, Filter.Result.NEUTRAL);
+        final SocketAppender appender = SocketAppender.createAppender("localhost", PORT, "tcp", "-1",
             "Test", null, null, null, socketFilter);
         appender.start();
-        ListAppender listApp = new ListAppender("Events", serverFilter, null, false, false);
+        final ListAppender listApp = new ListAppender("Events", serverFilter, null, false, false);
         listApp.start();
-        PatternLayout layout = PatternLayout.createLayout("%m %ex%n", null, null, null);
-        ConsoleAppender console = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "false", "true");
-        Logger serverLogger = ctx.getLogger(SocketServer.class.getName());
+        final PatternLayout layout = PatternLayout.createLayout("%m %ex%n", null, null, null);
+        final ConsoleAppender console = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "false", "true");
+        final Logger serverLogger = ctx.getLogger(SocketServer.class.getName());
         serverLogger.addAppender(console);
         serverLogger.setAdditive(false);
 
@@ -110,7 +110,7 @@ public class SocketServerTest {
         root.debug("This is a test message");
         root.debug("This is test message 2");
         Thread.sleep(100);
-        List<LogEvent> events = listApp.getEvents();
+        final List<LogEvent> events = listApp.getEvents();
         assertNotNull("No event retrieved", events);
         assertTrue("No events retrieved", events.size() > 0);
         assertTrue("Incorrect event", events.get(0).getMessage().getFormattedMessage().equals("This is a test message"));
@@ -120,12 +120,12 @@ public class SocketServerTest {
 
     private class ThreadFilter extends AbstractFilter {
 
-        public ThreadFilter(Result onMatch, Result onMismatch) {
+        public ThreadFilter(final Result onMatch, final Result onMismatch) {
             super(onMatch, onMismatch);
         }
 
         @Override
-        public Filter.Result filter(LogEvent event) {
+        public Filter.Result filter(final LogEvent event) {
             return event.getThreadName().equals(Thread.currentThread().getName()) ? onMatch : onMismatch;
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java Mon Dec 10 19:36:06 2012
@@ -53,15 +53,15 @@ public class SocketTest {
         Logger logger = null;
         try {
             logger = LogManager.getLogger(SocketTest.class);
-        } catch (NullPointerException e) {
+        } catch (final NullPointerException e) {
             fail("Unexpected exception; should not occur until first logging statement " + e.getMessage());
         }
 
-        String message = "Log #1";
+        final String message = "Log #1";
         try {
             logger.error(message);
             fail("Expected exception not thrown");
-        } catch (AppenderRuntimeException e) {
+        } catch (final AppenderRuntimeException e) {
             //System.err.println("Expected exception here, but already errored out when initializing logger");
         }
     }
@@ -71,7 +71,7 @@ public class SocketTest {
         TestSocketServer testServer = null;
         ExecutorService executor = null;
         Future<InputStream> futureIn;
-        InputStream in;
+        final InputStream in;
 
         try {
             executor = Executors.newSingleThreadExecutor();
@@ -81,7 +81,7 @@ public class SocketTest {
             Thread.sleep(300);
 
             //System.err.println("Initializing logger");
-            Logger logger = LogManager.getLogger(SocketTest.class);
+            final Logger logger = LogManager.getLogger(SocketTest.class);
 
             String message = "Log #1";
             logger.error(message);
@@ -97,7 +97,7 @@ public class SocketTest {
             message = "Log #3";
             try {
                 logger.error(message);
-            } catch (AppenderRuntimeException e) {
+            } catch (final AppenderRuntimeException e) {
                 // System.err.println("Caught expected exception");
             }
 
@@ -110,7 +110,7 @@ public class SocketTest {
                 logger.error(message);
                 reader = new BufferedReader(new InputStreamReader(futureIn.get()));
                 assertEquals(message, reader.readLine());
-            } catch (AppenderRuntimeException e) {
+            } catch (final AppenderRuntimeException e) {
                 e.printStackTrace();
                 fail("Unexpected Exception");
             }
@@ -138,32 +138,32 @@ public class SocketTest {
             closeQuietly(server);
         }
 
-        private void closeQuietly(ServerSocket socket) {
+        private void closeQuietly(final ServerSocket socket) {
             if (null != socket) {
                 try {
                     socket.close();
-                } catch (IOException ignore) {
+                } catch (final IOException ignore) {
                 }
             }
         }
 
-        private void closeQuietly(Socket socket) {
+        private void closeQuietly(final Socket socket) {
             if (null != socket) {
                 try {
                     socket.close();
-                } catch (IOException ignore) {
+                } catch (final IOException ignore) {
                 }
             }
         }
     }
 
-    private static void closeQuietly(ExecutorService executor) {
+    private static void closeQuietly(final ExecutorService executor) {
         if (null != executor) {
             executor.shutdownNow();
         }
     }
 
-    private static void closeQuietly(TestSocketServer testServer) {
+    private static void closeQuietly(final TestSocketServer testServer) {
         if (null != testServer) {
             testServer.close();
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowablePatternConverterTest.java Mon Dec 10 19:36:06 2012
@@ -42,34 +42,34 @@ public class ExtendedThrowablePatternCon
 
     @Test
     public void testFull() {
-        ExtendedThrowablePatternConverter converter = ExtendedThrowablePatternConverter.newInstance(null);
-        Throwable cause = new NullPointerException("null pointer");
-        Throwable parent = new IllegalArgumentException("IllegalArgument", cause);
-        LogEvent event = new Log4jLogEvent("testLogger", null, this.getClass().getName(), Level.DEBUG,
+        final ExtendedThrowablePatternConverter converter = ExtendedThrowablePatternConverter.newInstance(null);
+        final Throwable cause = new NullPointerException("null pointer");
+        final Throwable parent = new IllegalArgumentException("IllegalArgument", cause);
+        final LogEvent event = new Log4jLogEvent("testLogger", null, this.getClass().getName(), Level.DEBUG,
             new SimpleMessage("test exception"), parent);
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         converter.format(event, sb);
-        StringWriter sw = new StringWriter();
-        PrintWriter pw = new PrintWriter(sw);
+        final StringWriter sw = new StringWriter();
+        final PrintWriter pw = new PrintWriter(sw);
         parent.printStackTrace(pw);
         String result = sb.toString();
         result = result.replaceAll(" ~?\\[.*\\]", "");
-        String expected = sw.toString().replaceAll("\r", "");
+        final String expected = sw.toString().replaceAll("\r", "");
         assertEquals(expected, result);
     }
 
     @Test
     public void testFiltering() {
-        String packages = "filters(org.junit, org.apache.maven, sun.reflect, java.lang.reflect)";
-        String[] options = {packages};
-        ExtendedThrowablePatternConverter converter = ExtendedThrowablePatternConverter.newInstance(options);
-        Throwable cause = new NullPointerException("null pointer");
-        Throwable parent = new IllegalArgumentException("IllegalArgument", cause);
-        LogEvent event = new Log4jLogEvent("testLogger", null, this.getClass().getName(), Level.DEBUG,
+        final String packages = "filters(org.junit, org.apache.maven, sun.reflect, java.lang.reflect)";
+        final String[] options = {packages};
+        final ExtendedThrowablePatternConverter converter = ExtendedThrowablePatternConverter.newInstance(options);
+        final Throwable cause = new NullPointerException("null pointer");
+        final Throwable parent = new IllegalArgumentException("IllegalArgument", cause);
+        final LogEvent event = new Log4jLogEvent("testLogger", null, this.getClass().getName(), Level.DEBUG,
             new SimpleMessage("test exception"), parent);
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         converter.format(event, sb);
-        String result = sb.toString();
+        final String result = sb.toString();
         assertTrue("No suppressed lines", result.contains(" suppressed "));
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowableTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowableTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowableTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowableTest.java Mon Dec 10 19:36:06 2012
@@ -46,7 +46,7 @@ public class ExtendedThrowableTest {
         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();
             }
@@ -64,10 +64,10 @@ public class ExtendedThrowableTest {
 
     @Test
     public void testException() {
-        Throwable cause = new NullPointerException("null pointer");
-        Throwable parent = new IllegalArgumentException("IllegalArgument", cause);
+        final Throwable cause = new NullPointerException("null pointer");
+        final Throwable parent = new IllegalArgumentException("IllegalArgument", cause);
         logger.error("Exception", parent);
-        List<String> msgs = app.getMessages();
+        final List<String> msgs = app.getMessages();
         assertNotNull(msgs);
         assertTrue("Incorrect number of messages. Should be 1 is " + msgs.size(), msgs.size() == 1);
         assertTrue("No suppressed lines", msgs.get(0).contains("suppressed"));

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/LevelPatternConverterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/LevelPatternConverterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/LevelPatternConverterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/LevelPatternConverterTest.java Mon Dec 10 19:36:06 2012
@@ -33,13 +33,13 @@ public class LevelPatternConverterTest {
 
     @Test
     public void testLevel() {
-        Message msg = new SimpleMessage("Hello");
+        final Message msg = new SimpleMessage("Hello");
         LogEvent event = new Log4jLogEvent("MyLogger", null, null, Level.DEBUG, msg, null);
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         LevelPatternConverter converter = LevelPatternConverter.newInstance(null);
         converter.format(event, sb);
         assertEquals(Level.DEBUG.toString(), sb.toString());
-        String[] opts = new String[] {"WARN=Warning, DEBUG=Debug, ERROR=Error, TRACE=Trace, INFO=Info"};
+        final String[] opts = new String[] {"WARN=Warning, DEBUG=Debug, ERROR=Error, TRACE=Trace, INFO=Info"};
         converter = LevelPatternConverter.newInstance(opts);
         sb.setLength(0);
         converter.format(event, sb);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/MapPatternConverterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/MapPatternConverterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/MapPatternConverterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/MapPatternConverterTest.java Mon Dec 10 19:36:06 2012
@@ -33,15 +33,15 @@ public class MapPatternConverterTest {
     @Test
     public void testConverter() {
 
-        MapMessage msg = new MapMessage();
+        final MapMessage msg = new MapMessage();
         msg.put("subject", "I");
         msg.put("verb", "love");
         msg.put("object", "Log4j");
-        MapPatternConverter converter = MapPatternConverter.newInstance(null);
-        LogEvent event = new Log4jLogEvent("MyLogger", null, null, Level.DEBUG, msg, null);
-        StringBuilder sb = new StringBuilder();
+        final MapPatternConverter converter = MapPatternConverter.newInstance(null);
+        final LogEvent event = new Log4jLogEvent("MyLogger", null, null, Level.DEBUG, msg, null);
+        final StringBuilder sb = new StringBuilder();
         converter.format(event, sb);
-        String str = sb.toString();
+        final String str = sb.toString();
         String expected = "subject=I";
         assertTrue("Missing or incorrect subject. Expected " + expected + ", actual " + str, str.contains(expected));
         expected = "verb=love";
@@ -53,16 +53,16 @@ public class MapPatternConverterTest {
     @Test
     public void testConverterWithKey() {
 
-        MapMessage msg = new MapMessage();
+        final MapMessage msg = new MapMessage();
         msg.put("subject", "I");
         msg.put("verb", "love");
         msg.put("object", "Log4j");
-        MapPatternConverter converter = MapPatternConverter.newInstance(new String[] {"object"});
-        LogEvent event = new Log4jLogEvent("MyLogger", null, null, Level.DEBUG, msg, null);
-        StringBuilder sb = new StringBuilder();
+        final MapPatternConverter converter = MapPatternConverter.newInstance(new String[] {"object"});
+        final LogEvent event = new Log4jLogEvent("MyLogger", null, null, Level.DEBUG, msg, null);
+        final StringBuilder sb = new StringBuilder();
         converter.format(event, sb);
-        String str = sb.toString();
-        String expected = "Log4j";
+        final String str = sb.toString();
+        final String expected = "Log4j";
         assertEquals(expected, str);
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/MarkerPatternConverterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/MarkerPatternConverterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/MarkerPatternConverterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/MarkerPatternConverterTest.java Mon Dec 10 19:36:06 2012
@@ -35,12 +35,12 @@ public class MarkerPatternConverterTest 
 
     @Test
     public void testLookup() {
-        Message msg = new StructuredDataMessage("Test", "This is a test", "Audit");
-        Marker eventMarker = MarkerManager.getMarker("EVENT");
-        Marker auditMarker = MarkerManager.getMarker("AUDIT", eventMarker);
-        LogEvent event = new Log4jLogEvent("MyLogger", auditMarker, null, Level.DEBUG, msg, null);
-        StringBuilder sb = new StringBuilder();
-        MarkerPatternConverter converter = MarkerPatternConverter.newInstance(null);
+        final Message msg = new StructuredDataMessage("Test", "This is a test", "Audit");
+        final Marker eventMarker = MarkerManager.getMarker("EVENT");
+        final Marker auditMarker = MarkerManager.getMarker("AUDIT", eventMarker);
+        final LogEvent event = new Log4jLogEvent("MyLogger", auditMarker, null, Level.DEBUG, msg, null);
+        final StringBuilder sb = new StringBuilder();
+        final MarkerPatternConverter converter = MarkerPatternConverter.newInstance(null);
         converter.format(event, sb);
         assertEquals(auditMarker.toString(), sb.toString());
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/NameAbbreviatorTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/NameAbbreviatorTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/NameAbbreviatorTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/NameAbbreviatorTest.java Mon Dec 10 19:36:06 2012
@@ -27,52 +27,52 @@ public class NameAbbreviatorTest {
 
     @Test
     public void testZero() {
-        String str = this.getClass().getName();
-        NameAbbreviator a = NameAbbreviator.getAbbreviator("0");
-        String result = a.abbreviate(str);
+        final String str = this.getClass().getName();
+        final NameAbbreviator a = NameAbbreviator.getAbbreviator("0");
+        final String result = a.abbreviate(str);
         assertEquals("NameAbbreviatorTest", result);
     }
 
     @Test
     public void testNameAbbreviation() {
-        String str = this.getClass().getName();
-        NameAbbreviator a = NameAbbreviator.getAbbreviator("1");
-        String result = a.abbreviate(str);
+        final String str = this.getClass().getName();
+        final NameAbbreviator a = NameAbbreviator.getAbbreviator("1");
+        final String result = a.abbreviate(str);
         assertEquals("NameAbbreviatorTest", result);
     }
 
      @Test
     public void testTwo() {
-        String str = this.getClass().getName();
-        NameAbbreviator a = NameAbbreviator.getAbbreviator("2");
-        String result = a.abbreviate(str);
+        final String str = this.getClass().getName();
+        final NameAbbreviator a = NameAbbreviator.getAbbreviator("2");
+        final String result = a.abbreviate(str);
         assertEquals("pattern.NameAbbreviatorTest", result);
 
     }
 
     @Test
     public void testShortName() {
-        String str = this.getClass().getName();
-        NameAbbreviator a = NameAbbreviator.getAbbreviator("1.");
-        String result = a.abbreviate(str);
+        final String str = this.getClass().getName();
+        final NameAbbreviator a = NameAbbreviator.getAbbreviator("1.");
+        final String result = a.abbreviate(str);
         assertEquals("o.a.l.l.c.p.NameAbbreviatorTest", result);
 
     }
 
     @Test
     public void testSkipNames() {
-        String str = this.getClass().getName();
-        NameAbbreviator a = NameAbbreviator.getAbbreviator("1.1.~");
-        String result = a.abbreviate(str);
+        final String str = this.getClass().getName();
+        final NameAbbreviator a = NameAbbreviator.getAbbreviator("1.1.~");
+        final String result = a.abbreviate(str);
         assertEquals("o.a.~.~.~.~.NameAbbreviatorTest", result);
 
     }
 
      @Test
     public void testZeroDot() {
-        String str = this.getClass().getName();
-        NameAbbreviator a = NameAbbreviator.getAbbreviator(".");
-        String result = a.abbreviate(str);
+        final String str = this.getClass().getName();
+        final NameAbbreviator a = NameAbbreviator.getAbbreviator(".");
+        final String result = a.abbreviate(str);
         assertEquals("......NameAbbreviatorTest", result);
 
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest.java Mon Dec 10 19:36:06 2012
@@ -47,11 +47,11 @@ public class PatternParserTest {
     Logger root = ctx.getLogger("");
 
     private static String msgPattern = "%m%n";
-    private String mdcMsgPattern1 = "%m : %X%n";
-    private String mdcMsgPattern2 = "%m : %X{key1}%n";
-    private String mdcMsgPattern3 = "%m : %X{key2}%n";
-    private String mdcMsgPattern4 = "%m : %X{key3}%n";
-    private String mdcMsgPattern5 = "%m : %X{key1},%X{key2},%X{key3}%n";
+    private final String mdcMsgPattern1 = "%m : %X%n";
+    private final String mdcMsgPattern2 = "%m : %X{key1}%n";
+    private final String mdcMsgPattern3 = "%m : %X{key2}%n";
+    private final String mdcMsgPattern4 = "%m : %X{key3}%n";
+    private final String mdcMsgPattern5 = "%m : %X{key1},%X{key2},%X{key3}%n";
 
     private static String customPattern = "[%d{yyyyMMdd HH:mm:ss,SSS}] %-5p [%-25.25c{1}:%-4L] - %m%n";
     private static String nestedPattern =
@@ -67,8 +67,8 @@ public class PatternParserTest {
         parser = new PatternParser(KEY);
     }
 
-    private void validateConverter(List<PatternFormatter> formatter, int index, String name) {
-        PatternConverter pc = formatter.get(index).getConverter();
+    private void validateConverter(final List<PatternFormatter> formatter, final int index, final String name) {
+        final PatternConverter pc = formatter.get(index).getConverter();
         assertEquals("Incorrect converter " + pc.getName() + " at index " + index + " expected " + name,
             pc.getName(), name);
     }
@@ -78,7 +78,7 @@ public class PatternParserTest {
      */
     @Test
     public void defaultPattern() {
-        List<PatternFormatter> formatters = parser.parse(msgPattern);
+        final List<PatternFormatter> formatters = parser.parse(msgPattern);
         assertNotNull(formatters);
         assertTrue(formatters.size() == 2);
         validateConverter(formatters, 0, "Message");
@@ -90,39 +90,39 @@ public class PatternParserTest {
      */
     @Test
     public void testCustomPattern() {
-        List<PatternFormatter> formatters = parser.parse(customPattern);
+        final List<PatternFormatter> formatters = parser.parse(customPattern);
         assertNotNull(formatters);
-        Map<String, String> mdc = new HashMap<String, String>();
+        final Map<String, String> mdc = new HashMap<String, String>();
         mdc.put("loginId", "Fred");
-        Throwable t = new Throwable();
-        StackTraceElement[] elements = t.getStackTrace();
-        LogEvent event = new Log4jLogEvent("org.apache.logging.log4j.PatternParserTest", MarkerManager.getMarker("TEST"),
+        final Throwable t = new Throwable();
+        final StackTraceElement[] elements = t.getStackTrace();
+        final LogEvent event = new Log4jLogEvent("org.apache.logging.log4j.PatternParserTest", MarkerManager.getMarker("TEST"),
             Logger.class.getName(), Level.INFO, new SimpleMessage("Hello, world"), null,
             mdc, null, "Thread1", elements[0], System.currentTimeMillis());
-        StringBuilder buf = new StringBuilder();
-        for (PatternFormatter formatter : formatters) {
+        final StringBuilder buf = new StringBuilder();
+        for (final PatternFormatter formatter : formatters) {
             formatter.format(event, buf);
         }
-        String str = buf.toString();
-        String expected = "INFO  [PatternParserTest        :97  ] - Hello, world" + LINE_SEP;
+        final String str = buf.toString();
+        final String expected = "INFO  [PatternParserTest        :97  ] - Hello, world" + LINE_SEP;
         assertTrue("Expected to end with: " + expected + ". Actual: " + str, str.endsWith(expected));
     }
 
     @Test
     public void testNestedPattern() {
-        List<PatternFormatter> formatters = parser.parse(nestedPattern);
+        final List<PatternFormatter> formatters = parser.parse(nestedPattern);
         assertNotNull(formatters);
-        Throwable t = new Throwable();
-        StackTraceElement[] elements = t.getStackTrace();
-        LogEvent event = new Log4jLogEvent("org.apache.logging.log4j.PatternParserTest", MarkerManager.getMarker("TEST"),
+        final Throwable t = new Throwable();
+        final StackTraceElement[] elements = t.getStackTrace();
+        final LogEvent event = new Log4jLogEvent("org.apache.logging.log4j.PatternParserTest", MarkerManager.getMarker("TEST"),
                 Logger.class.getName(), Level.INFO, new SimpleMessage("Hello, world"), null, null, null, "Thread1", elements[0],
                 System.currentTimeMillis());
-        StringBuilder buf = new StringBuilder();
-        for (PatternFormatter formatter : formatters) {
+        final StringBuilder buf = new StringBuilder();
+        for (final PatternFormatter formatter : formatters) {
             formatter.format(event, buf);
         }
-        String str = buf.toString();
-        String expected = String.format("] INFO : Hello, world%s\u001B[m", LINE_SEP);
+        final String str = buf.toString();
+        final String expected = String.format("] INFO : Hello, world%s\u001B[m", LINE_SEP);
         assertTrue(" Expected to end with: " + expected + ". Actual: " + str, str.endsWith(expected));
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementConverterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementConverterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementConverterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementConverterTest.java Mon Dec 10 19:36:06 2012
@@ -36,14 +36,14 @@ public class RegexReplacementConverterTe
     @Test
     public void testReplacement() {
         ThreadContext.put("MyKey", "Apache");
-        LogEvent event = new Log4jLogEvent(RegexReplacementConverterTest.class.getName(), null, null,
+        final LogEvent event = new Log4jLogEvent(RegexReplacementConverterTest.class.getName(), null, null,
             Level.DEBUG, new SimpleMessage("This is a test"), null);
-        StringBuilder sb = new StringBuilder();
-        LoggerContext ctx = (LoggerContext) LogManager.getContext();
-        String[] options = new String[] {
+        final StringBuilder sb = new StringBuilder();
+        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
+        final String[] options = new String[] {
             "%logger %msg%n", "\\.", "/"
         };
-        RegexReplacementConverter converter = RegexReplacementConverter.newInstance(ctx.getConfiguration(),
+        final RegexReplacementConverter converter = RegexReplacementConverter.newInstance(ctx.getConfiguration(),
             options);
         converter.format(event, sb);
         assertEquals("org/apache/logging/log4j/core/pattern/RegexReplacementConverterTest This is a test" + LINE_SEP,

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RegexReplacementTest.java Mon Dec 10 19:36:06 2012
@@ -53,7 +53,7 @@ public class RegexReplacementTest {
         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();
             }
@@ -94,7 +94,7 @@ public class RegexReplacementTest {
      @Test
     public void testConverter() {
         logger2.error(this.getClass().getName());
-        List<String> msgs = app2.getMessages();
+        final List<String> msgs = app2.getMessages();
         assertNotNull(msgs);
         assertTrue("Incorrect number of messages. Should be 1 is " + msgs.size(), msgs.size() == 1);
          assertTrue("Replacement failed - expected ending " + EXPECTED + " Actual " + msgs.get(0), msgs.get(0).endsWith(EXPECTED));

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverterTest.java Mon Dec 10 19:36:06 2012
@@ -39,14 +39,14 @@ public class RootThrowablePatternConvert
 
     @Test
     public void testFull() {
-        RootThrowablePatternConverter converter = RootThrowablePatternConverter.newInstance(null);
-        Throwable cause = new NullPointerException("null pointer");
-        Throwable parent = new IllegalArgumentException("IllegalArgument", cause);
-        LogEvent event = new Log4jLogEvent("testLogger", null, this.getClass().getName(), Level.DEBUG,
+        final RootThrowablePatternConverter converter = RootThrowablePatternConverter.newInstance(null);
+        final Throwable cause = new NullPointerException("null pointer");
+        final Throwable parent = new IllegalArgumentException("IllegalArgument", cause);
+        final LogEvent event = new Log4jLogEvent("testLogger", null, this.getClass().getName(), Level.DEBUG,
             new SimpleMessage("test exception"), parent);
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         converter.format(event, sb);
-        String result = sb.toString();
+        final String result = sb.toString();
         //System.out.print(result);
         assertTrue("Missing Exception",
             result.contains("Wrapped by: java.lang.IllegalArgumentException: IllegalArgument"));

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RootThrowableTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RootThrowableTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RootThrowableTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/RootThrowableTest.java Mon Dec 10 19:36:06 2012
@@ -47,7 +47,7 @@ public class RootThrowableTest {
         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();
             }
@@ -65,10 +65,10 @@ public class RootThrowableTest {
 
     @Test
     public void testException() {
-        Throwable cause = new NullPointerException("null pointer");
-        Throwable parent = new IllegalArgumentException("IllegalArgument", cause);
+        final Throwable cause = new NullPointerException("null pointer");
+        final Throwable parent = new IllegalArgumentException("IllegalArgument", cause);
         logger.error("Exception", parent);
-        List<String> msgs = app.getMessages();
+        final List<String> msgs = app.getMessages();
         assertNotNull(msgs);
         assertTrue("Incorrect number of messages. Should be 1 is " + msgs.size(), msgs.size() == 1);
         assertTrue("No suppressed lines", msgs.get(0).contains("suppressed"));

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/StyleConverterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/StyleConverterTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/StyleConverterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/StyleConverterTest.java Mon Dec 10 19:36:06 2012
@@ -52,7 +52,7 @@ public class StyleConverterTest {
         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();
             }
@@ -73,7 +73,7 @@ public class StyleConverterTest {
     public void testReplacement() {
         logger.error(this.getClass().getName());
 
-        List<String> msgs = app.getMessages();
+        final List<String> msgs = app.getMessages();
         assertNotNull(msgs);
         assertTrue("Incorrect number of messages. Should be 1 is " + msgs.size(), msgs.size() == 1);
         assertTrue("Replacement failed - expected ending " + EXPECTED + ", actual " + msgs.get(0), msgs.get(0).endsWith(EXPECTED));

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/AbsoluteDateAndTimeFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/AbsoluteDateAndTimeFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/AbsoluteDateAndTimeFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/AbsoluteDateAndTimeFilter.java Mon Dec 10 19:36:06 2012
@@ -23,8 +23,8 @@ public class AbsoluteDateAndTimeFilter i
     
     private final Perl5Util util = new Perl5Util();
 
-    public String filter(String in) {
-        String pat = "/" + Filter.ABSOLUTE_DATE_AND_TIME_PAT + "/";
+    public String filter(final String in) {
+        final String pat = "/" + Filter.ABSOLUTE_DATE_AND_TIME_PAT + "/";
 
         if (util.match(pat, in)) {
             return util.substitute("s/" + Filter.ABSOLUTE_DATE_AND_TIME_PAT + "//", in);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/AbsoluteTimeFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/AbsoluteTimeFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/AbsoluteTimeFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/AbsoluteTimeFilter.java Mon Dec 10 19:36:06 2012
@@ -23,8 +23,8 @@ public class AbsoluteTimeFilter implemen
     
     private final Perl5Util util = new Perl5Util();
 
-    public String filter(String in) {
-        String pat = "/" + Filter.ABSOLUTE_TIME_PAT + "/";
+    public String filter(final String in) {
+        final String pat = "/" + Filter.ABSOLUTE_TIME_PAT + "/";
 
         if (util.match(pat, in)) {
             return util.substitute("s/" + Filter.ABSOLUTE_TIME_PAT + "//", in);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Compare.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Compare.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Compare.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Compare.java Mon Dec 10 19:36:06 2012
@@ -33,7 +33,7 @@ public class Compare {
     private static final InputStream open(
         final Class testClass,
         final String fileName) throws IOException {
-        String resourceName = fileName;
+        final String resourceName = fileName;
         /* if (fileName.startsWith("witness/")) {
            resourceName = fileName.substring(fileName.lastIndexOf('/') + 1);
        } */
@@ -42,7 +42,7 @@ public class Compare {
             is = testClass.getClassLoader().getResourceAsStream(resourceName);
         }
         if (is == null) {
-            File file = new File(fileName);
+            final File file = new File(fileName);
             if (file.exists()) {
                 is = new FileInputStream(file);
             } else {
@@ -53,12 +53,12 @@ public class Compare {
         return is;
     }
 
-    public static boolean compare(Class testClass,
+    public static boolean compare(final Class testClass,
                                   final String file1,
                                   final String file2)
         throws IOException {
-        BufferedReader in1 = new BufferedReader(new FileReader(file1));
-        BufferedReader in2 = new BufferedReader(new InputStreamReader(
+        final BufferedReader in1 = new BufferedReader(new FileReader(file1));
+        final BufferedReader in2 = new BufferedReader(new InputStreamReader(
             open(testClass, file2)));
         try {
             return compare(testClass, file1, file2, in1, in2);
@@ -69,7 +69,7 @@ public class Compare {
     }
 
     public static boolean compare(
-        Class testClass, String file1, String file2, BufferedReader in1, BufferedReader in2) throws IOException {
+        final Class testClass, final String file1, final String file2, final BufferedReader in1, final BufferedReader in2) throws IOException {
 
         String s1;
         int lineCounter = 0;
@@ -77,7 +77,7 @@ public class Compare {
         while ((s1 = in1.readLine()) != null) {
             lineCounter++;
 
-            String s2 = in2.readLine();
+            final String s2 = in2.readLine();
 
             if (!s1.equals(s2)) {
                 System.out.println(
@@ -108,10 +108,10 @@ public class Compare {
     /**
      * Prints file on the console.
      */
-    private static void outputFile(Class testClass, String file)
+    private static void outputFile(final Class testClass, final String file)
         throws IOException {
-        InputStream is = open(testClass, file);
-        BufferedReader in1 = new BufferedReader(new InputStreamReader(is));
+        final InputStream is = open(testClass, file);
+        final BufferedReader in1 = new BufferedReader(new InputStreamReader(is));
 
         String s1;
         int lineCounter = 0;

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/ControlFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/ControlFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/ControlFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/ControlFilter.java Mon Dec 10 19:36:06 2012
@@ -24,12 +24,12 @@ public class ControlFilter implements Fi
   Perl5Util util = new Perl5Util();
   String[] allowedPatterns;
 
-  public ControlFilter(String[] allowedPatterns) {
+  public ControlFilter(final String[] allowedPatterns) {
     this.allowedPatterns = allowedPatterns;
   }
 
-  public String filter(String in) throws UnexpectedFormatException {
-    int len = allowedPatterns.length;
+  public String filter(final String in) throws UnexpectedFormatException {
+    final int len = allowedPatterns.length;
 
     for (int i = 0; i < len; i++) {
       //System.out.println("["+allowedPatterns[i]+"]");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/ISO8601Filter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/ISO8601Filter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/ISO8601Filter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/ISO8601Filter.java Mon Dec 10 19:36:06 2012
@@ -23,8 +23,8 @@ import org.apache.oro.text.perl.Perl5Uti
 public class ISO8601Filter implements Filter {
   Perl5Util util = new Perl5Util();
 
-  public String filter(String in) {
-    String pat = "/" + ISO8601_PAT + "/";
+  public String filter(final String in) {
+    final String pat = "/" + ISO8601_PAT + "/";
 
     if (util.match(pat, in)) {
       return util.substitute("s/" + ISO8601_PAT + "//", in);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/JunitTestRunnerFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/JunitTestRunnerFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/JunitTestRunnerFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/JunitTestRunnerFilter.java Mon Dec 10 19:36:06 2012
@@ -35,7 +35,7 @@ public class JunitTestRunnerFilter imple
   /**
    * Filter out stack trace lines coming from the various JUnit TestRunners.
    */
-  public String filter(String in) {
+  public String filter(final String in) {
     if (in == null) {
       return null;
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/LineNumberFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/LineNumberFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/LineNumberFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/LineNumberFilter.java Mon Dec 10 19:36:06 2012
@@ -23,7 +23,7 @@ import org.apache.oro.text.perl.Perl5Uti
 public class LineNumberFilter implements Filter {
   Perl5Util util = new Perl5Util();
 
-  public String filter(String in) {
+  public String filter(final String in) {
     if (util.match("/\\(.*:\\d{1,4}\\)/", in)) {
       return util.substitute("s/\\(.*:\\d{1,4}\\)/\\(X\\)/", in);
     } else if (util.match("/\\(Native Method\\)/", in)) {

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/MDCOrderFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/MDCOrderFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/MDCOrderFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/MDCOrderFilter.java Mon Dec 10 19:36:06 2012
@@ -51,7 +51,7 @@ public class MDCOrderFilter implements F
     }
 
     for(int i = 0; i < patterns.length; i++) {
-        int ipos = in.indexOf(patterns[i]);
+        final int ipos = in.indexOf(patterns[i]);
         if (ipos >= 1) {
             return in.substring(0, ipos)
                     + replacements[i]

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Profiler.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Profiler.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Profiler.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Profiler.java Mon Dec 10 19:36:06 2012
@@ -32,12 +32,12 @@ public class Profiler {
             profilingModes = Class.forName("com.yourkit.api.ProfilingModes");
             try {
                 profiler = controllerClazz.newInstance();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
                 System.out.println("Profiler was active, but failed due: " + e.getMessage());
             }
         }
-        catch (Exception e) {
+        catch (final Exception e) {
             // Ignore
         }
 
@@ -51,14 +51,14 @@ public class Profiler {
 
         if (profiler != null) {
             try {
-                Field f = profilingModes.getDeclaredField("CPU_SAMPLING");
-                Object[] args = new Object[2];
+                final Field f = profilingModes.getDeclaredField("CPU_SAMPLING");
+                final Object[] args = new Object[2];
                 args[0] = f.getLong(profilingModes);
                 args[1] = "";
-                Class[] parms = new Class[] {long.class, String.class};
+                final Class[] parms = new Class[] {long.class, String.class};
                 controllerClazz.getMethod("startCPUProfiling", parms).invoke(profiler, args);
             }
-            catch (Exception e) {
+            catch (final Exception e) {
                 e.printStackTrace();
                 System.out.println("Profiler was active, but failed due: " + e.getMessage());
             }
@@ -68,14 +68,14 @@ public class Profiler {
     public static void stop() {
         if (profiler != null) {
             try {
-                Field f = profilingModes.getDeclaredField("SNAPSHOT_WITHOUT_HEAP");
-                Object[] args = new Object[1];
+                final Field f = profilingModes.getDeclaredField("SNAPSHOT_WITHOUT_HEAP");
+                final Object[] args = new Object[1];
                 args[0] = f.getLong(profilingModes);
-                Class[] parms = new Class[] {long.class};
+                final Class[] parms = new Class[] {long.class};
                 profiler.getClass().getMethod("captureSnapshot", parms).invoke(profiler, args);
                 profiler.getClass().getMethod("stopCPUProfiling").invoke(profiler);
             }
-            catch (Exception e) {
+            catch (final Exception e) {
                 e.printStackTrace();
                 System.out.println("Profiler was active, but failed due: " + e.getMessage());
             }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/RelativeTimeFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/RelativeTimeFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/RelativeTimeFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/RelativeTimeFilter.java Mon Dec 10 19:36:06 2012
@@ -23,8 +23,8 @@ import org.apache.oro.text.perl.Perl5Uti
 public class RelativeTimeFilter implements Filter {
   Perl5Util util = new Perl5Util();
 
-  public String filter(String in) {
-    String pat = "/" + Filter.RELATIVE_TIME_PAT + "/";
+  public String filter(final String in) {
+    final String pat = "/" + Filter.RELATIVE_TIME_PAT + "/";
 
     if (util.match(pat, in)) {
       //System.out.println("Removing relative time from line ["+in+"]");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/SunReflectFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/SunReflectFilter.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/SunReflectFilter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/SunReflectFilter.java Mon Dec 10 19:36:06 2012
@@ -27,7 +27,7 @@ import org.apache.oro.text.perl.Perl5Uti
 public class SunReflectFilter implements Filter {
   Perl5Util util = new Perl5Util();
 
-  public String filter(String in) {
+  public String filter(final String in) {
     if(in == null) {
       return null;
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Transformer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Transformer.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Transformer.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/Transformer.java Mon Dec 10 19:36:06 2012
@@ -28,13 +28,13 @@ public class Transformer {
 
   public
   static
-  void transform(String in, String out, Filter[] filters) throws FileNotFoundException,
+  void transform(final String in, final String out, final Filter[] filters) throws FileNotFoundException,
                                                                  IOException,
                                                                  UnexpectedFormatException {
 
     String line;
-    BufferedReader input = new BufferedReader(new FileReader(in));
-    PrintStream output = new PrintStream(new FileOutputStream(out, false));
+    final BufferedReader input = new BufferedReader(new FileReader(in));
+    final PrintStream output = new PrintStream(new FileOutputStream(out, false));
 
     try {
       // Initialization of input and output omitted
@@ -57,13 +57,13 @@ public class Transformer {
 
   public
   static
-  void transform(String in, String out, Filter filter) throws FileNotFoundException,
+  void transform(final String in, final String out, final Filter filter) throws FileNotFoundException,
                                                               IOException,
                                                               UnexpectedFormatException {
 
     String line;
-    BufferedReader input = new BufferedReader(new FileReader(in));
-    PrintStream output = new PrintStream(new FileOutputStream(out));
+    final BufferedReader input = new BufferedReader(new FileReader(in));
+    final PrintStream output = new PrintStream(new FileOutputStream(out));
 
     try {
       // Initialization of input and output omitted

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/UnexpectedFormatException.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/UnexpectedFormatException.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/UnexpectedFormatException.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/util/UnexpectedFormatException.java Mon Dec 10 19:36:06 2012
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.core.ut
 
 public class UnexpectedFormatException extends Exception {
 
-  public UnexpectedFormatException(String msg) {
+  public UnexpectedFormatException(final String msg) {
     super(msg);
   }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java Mon Dec 10 19:36:06 2012
@@ -29,16 +29,16 @@ import org.apache.logging.log4j.core.con
 @Plugin(name="AlwaysFail",type="Core",elementType="appender",printObject=true)
 public class AlwaysFailAppender extends AbstractAppender {
 
-    private AlwaysFailAppender(String name) {
+    private AlwaysFailAppender(final String name) {
         super(name, null, null, false);
     }
 
-    public void append(LogEvent event) {
+    public void append(final LogEvent event) {
         throw new LoggingException("Always fail");
     }
 
     @PluginFactory
-    public static AlwaysFailAppender createAppender(@PluginAttr("name") String name) {
+    public static AlwaysFailAppender createAppender(@PluginAttr("name") final String name) {
         if (name == null) {
             LOGGER.error("A name for the Appender must be specified");
             return null;

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/appender/InMemoryAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/appender/InMemoryAppender.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/appender/InMemoryAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/appender/InMemoryAppender.java Mon Dec 10 19:36:06 2012
@@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream;
  */
 public class InMemoryAppender extends AbstractOutputStreamAppender {
 
-    public InMemoryAppender(String name, Layout layout, CompositeFilter filters, boolean handleException) {
+    public InMemoryAppender(final String name, final Layout layout, final CompositeFilter filters, final boolean handleException) {
         super(name, layout, filters, handleException, true, new InMemoryManager(name));
     }
 
@@ -39,7 +39,7 @@ public class InMemoryAppender extends Ab
 
     private static class InMemoryManager extends OutputStreamManager {
 
-        public InMemoryManager(String name) {
+        public InMemoryManager(final String name) {
             super(new ByteArrayOutputStream(), name);
         }
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java Mon Dec 10 19:36:06 2012
@@ -37,11 +37,11 @@ import java.util.List;
 @Plugin(name = "List", type = "Core", elementType = "appender", printObject = true)
 public class ListAppender extends AbstractAppender {
 
-    private List<LogEvent> events = new ArrayList<LogEvent>();
+    private final List<LogEvent> events = new ArrayList<LogEvent>();
 
-    private List<String> messages = new ArrayList<String>();
+    private final List<String> messages = new ArrayList<String>();
 
-    private List<byte[]> data = new ArrayList<byte[]>();
+    private final List<byte[]> data = new ArrayList<byte[]>();
 
     private final boolean newLine;
 
@@ -49,32 +49,32 @@ public class ListAppender extends Abstra
 
     private static final String WINDOWS_LINE_SEP = "\r\n";
 
-    public ListAppender(String name) {
+    public ListAppender(final String name) {
         super(name, null, null);
         newLine = false;
         raw = false;
     }
 
-    public ListAppender(String name, Filter filter, Layout layout, boolean newline, boolean raw) {
+    public ListAppender(final String name, final Filter filter, final Layout layout, final boolean newline, final boolean raw) {
         super(name, filter, layout);
         this.newLine = newline;
         this.raw = raw;
         if (layout != null && !(layout instanceof SerializedLayout)) {
-            byte[] bytes = layout.getHeader();
+            final byte[] bytes = layout.getHeader();
             if (bytes != null) {
                 write(bytes);
             }
         }
     }
 
-    public synchronized void append(LogEvent event) {
-        Layout layout = getLayout();
+    public synchronized void append(final LogEvent event) {
+        final Layout layout = getLayout();
         if (layout == null) {
             events.add(event);
         } else if (layout instanceof SerializedLayout) {
-            byte[] header = layout.getHeader();
-            byte[] content = layout.toByteArray(event);
-            byte[] record = new byte[header.length + content.length];
+            final byte[] header = layout.getHeader();
+            final byte[] content = layout.toByteArray(event);
+            final byte[] record = new byte[header.length + content.length];
             System.arraycopy(header, 0, record, 0, header.length);
             System.arraycopy(content, 0, record, header.length, content.length);
             data.add(record);
@@ -83,18 +83,18 @@ public class ListAppender extends Abstra
         }
     }
 
-    private void write(byte[] bytes) {
+    private void write(final byte[] bytes) {
         if (raw) {
             data.add(bytes);
             return;
         }
-        String str = new String(bytes);
+        final String str = new String(bytes);
         if (newLine) {
             int index = 0;
             while (index < str.length()) {
                 int end;
-                int wend = str.indexOf(WINDOWS_LINE_SEP, index);
-                int lend = str.indexOf("\n", index);
+                final int wend = str.indexOf(WINDOWS_LINE_SEP, index);
+                final int lend = str.indexOf("\n", index);
                 int length;
                 if (wend >= 0 && wend < lend) {
                     end = wend;
@@ -123,9 +123,9 @@ public class ListAppender extends Abstra
     @Override
     public void stop() {
         super.stop();
-        Layout layout = getLayout();
+        final Layout layout = getLayout();
         if (layout != null) {
-            byte[] bytes = layout.getFooter();
+            final byte[] bytes = layout.getFooter();
             if (bytes != null) {
                 write(bytes);
             }
@@ -151,19 +151,19 @@ public class ListAppender extends Abstra
     }
 
     @PluginFactory
-    public static ListAppender createAppender(@PluginAttr("name") String name,
-                                              @PluginAttr("entryPerNewLine") String newLine,
-                                              @PluginAttr("raw") String raw,
-                                              @PluginElement("layout") Layout layout,
-                                              @PluginElement("filters") Filter filter) {
+    public static ListAppender createAppender(@PluginAttr("name") final String name,
+                                              @PluginAttr("entryPerNewLine") final String newLine,
+                                              @PluginAttr("raw") final String raw,
+                                              @PluginElement("layout") final Layout layout,
+                                              @PluginElement("filters") final Filter filter) {
 
         if (name == null) {
             LOGGER.error("No name provided for ListAppender");
             return null;
         }
 
-        boolean nl = (newLine == null) ? false : Boolean.parseBoolean(newLine);
-        boolean r = (raw == null) ? false : Boolean.parseBoolean(raw);
+        final boolean nl = (newLine == null) ? false : Boolean.parseBoolean(newLine);
+        final boolean r = (raw == null) ? false : Boolean.parseBoolean(raw);
 
         return new ListAppender(name, filter, layout, nl, r);
     }

Modified: logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/AbstractFlumeManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/AbstractFlumeManager.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/AbstractFlumeManager.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/AbstractFlumeManager.java Mon Dec 10 19:36:06 2012
@@ -23,7 +23,7 @@ import org.apache.logging.log4j.core.app
  */
 public abstract class AbstractFlumeManager extends AbstractManager {
 
-    public AbstractFlumeManager(String name) {
+    public AbstractFlumeManager(final String name) {
         super(name);
     }
 

Modified: logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/Agent.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/Agent.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/Agent.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/Agent.java Mon Dec 10 19:36:06 2012
@@ -38,7 +38,7 @@ public final class Agent {
 
     private final int port;
 
-    private Agent(String host, int port) {
+    private Agent(final String host, final int port) {
         this.host = host;
         this.port = port;
     }
@@ -72,7 +72,7 @@ public final class Agent {
      */
     @PluginFactory
     public static Agent createAgent(@PluginAttr("host") String host,
-                                    @PluginAttr("port") String port) {
+                                    @PluginAttr("port") final String port) {
         if (host == null) {
             host = DEFAULT_HOST;
         }
@@ -81,7 +81,7 @@ public final class Agent {
         if (port != null) {
             try {
                 portNum = Integer.parseInt(port);
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 LOGGER.error("Error parsing port number " + port, ex);
                 return null;
             }



Mime
View raw message