logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1501104 [5/5] - in /logging/log4j/log4j2/trunk: api/src/main/java/org/apache/logging/log4j/ api/src/main/java/org/apache/logging/log4j/message/ api/src/main/java/org/apache/logging/log4j/simple/ api/src/main/java/org/apache/logging/log4j/s...
Date Tue, 09 Jul 2013 06:08:28 GMT
Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CachedClockTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CachedClockTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CachedClockTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CachedClockTest.java Tue Jul  9 06:08:25 2013
@@ -25,10 +25,10 @@ public class CachedClockTest {
 
     @Test
     public void testLessThan17Millis() {
-        long millis1 = CachedClock.instance().currentTimeMillis();
-        long sysMillis = System.currentTimeMillis();
+        final long millis1 = CachedClock.instance().currentTimeMillis();
+        final long sysMillis = System.currentTimeMillis();
 
-        long diff = sysMillis - millis1;
+        final long diff = sysMillis - millis1;
 
         assertTrue("diff too large: " + diff, diff <= 16);
     }
@@ -36,10 +36,10 @@ public class CachedClockTest {
     @Test
     public void testAfterWaitStillLessThan17Millis() throws Exception {
         Thread.sleep(100);
-        long millis1 = CachedClock.instance().currentTimeMillis();
-        long sysMillis = System.currentTimeMillis();
+        final long millis1 = CachedClock.instance().currentTimeMillis();
+        final long sysMillis = System.currentTimeMillis();
 
-        long diff = sysMillis - millis1;
+        final long diff = sysMillis - millis1;
 
         assertTrue("diff too large: " + diff, diff <= 16);
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CharsetsTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CharsetsTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CharsetsTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/CharsetsTest.java Tue Jul  9 06:08:25 2013
@@ -28,19 +28,19 @@ public class CharsetsTest {
 
     @Test
     public void testReturnDefaultIfNameIsNull() {
-        Charset actual = Charsets.getSupportedCharset(null);
+        final Charset actual = Charsets.getSupportedCharset(null);
         assertSame(Charset.defaultCharset(), actual);
     }
 
     @Test
     public void testReturnDefaultIfNameIsUnsupported() {
-        Charset actual = Charsets.getSupportedCharset("INeedMoreSupport");
+        final Charset actual = Charsets.getSupportedCharset("INeedMoreSupport");
         assertSame(Charset.defaultCharset(), actual);
     }
 
     @Test(expected = IllegalCharsetNameException.class)
     public void testThrowsExceptionIfNameIsIllegal() {
-        Charset actual = Charsets.getSupportedCharset("spaces not allowed");
+        final Charset actual = Charsets.getSupportedCharset("spaces not allowed");
         assertSame(Charset.defaultCharset(), actual);
     }
 
@@ -48,16 +48,16 @@ public class CharsetsTest {
     public void testReturnRequestedCharsetIfSupported() {
         // See http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html
         // for a list of required charsets.
-        Charset actual1 = Charsets.getSupportedCharset("UTF-8");
+        final Charset actual1 = Charsets.getSupportedCharset("UTF-8");
         assertSame(Charset.forName("UTF-8"), actual1);
 
-        Charset actual2 = Charsets.getSupportedCharset("ISO-8859-1");
+        final Charset actual2 = Charsets.getSupportedCharset("ISO-8859-1");
         assertSame(Charset.forName("ISO-8859-1"), actual2);
 
         // This part of the test is NOT portable across all Java platforms.
         // There is no guarantee that KOI8-R is on any given platform
         if (Charset.isSupported("KOI8-R")) {
-            Charset actual3 = Charsets.getSupportedCharset("KOI8-R");
+            final Charset actual3 = Charsets.getSupportedCharset("KOI8-R");
             assertSame(Charset.forName("KOI8-R"), actual3);
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/SystemClockTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/SystemClockTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/SystemClockTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/helpers/SystemClockTest.java Tue Jul  9 06:08:25 2013
@@ -25,10 +25,10 @@ public class SystemClockTest {
 
     @Test
     public void testLessThan2Millis() {
-        long millis1 = new SystemClock().currentTimeMillis();
-        long sysMillis = System.currentTimeMillis();
+        final long millis1 = new SystemClock().currentTimeMillis();
+        final long sysMillis = System.currentTimeMillis();
 
-        long diff = sysMillis - millis1;
+        final long diff = sysMillis - millis1;
 
         assertTrue("diff too large: " + diff, diff <= 1);
     }
@@ -36,10 +36,10 @@ public class SystemClockTest {
     @Test
     public void testAfterWaitStillLessThan2Millis() throws Exception {
         Thread.sleep(100);
-        long millis1 = new SystemClock().currentTimeMillis();
-        long sysMillis = System.currentTimeMillis();
+        final long millis1 = new SystemClock().currentTimeMillis();
+        final long sysMillis = System.currentTimeMillis();
 
-        long diff = sysMillis - millis1;
+        final long diff = sysMillis - millis1;
 
         assertTrue("diff too large: " + diff, diff <= 1);
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java Tue Jul  9 06:08:25 2013
@@ -31,16 +31,16 @@ public class Log4jLogEventTest {
 
     @Test
     public void testJavaIoSerializable() throws Exception {
-        Log4jLogEvent evt = new Log4jLogEvent("some.test", null, "",
+        final Log4jLogEvent evt = new Log4jLogEvent("some.test", null, "",
                 Level.INFO, new SimpleMessage("abc"), null);
         
-        ByteArrayOutputStream arr = new ByteArrayOutputStream();
-        ObjectOutputStream out = new ObjectOutputStream(arr);
+        final ByteArrayOutputStream arr = new ByteArrayOutputStream();
+        final ObjectOutputStream out = new ObjectOutputStream(arr);
         out.writeObject(evt);
         
-        ByteArrayInputStream inArr = new ByteArrayInputStream(arr.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(inArr);
-        Log4jLogEvent evt2 = (Log4jLogEvent) in.readObject();
+        final ByteArrayInputStream inArr = new ByteArrayInputStream(arr.toByteArray());
+        final ObjectInputStream in = new ObjectInputStream(inArr);
+        final Log4jLogEvent evt2 = (Log4jLogEvent) in.readObject();
         
         assertEquals(evt.getMillis(), evt2.getMillis());
         assertEquals(evt.getFQCN(), evt2.getFQCN());

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/impl/ThrowableProxyTest.java Tue Jul  9 06:08:25 2013
@@ -32,9 +32,9 @@ public class ThrowableProxyTest {
     public void testStack() {
         final Map<String, ThrowableProxy.CacheEntry> map = new HashMap<String, ThrowableProxy.CacheEntry>();
         final Stack<Class<?>> stack = new Stack<Class<?>>();
-        Throwable throwable = new IllegalStateException("This is a test");
-        ThrowableProxy proxy = new ThrowableProxy(throwable);
-        StackTracePackageElement[] callerPackageData = proxy.resolvePackageData(stack, map, null,
+        final Throwable throwable = new IllegalStateException("This is a test");
+        final ThrowableProxy proxy = new ThrowableProxy(throwable);
+        final StackTracePackageElement[] callerPackageData = proxy.resolvePackageData(stack, map, null,
             throwable.getStackTrace());
         Assert.assertNotNull("No package data returned", callerPackageData);;
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/RFC5424LayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/RFC5424LayoutTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/RFC5424LayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/RFC5424LayoutTest.java Tue Jul  9 06:08:25 2013
@@ -247,7 +247,7 @@ public class RFC5424LayoutTest {
             root.removeAppender(appender);
         }
         
-        LoggerFields loggerFields = LoggerFields.createLoggerFields(new KeyValuePair[] {
+        final LoggerFields loggerFields = LoggerFields.createLoggerFields(new KeyValuePair[] {
         		new KeyValuePair("source", "%C.%M")
         });
         

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/DateLookupTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/DateLookupTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/DateLookupTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/lookup/DateLookupTest.java Tue Jul  9 06:08:25 2013
@@ -112,7 +112,7 @@ public class DateLookupTest {
         }
 
         @Override
-        public void setEndOfBatch(boolean endOfBatch) {
+        public void setEndOfBatch(final boolean endOfBatch) {
         }
 
         @Override
@@ -121,7 +121,7 @@ public class DateLookupTest {
         }
 
         @Override
-        public void setIncludeLocation(boolean locationRequired) {
+        public void setIncludeLocation(final boolean locationRequired) {
         }
     }
 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/AbstractSocketServerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/AbstractSocketServerTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/AbstractSocketServerTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/AbstractSocketServerTest.java Tue Jul  9 06:08:25 2013
@@ -95,7 +95,7 @@ public abstract class AbstractSocketServ
             try {
                 testServer(m1, m2);
 
-            } catch (AppenderRuntimeException are) {
+            } catch (final AppenderRuntimeException are) {
                 assertTrue("", are.getCause() != null && are.getCause() instanceof IOException);
                 // Failure expected.
             }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java Tue Jul  9 06:08:25 2013
@@ -52,7 +52,7 @@ public class SocketReconnectTest {
     @Test
     public void testReconnect() throws Exception {
 
-        List<String> list = new ArrayList<String>();
+        final List<String> list = new ArrayList<String>();
         TestSocketServer server = new TestSocketServer(list);
         server.start();
         Thread.sleep(300);
@@ -62,7 +62,7 @@ public class SocketReconnectTest {
 
         String message = "Log #1";
         logger.error(message);
-        String expectedHeader = "Header";
+        final String expectedHeader = "Header";
 
         String msg = null;
         String header = null;
@@ -126,10 +126,10 @@ public class SocketReconnectTest {
 
     private static class TestSocketServer extends Thread {
         private volatile boolean shutdown = false;
-        private List<String> list;
+        private final List<String> list;
         private Socket client;
 
-        public TestSocketServer(List<String> list) {
+        public TestSocketServer(final List<String> list) {
             this.list = list;
         }
 
@@ -141,28 +141,28 @@ public class SocketReconnectTest {
                 server = new ServerSocket(SOCKET_PORT);
                 client = server.accept();
                 while (!shutdown) {
-                    BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream()));
-                    String line = reader.readLine();
+                    final BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream()));
+                    final String line = reader.readLine();
                     if (line.equals("Shutdown")) {
                         shutdown = true;
                     } else {
                         list.add(line);
                     }
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 ex.printStackTrace();
             } finally {
                 if (client != null) {
                     try {
                         client.close();
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         System.out.println("Unable to close socket " + ex.getMessage());
                     }
                 }
                 if (server != null) {
                     try {
                         server.close();
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         System.out.println("Unable to close server socket " + ex.getMessage());
                     }
                 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jServletContainerInitializerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jServletContainerInitializerTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jServletContainerInitializerTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jServletContainerInitializerTest.java Tue Jul  9 06:08:25 2013
@@ -54,10 +54,10 @@ public class Log4jServletContainerInitia
 
     @Test
     public void testOnStartup() throws Exception {
-        FilterRegistration.Dynamic registration = createStrictMock(FilterRegistration.Dynamic.class);
+        final FilterRegistration.Dynamic registration = createStrictMock(FilterRegistration.Dynamic.class);
 
-        Capture<EventListener> listenerCapture = new Capture<EventListener>();
-        Capture<Filter> filterCapture = new Capture<Filter>();
+        final Capture<EventListener> listenerCapture = new Capture<EventListener>();
+        final Capture<Filter> filterCapture = new Capture<Filter>();
 
         this.servletContext.log(anyObject(String.class));
         expectLastCall();
@@ -81,7 +81,7 @@ public class Log4jServletContainerInitia
 
     @Test
     public void testOnStartupFailed() throws Exception {
-        UnavailableException exception = new UnavailableException("");
+        final UnavailableException exception = new UnavailableException("");
 
         this.servletContext.log(anyObject(String.class));
         expectLastCall();
@@ -94,7 +94,7 @@ public class Log4jServletContainerInitia
         try {
             this.containerInitializer.onStartup(null, this.servletContext);
             fail("");
-        } catch (UnavailableException e) {
+        } catch (final UnavailableException e) {
             assertSame("The exception is not correct.", exception, e);
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jServletContextListenerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jServletContextListenerTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jServletContextListenerTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jServletContextListenerTest.java Tue Jul  9 06:08:25 2013
@@ -93,7 +93,7 @@ public class Log4jServletContextListener
         try {
             this.listener.contextInitialized(this.event);
             fail("Expected a RuntimeException.");
-        } catch (RuntimeException e) {
+        } catch (final RuntimeException e) {
             assertEquals("The message is not correct.", "Failed to initialize Log4j properly.", e.getMessage());
         }
     }
@@ -105,7 +105,7 @@ public class Log4jServletContextListener
         try {
             this.listener.contextDestroyed(this.event);
             fail("Expected an IllegalStateException.");
-        } catch (IllegalStateException ignore) {
+        } catch (final IllegalStateException ignore) {
 
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jServletFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jServletFilterTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jServletFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jServletFilterTest.java Tue Jul  9 06:08:25 2013
@@ -98,9 +98,9 @@ public class Log4jServletFilterTest {
         verify(this.filterConfig, this.servletContext, this.initializer);
         reset(this.filterConfig, this.servletContext, this.initializer);
 
-        ServletRequest request = createStrictMock(ServletRequest.class);
-        ServletResponse response = createStrictMock(ServletResponse.class);
-        FilterChain chain = createStrictMock(FilterChain.class);
+        final ServletRequest request = createStrictMock(ServletRequest.class);
+        final ServletResponse response = createStrictMock(ServletResponse.class);
+        final FilterChain chain = createStrictMock(FilterChain.class);
 
         expect(request.getAttribute(Log4jServletFilter.ALREADY_FILTERED_ATTRIBUTE)).andReturn(null);
         request.setAttribute(eq(Log4jServletFilter.ALREADY_FILTERED_ATTRIBUTE), eq(Boolean.TRUE));
@@ -135,9 +135,9 @@ public class Log4jServletFilterTest {
         verify(this.filterConfig, this.servletContext, this.initializer);
         reset(this.filterConfig, this.servletContext, this.initializer);
 
-        ServletRequest request = createStrictMock(ServletRequest.class);
-        ServletResponse response = createStrictMock(ServletResponse.class);
-        FilterChain chain = createStrictMock(FilterChain.class);
+        final ServletRequest request = createStrictMock(ServletRequest.class);
+        final ServletResponse response = createStrictMock(ServletResponse.class);
+        final FilterChain chain = createStrictMock(FilterChain.class);
 
         expect(request.getAttribute(Log4jServletFilter.ALREADY_FILTERED_ATTRIBUTE)).andReturn(true);
         expectLastCall();

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jWebInitializerImplTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jWebInitializerImplTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jWebInitializerImplTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/web/Log4jWebInitializerImplTest.java Tue Jul  9 06:08:25 2013
@@ -36,7 +36,7 @@ public class Log4jWebInitializerImplTest
 
     @Before
     public void setUp() {
-        Capture<Log4jWebInitializer> initializerCapture = new Capture<Log4jWebInitializer>();
+        final Capture<Log4jWebInitializer> initializerCapture = new Capture<Log4jWebInitializer>();
 
         this.servletContext = createStrictMock(ServletContext.class);
         expect(this.servletContext.getAttribute(Log4jWebInitializer.INITIALIZER_ATTRIBUTE)).andReturn(null);
@@ -45,7 +45,7 @@ public class Log4jWebInitializerImplTest
 
         replay(this.servletContext);
 
-        Log4jWebInitializer initializer = Log4jWebInitializerImpl.getLog4jWebInitializer(this.servletContext);
+        final Log4jWebInitializer initializer = Log4jWebInitializerImpl.getLog4jWebInitializer(this.servletContext);
 
         assertNotNull("The initializer should not be null.", initializer);
         assertSame("The capture is not correct.", initializer, initializerCapture.getValue());
@@ -68,7 +68,7 @@ public class Log4jWebInitializerImplTest
         try {
             this.initializer.deinitialize();
             fail("Expected an IllegalStateException.");
-        } catch (IllegalStateException ignore) {
+        } catch (final IllegalStateException ignore) {
 
         }
     }
@@ -117,7 +117,7 @@ public class Log4jWebInitializerImplTest
 
         this.initializer.setLoggerContext();
 
-        LoggerContext context = ContextAnchor.THREAD_CONTEXT.get();
+        final LoggerContext context = ContextAnchor.THREAD_CONTEXT.get();
         assertNotNull("The context should not be null.", context);
 
         this.initializer.clearLoggerContext();
@@ -168,7 +168,7 @@ public class Log4jWebInitializerImplTest
 
         this.initializer.setLoggerContext();
 
-        LoggerContext context = ContextAnchor.THREAD_CONTEXT.get();
+        final LoggerContext context = ContextAnchor.THREAD_CONTEXT.get();
         assertNotNull("The context should not be null.", context);
 
         this.initializer.clearLoggerContext();
@@ -258,7 +258,7 @@ public class Log4jWebInitializerImplTest
         try {
             this.initializer.initialize();
             fail("Expected an IllegalStateException.");
-        } catch (IllegalStateException ignore) {
+        } catch (final IllegalStateException ignore) {
 
         }
     }
@@ -305,7 +305,7 @@ public class Log4jWebInitializerImplTest
         try {
             this.initializer.initialize();
             fail("Expected an UnavailableException.");
-        } catch (UnavailableException ignore) {
+        } catch (final UnavailableException ignore) {
 
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/layout/BasicLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/layout/BasicLayout.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/layout/BasicLayout.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/test/layout/BasicLayout.java Tue Jul  9 06:08:25 2013
@@ -45,7 +45,7 @@ public class BasicLayout extends Abstrac
     }
 
     @Override
-    public String toSerializable(LogEvent event) {
+    public String toSerializable(final LogEvent event) {
         return event.getMessage().getFormattedMessage() + Constants.LINE_SEP;
     }
 

Modified: logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/BatchEvent.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/BatchEvent.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/BatchEvent.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/BatchEvent.java Tue Jul  9 06:08:25 2013
@@ -26,9 +26,9 @@ import org.apache.flume.Event;
  */
 public class BatchEvent {
 
-    private List<Event> events = new ArrayList<Event>();
+    private final List<Event> events = new ArrayList<Event>();
 
-    public void addEvent(Event event) {
+    public void addEvent(final Event event) {
         events.add(event);
     }
 

Modified: logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java Tue Jul  9 06:08:25 2013
@@ -60,7 +60,7 @@ public final class FlumeAppender<T exten
     private enum ManagerType {
         AVRO, EMBEDDED, PERSISTENT;
 
-        public static ManagerType getType(String type) {
+        public static ManagerType getType(final String type) {
             return valueOf(type.toUpperCase(Locale.US));
         }
     }
@@ -86,9 +86,9 @@ public final class FlumeAppender<T exten
      */
     @Override
     public void append(final LogEvent event) {
-        String name = event.getLoggerName();
+        final String name = event.getLoggerName();
         if (name != null) {
-            for (String pkg : EXCLUDED_PACKAGES) {
+            for (final String pkg : EXCLUDED_PACKAGES) {
                 if (name.startsWith(pkg)) {
                     return;
                 }
@@ -187,7 +187,7 @@ public final class FlumeAppender<T exten
                 try {
                     managerType = ManagerType.getType(type);
                     LOGGER.warn("Embedded and type attributes are mutually exclusive. Using type " + type);
-                } catch (Exception ex) {
+                } catch (final Exception ex) {
                     LOGGER.warn("Embedded and type attributes are mutually exclusive and type " + type +
                         " is invalid.");
                     managerType = ManagerType.EMBEDDED;
@@ -195,7 +195,7 @@ public final class FlumeAppender<T exten
             } else {
                 try {
                     managerType = ManagerType.getType(type);
-                } catch (Exception ex) {
+                } catch (final Exception ex) {
                     LOGGER.warn("Type " + type + " is invalid.");
                     managerType = ManagerType.EMBEDDED;
                 }
@@ -214,6 +214,7 @@ public final class FlumeAppender<T exten
 
         if (layout == null) {
             @SuppressWarnings({ "unchecked", "UnnecessaryLocalVariable" })
+			final
             Layout<S> l = (Layout<S>) RFC5424Layout.createLayout(null, null, null, "True", null, mdcPrefix, eventPrefix,
                     null, null, null, excludes, includes, required, null, null, null, null);
             layout = l;

Modified: logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java Tue Jul  9 06:08:25 2013
@@ -44,7 +44,7 @@ public class FlumeAvroManager extends Ab
 
     private final int requestTimeout;
 
-    private int current = 0;
+    private final int current = 0;
 
     private RpcClient rpcClient = null;
 
@@ -143,13 +143,13 @@ public class FlumeAvroManager extends Ab
             } catch (final Exception ex) {
                 rpcClient.close();
                 rpcClient = null;
-                String msg = "Unable to write to " + getName() + " at " + agents[current].getHost() + ":" +
+                final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost() + ":" +
                     agents[current].getPort();
                 LOGGER.warn(msg, ex);
                 throw new AppenderRuntimeException("No Flume agents are available");
             }
         }  else {
-            String msg = "Unable to write to " + getName() + " at " + agents[current].getHost() + ":" +
+            final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost() + ":" +
                 agents[current].getPort();
             LOGGER.warn(msg);
             throw new AppenderRuntimeException("No Flume agents are available");
@@ -168,13 +168,13 @@ public class FlumeAvroManager extends Ab
             } catch (final Exception ex) {
                 rpcClient.close();
                 rpcClient = null;
-                String msg = "Unable to write to " + getName() + " at " + agents[current].getHost() + ":" +
+                final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost() + ":" +
                     agents[current].getPort();
                 LOGGER.warn(msg, ex);
                 throw new AppenderRuntimeException("No Flume agents are available");
             }
         } else {
-            String msg = "Unable to write to " + getName() + " at " + agents[current].getHost() + ":" +
+            final String msg = "Unable to write to " + getName() + " at " + agents[current].getHost() + ":" +
                 agents[current].getPort();
             LOGGER.warn(msg);
             throw new AppenderRuntimeException("No Flume agents are available");
@@ -187,19 +187,19 @@ public class FlumeAvroManager extends Ab
      * @return The FlumeEventAvroServer.
      */
 
-    private RpcClient connect(final Agent[] agents, int retries, int connectTimeout, int requestTimeout) {
+    private RpcClient connect(final Agent[] agents, int retries, final int connectTimeout, final int requestTimeout) {
         try {
-            Properties props = new Properties();
+            final Properties props = new Properties();
 
             props.put("client.type", agents.length > 1 ? "default_failover" : "default");
 
             int count = 1;
-            StringBuilder sb = new StringBuilder();
-            for (Agent agent : agents) {
+            final StringBuilder sb = new StringBuilder();
+            for (final Agent agent : agents) {
                 if (sb.length() > 0) {
                     sb.append(" ");
                 }
-                String hostName = "host" + count++;
+                final String hostName = "host" + count++;
                 props.put("hosts." + hostName, agent.getHost() + ":" + agent.getPort());
                 sb.append(hostName);
             }
@@ -220,7 +220,7 @@ public class FlumeAvroManager extends Ab
                 props.put("connect-timeout", Integer.toString(connectTimeout));
             }
             return RpcClientFactory.getInstance(props);
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             LOGGER.error("Unable to create Flume RPCClient: {}", ex.getMessage());
             return null;
         }

Modified: logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java Tue Jul  9 06:08:25 2013
@@ -293,7 +293,7 @@ public class FlumeEvent extends SimpleEv
     }
 
     @Override
-    public void setIncludeLocation(boolean includeLocation) {
+    public void setIncludeLocation(final boolean includeLocation) {
         event.setIncludeLocation(includeLocation);
     }
 
@@ -303,7 +303,7 @@ public class FlumeEvent extends SimpleEv
     }
 
     @Override
-    public void setEndOfBatch(boolean endOfBatch) {
+    public void setEndOfBatch(final boolean endOfBatch) {
         event.setEndOfBatch(endOfBatch);
     }
 }

Modified: logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java Tue Jul  9 06:08:25 2013
@@ -75,9 +75,9 @@ public class FlumePersistentManager exte
 
     private static BDBManagerFactory factory = new BDBManagerFactory();
 
-    private Database database;
+    private final Database database;
 
-    private Environment environment;
+    private final Environment environment;
 
     private final WriterThread worker;
 
@@ -106,7 +106,7 @@ public class FlumePersistentManager exte
     protected FlumePersistentManager(final String name, final String shortName, final Agent[] agents,
                                      final int batchSize, final int retries, final int connectionTimeout,
                                      final int requestTimeout, final int delay, final Database database,
-                                     final Environment environment, SecretKey secretKey) {
+                                     final Environment environment, final SecretKey secretKey) {
         super(name, shortName, agents, batchSize, retries, connectionTimeout, requestTimeout);
         this.delay = delay;
         this.database = database;
@@ -131,7 +131,7 @@ public class FlumePersistentManager exte
      * @param dataDir The location of the Berkeley database.
      * @return A FlumeAvroManager.
      */
-    public static FlumePersistentManager getManager(final String name, final Agent[] agents, Property[] properties,
+    public static FlumePersistentManager getManager(final String name, final Agent[] agents, final Property[] properties,
                                                     int batchSize, final int retries, final int connectionTimeout,
                                                     final int requestTimeout, final int delay, final String dataDir) {
         if (agents == null || agents.length == 0) {
@@ -141,7 +141,7 @@ public class FlumePersistentManager exte
         if (batchSize <= 0) {
             batchSize = 1;
         }
-        String dataDirectory = dataDir == null || dataDir.length() == 0 ? DEFAULT_DATA_DIR : dataDir;
+        final String dataDirectory = dataDir == null || dataDir.length() == 0 ? DEFAULT_DATA_DIR : dataDir;
 
         final StringBuilder sb = new StringBuilder("FlumePersistent[");
         boolean first = true;
@@ -164,37 +164,37 @@ public class FlumePersistentManager exte
             throw new LoggingException("Unable to record event");
         }
 
-        Map<String, String> headers = event.getHeaders();
-        byte[] keyData = headers.get(FlumeEvent.GUID).getBytes(UTF8);
+        final Map<String, String> headers = event.getHeaders();
+        final byte[] keyData = headers.get(FlumeEvent.GUID).getBytes(UTF8);
         try {
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            DataOutputStream daos = new DataOutputStream(baos);
+            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            final DataOutputStream daos = new DataOutputStream(baos);
             daos.writeInt(event.getBody().length);
             daos.write(event.getBody(), 0, event.getBody().length);
             daos.writeInt(event.getHeaders().size());
-            for (Map.Entry<String, String> entry : headers.entrySet()) {
+            for (final Map.Entry<String, String> entry : headers.entrySet()) {
                 daos.writeUTF(entry.getKey());
                 daos.writeUTF(entry.getValue());
             }
             byte[] eventData = baos.toByteArray();
             if (secretKey != null) {
-                Cipher cipher = Cipher.getInstance("AES");
+                final Cipher cipher = Cipher.getInstance("AES");
                 cipher.init(Cipher.ENCRYPT_MODE, secretKey);
                 eventData = cipher.doFinal(eventData);
             }
-            Future<Integer> future = threadPool.submit(new BDBWriter(keyData, eventData, environment, database, queue));
+            final Future<Integer> future = threadPool.submit(new BDBWriter(keyData, eventData, environment, database, queue));
             boolean interrupted = false;
             int count = 0;
             do {
                 try {
                     future.get();
-                } catch (InterruptedException ie) {
+                } catch (final InterruptedException ie) {
                     interrupted = true;
                     ++count;
                 }
             } while (interrupted && count <= 1);
 
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             throw new LoggingException("Exception occurred writing log event", ex);
         }
     }
@@ -206,12 +206,12 @@ public class FlumePersistentManager exte
         threadPool.shutdown();
         try {
             threadPool.awaitTermination(SHUTDOWN_WAIT, TimeUnit.SECONDS);
-        } catch (InterruptedException ie) {
+        } catch (final InterruptedException ie) {
             LOGGER.warn("PersistentManager Thread pool failed to shut down");
         }
         try {
             worker.join();
-        } catch (InterruptedException ex) {
+        } catch (final InterruptedException ex) {
             LOGGER.debug("Interrupted while waiting for worker to complete");
         }
         try {
@@ -244,8 +244,8 @@ public class FlumePersistentManager exte
         private final Database database;
         private final LinkedBlockingQueue<byte[]> queue;
 
-        public BDBWriter(byte[] keyData, byte[] eventData, Environment environment, Database database,
-                         LinkedBlockingQueue<byte[]> queue) {
+        public BDBWriter(final byte[] keyData, final byte[] eventData, final Environment environment, final Database database,
+                         final LinkedBlockingQueue<byte[]> queue) {
             this.keyData = keyData;
             this.eventData = eventData;
             this.environment = environment;
@@ -257,12 +257,12 @@ public class FlumePersistentManager exte
         public  Integer call() throws Exception {
             final DatabaseEntry key = new DatabaseEntry(keyData);
             final DatabaseEntry data = new DatabaseEntry(eventData);
-            Transaction txn = environment.beginTransaction(null, null);
+            final Transaction txn = environment.beginTransaction(null, null);
             try {
                 database.put(txn, key, data);
                 txn.commit();
                 queue.add(keyData);
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 if (txn != null) {
                     txn.abort();
                 }
@@ -326,16 +326,16 @@ public class FlumePersistentManager exte
             Database database;
             Environment environment;
 
-            Map<String, String> properties = new HashMap<String, String>();
+            final Map<String, String> properties = new HashMap<String, String>();
             if (data.properties != null) {
-                for (Property property : data.properties) {
+                for (final Property property : data.properties) {
                     properties.put(property.getName(), property.getValue());
                 }
             }
 
             try {
 
-                File dir = new File(data.dataDir);
+                final File dir = new File(data.dataDir);
                 FileUtils.mkdir(dir, true);
                 final EnvironmentConfig dbEnvConfig = new EnvironmentConfig();
                 dbEnvConfig.setTransactional(true);
@@ -353,7 +353,7 @@ public class FlumePersistentManager exte
 
             try {
                 String key = null;
-                for (Map.Entry<String, String> entry : properties.entrySet()) {
+                for (final Map.Entry<String, String> entry : properties.entrySet()) {
                     if (entry.getKey().equalsIgnoreCase(KEY_PROVIDER)) {
                         key = entry.getValue();
                         break;
@@ -365,15 +365,15 @@ public class FlumePersistentManager exte
                     final Map<String, PluginType> plugins = manager.getPlugins();
                     if (plugins != null) {
                         boolean found = false;
-                        for (Map.Entry<String, PluginType> entry : plugins.entrySet()) {
+                        for (final Map.Entry<String, PluginType> entry : plugins.entrySet()) {
                             if (entry.getKey().equalsIgnoreCase(key)) {
                                 found = true;
-                                Class cl = entry.getValue().getPluginClass();
+                                final Class cl = entry.getValue().getPluginClass();
                                 try {
-                                    SecretKeyProvider provider = (SecretKeyProvider) cl.newInstance();
+                                    final SecretKeyProvider provider = (SecretKeyProvider) cl.newInstance();
                                     secretKey = provider.getSecretKey();
                                     LOGGER.debug("Persisting events using SecretKeyProvider {}", cl.getName());
-                                } catch (Exception ex) {
+                                } catch (final Exception ex) {
                                     LOGGER.error("Unable to create SecretKeyProvider {}, encryption will be disabled",
                                         cl.getName());
                                 }
@@ -387,7 +387,7 @@ public class FlumePersistentManager exte
                         LOGGER.error("Unable to locate SecretKey provider {}, encryption will be disabled", key);
                     }
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 LOGGER.warn("Error setting up encryption - encryption will be disabled", ex);
             }
             return new FlumePersistentManager(name, data.name, data.agents, data.batchSize, data.retries,
@@ -407,8 +407,8 @@ public class FlumePersistentManager exte
         private final SecretKey secretKey;
         private final int batchSize;
 
-        public WriterThread(Database database, Environment environment, FlumePersistentManager manager,
-                            LinkedBlockingQueue<byte[]> queue, int batchsize, SecretKey secretKey) {
+        public WriterThread(final Database database, final Environment environment, final FlumePersistentManager manager,
+                            final LinkedBlockingQueue<byte[]> queue, final int batchsize, final SecretKey secretKey) {
             this.database = database;
             this.environment = environment;
             this.manager = manager;
@@ -450,9 +450,9 @@ public class FlumePersistentManager exte
                             try {
                                 status = cursor.getFirst(key, data, null);
 
-                                BatchEvent batch = new BatchEvent();
+                                final BatchEvent batch = new BatchEvent();
                                 for (int i = 0; status == OperationStatus.SUCCESS && i < batchSize; ++i) {
-                                    SimpleEvent event = createEvent(data);
+                                    final SimpleEvent event = createEvent(data);
                                     if (event != null) {
                                         batch.addEvent(event);
                                     }
@@ -460,31 +460,31 @@ public class FlumePersistentManager exte
                                 }
                                 try {
                                     manager.send(batch);
-                                } catch (Exception ioe) {
+                                } catch (final Exception ioe) {
                                     LOGGER.error("Error sending events", ioe);
                                     break;
                                 }
                                 cursor.close();
                                 cursor = null;
-                                Transaction txn = environment.beginTransaction(null, null);
+                                final Transaction txn = environment.beginTransaction(null, null);
                                 try {
-                                    for (Event event : batch.getEvents()) {
+                                    for (final Event event : batch.getEvents()) {
                                         try {
-                                            Map<String, String> headers = event.getHeaders();
+                                            final Map<String, String> headers = event.getHeaders();
                                             key = new DatabaseEntry(headers.get(FlumeEvent.GUID).getBytes(UTF8));
                                             database.delete(txn, key);
-                                        } catch (Exception ex) {
+                                        } catch (final Exception ex) {
                                             LOGGER.error("Error deleting key from database", ex);
                                         }
                                     }
                                     txn.commit();
-                                } catch (Exception ex) {
+                                } catch (final Exception ex) {
                                     LOGGER.error("Unable to commit transaction", ex);
                                     if (txn != null) {
                                         txn.abort();
                                     }
                                 }
-                            } catch (Exception ex) {
+                            } catch (final Exception ex) {
                                 LOGGER.error("Error reading database", ex);
                                 shutdown = true;
                                 break;
@@ -499,18 +499,18 @@ public class FlumePersistentManager exte
                             try {
                                 status = cursor.getFirst(key, data, LockMode.RMW);
                                 while (status == OperationStatus.SUCCESS) {
-                                    SimpleEvent event = createEvent(data);
+                                    final SimpleEvent event = createEvent(data);
                                     if (event != null) {
                                         try {
                                             manager.doSend(event);
-                                        } catch (Exception ioe) {
+                                        } catch (final Exception ioe) {
                                             errors = true;
                                             LOGGER.error("Error sending event", ioe);
                                             break;
                                         }
                                         try {
                                             cursor.delete();
-                                        } catch (Exception ex) {
+                                        } catch (final Exception ex) {
                                             LOGGER.error("Unable to delete event", ex);
                                         }
                                     }
@@ -522,7 +522,7 @@ public class FlumePersistentManager exte
                                 }
                                 txn.commit();
                                 txn = null;
-                            } catch (Exception ex) {
+                            } catch (final Exception ex) {
                                 LOGGER.error("Error reading or writing to database", ex);
                                 shutdown = true;
                                 break;
@@ -539,17 +539,17 @@ public class FlumePersistentManager exte
                             Thread.sleep(manager.delay);
                             continue;
                         }
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         LOGGER.warn("WriterThread encountered an exception. Continuing.", ex);
                     }
                 } else {
                     while (!shutdown && (database.count() == 0 || database.count() < batchSize && nextBatch > now)) {
                         try {
-                            long interval = nextBatch - now;
+                            final long interval = nextBatch - now;
                             queue.poll(interval, TimeUnit.MILLISECONDS);
-                        } catch (InterruptedException ie) {
+                        } catch (final InterruptedException ie) {
                             LOGGER.warn("WriterThread interrupted, continuing");
-                        } catch (Exception ex) {
+                        } catch (final Exception ex) {
                             LOGGER.error("WriterThread encountered an exception waiting for work", ex);
                             break;
                         }
@@ -564,31 +564,31 @@ public class FlumePersistentManager exte
             LOGGER.trace("WriterThread exiting");
         }
 
-        private SimpleEvent createEvent(DatabaseEntry data) {
-            SimpleEvent event = new SimpleEvent();
+        private SimpleEvent createEvent(final DatabaseEntry data) {
+            final SimpleEvent event = new SimpleEvent();
             try {
                 byte[] eventData = data.getData();
                 if (secretKey != null) {
-                    Cipher cipher = Cipher.getInstance("AES");
+                    final Cipher cipher = Cipher.getInstance("AES");
                     cipher.init(Cipher.DECRYPT_MODE, secretKey);
                     eventData = cipher.doFinal(eventData);
                 }
-                ByteArrayInputStream bais = new ByteArrayInputStream(eventData);
-                DataInputStream dais = new DataInputStream(bais);
+                final ByteArrayInputStream bais = new ByteArrayInputStream(eventData);
+                final DataInputStream dais = new DataInputStream(bais);
                 int length = dais.readInt();
-                byte[] bytes = new byte[length];
+                final byte[] bytes = new byte[length];
                 dais.read(bytes, 0, length);
                 event.setBody(bytes);
                 length = dais.readInt();
-                Map<String, String> map = new HashMap<String, String>(length);
+                final Map<String, String> map = new HashMap<String, String>(length);
                 for (int i = 0; i < length; ++i) {
-                    String headerKey = dais.readUTF();
-                    String value = dais.readUTF();
+                    final String headerKey = dais.readUTF();
+                    final String value = dais.readUTF();
                     map.put(headerKey, value);
                 }
                 event.setHeaders(map);
                 return event;
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 LOGGER.error("Error retrieving event", ex);
                 return null;
             }
@@ -606,14 +606,14 @@ public class FlumePersistentManager exte
         private final String namePrefix;
 
         public DaemonThreadFactory() {
-            SecurityManager securityManager = System.getSecurityManager();
+            final SecurityManager securityManager = System.getSecurityManager();
             group = (securityManager != null) ? securityManager.getThreadGroup() :
                 Thread.currentThread().getThreadGroup();
             namePrefix = "DaemonPool-" + POOL_NUMBER.getAndIncrement() + "-thread-";
         }
 
-        public Thread newThread(Runnable r) {
-            Thread thread = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(), 0);
+        public Thread newThread(final Runnable r) {
+            final Thread thread = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(), 0);
             thread.setDaemon(true);
             if (thread.getPriority() != Thread.NORM_PRIORITY) {
                 thread.setPriority(Thread.NORM_PRIORITY);

Modified: logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAppenderTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAppenderTest.java Tue Jul  9 06:08:25 2013
@@ -290,7 +290,7 @@ public class FlumeAppenderTest {
         try {
             avroLogger.info("Test message");
             Assert.fail("Exception should have been thrown");
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
 
         }
 
@@ -308,10 +308,10 @@ public class FlumeAppenderTest {
 
         avroLogger.info("Test message 2");
 
-        Transaction transaction = channel.getTransaction();
+        final Transaction transaction = channel.getTransaction();
         transaction.begin();
 
-        Event event = channel.take();
+        final Event event = channel.take();
         Assert.assertNotNull(event);
         Assert.assertTrue("Channel contained event, but not expected message",
             getBody(event).endsWith("Test message 2"));

Modified: logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeEmbeddedAgentTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeEmbeddedAgentTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeEmbeddedAgentTest.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeEmbeddedAgentTest.java Tue Jul  9 06:08:25 2013
@@ -93,7 +93,7 @@ public class FlumeEmbeddedAgentTest {
         * Clear out all other appenders associated with this logger to ensure we're
         * only hitting the Avro appender.
         */
-        int[] ports = findFreePorts(2);
+        final int[] ports = findFreePorts(2);
         System.setProperty("primaryPort", Integer.toString(ports[0]));
         System.setProperty("alternatePort", Integer.toString(ports[1]));
         primary = new EventCollector(ports[0]);
@@ -226,8 +226,8 @@ public class FlumeEmbeddedAgentTest {
         private final NettyServer nettyServer;
 
 
-        public EventCollector(int port) {
-            Responder responder = new SpecificResponder(AvroSourceProtocol.class, this);
+        public EventCollector(final int port) {
+            final Responder responder = new SpecificResponder(AvroSourceProtocol.class, this);
             nettyServer = new NettyServer(responder, new InetSocketAddress(HOSTNAME, port));
             nettyServer.start();
         }
@@ -241,7 +241,7 @@ public class FlumeEmbeddedAgentTest {
             AvroFlumeEvent avroEvent = null;
             try {
                 avroEvent = eventQueue.poll(30000, TimeUnit.MILLISECONDS);
-            } catch (InterruptedException ie) {
+            } catch (final InterruptedException ie) {
                 // Ignore the exception.
             }
             if (avroEvent != null) {
@@ -254,30 +254,30 @@ public class FlumeEmbeddedAgentTest {
         }
 
         @Override
-        public Status append(AvroFlumeEvent event) throws AvroRemoteException {
+        public Status append(final AvroFlumeEvent event) throws AvroRemoteException {
             eventQueue.add(event);
             return Status.OK;
         }
 
         @Override
-        public Status appendBatch(List<AvroFlumeEvent> events)
+        public Status appendBatch(final List<AvroFlumeEvent> events)
             throws AvroRemoteException {
             Preconditions.checkState(eventQueue.addAll(events));
             return Status.OK;
         }
     }
 
-    private static Map<String, String> toStringMap(Map<CharSequence, CharSequence> charSeqMap) {
-        Map<String, String> stringMap = new HashMap<String, String>();
-        for (Map.Entry<CharSequence, CharSequence> entry : charSeqMap.entrySet()) {
+    private static Map<String, String> toStringMap(final Map<CharSequence, CharSequence> charSeqMap) {
+        final Map<String, String> stringMap = new HashMap<String, String>();
+        for (final Map.Entry<CharSequence, CharSequence> entry : charSeqMap.entrySet()) {
             stringMap.put(entry.getKey().toString(), entry.getValue().toString());
         }
         return stringMap;
     }
 
-    private static int[] findFreePorts(int count) throws IOException {
-        int[] ports = new int[count];
-        ServerSocket[] sockets = new ServerSocket[count];
+    private static int[] findFreePorts(final int count) throws IOException {
+        final int[] ports = new int[count];
+        final ServerSocket[] sockets = new ServerSocket[count];
         try {
             for (int i = 0; i < count; ++i) {
                 sockets[i] = new ServerSocket(0);
@@ -288,7 +288,7 @@ public class FlumeEmbeddedAgentTest {
                 if (sockets[i] != null) {
                     try {
                         sockets[i].close();
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         // Ignore the error.
                     }
                 }

Modified: logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeEmbeddedAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeEmbeddedAppenderTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeEmbeddedAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeEmbeddedAppenderTest.java Tue Jul  9 06:08:25 2013
@@ -93,7 +93,7 @@ public class FlumeEmbeddedAppenderTest {
         * Clear out all other appenders associated with this logger to ensure we're
         * only hitting the Avro appender.
         */
-        int[] ports = findFreePorts(2);
+        final int[] ports = findFreePorts(2);
         System.setProperty("primaryPort", Integer.toString(ports[0]));
         System.setProperty("alternatePort", Integer.toString(ports[1]));
         primary = new EventCollector(ports[0]);
@@ -200,20 +200,20 @@ public class FlumeEmbeddedAppenderTest {
 
         final Event event = primary.poll();
         Assert.assertNotNull(event);
-        String environmentHeader = event.getHeaders().get("environment");
+        final String environmentHeader = event.getHeaders().get("environment");
         Assert.assertEquals("local", environmentHeader);
     }
 
     @Test
     public void testPerformance() throws Exception {
-        long start = System.currentTimeMillis();
-        int count = 10000;
+        final long start = System.currentTimeMillis();
+        final int count = 10000;
         for (int i = 0; i < count; ++i) {
             final StructuredDataMessage msg = new StructuredDataMessage("Test", "Test Primary " + i, "Test");
             msg.put("counter", Integer.toString(i));
             EventLogger.logEvent(msg);
         }
-        long elapsed = System.currentTimeMillis() - start;
+        final long elapsed = System.currentTimeMillis() - start;
         System.out.println("Time to log " + count + " events " + elapsed + "ms");
     }
 
@@ -251,8 +251,8 @@ public class FlumeEmbeddedAppenderTest {
         private final NettyServer nettyServer;
 
 
-        public EventCollector(int port) {
-            Responder responder = new SpecificResponder(AvroSourceProtocol.class, this);
+        public EventCollector(final int port) {
+            final Responder responder = new SpecificResponder(AvroSourceProtocol.class, this);
             nettyServer = new NettyServer(responder, new InetSocketAddress(HOSTNAME, port));
             nettyServer.start();
         }
@@ -266,7 +266,7 @@ public class FlumeEmbeddedAppenderTest {
             AvroFlumeEvent avroEvent = null;
             try {
                 avroEvent = eventQueue.poll(30000, TimeUnit.MILLISECONDS);
-            } catch (InterruptedException ie) {
+            } catch (final InterruptedException ie) {
                 // Ignore the exception.
             }
             if (avroEvent != null) {
@@ -279,30 +279,30 @@ public class FlumeEmbeddedAppenderTest {
         }
 
         @Override
-        public Status append(AvroFlumeEvent event) throws AvroRemoteException {
+        public Status append(final AvroFlumeEvent event) throws AvroRemoteException {
             eventQueue.add(event);
             return Status.OK;
         }
 
         @Override
-        public Status appendBatch(List<AvroFlumeEvent> events)
+        public Status appendBatch(final List<AvroFlumeEvent> events)
             throws AvroRemoteException {
             Preconditions.checkState(eventQueue.addAll(events));
             return Status.OK;
         }
     }
 
-    private static Map<String, String> toStringMap(Map<CharSequence, CharSequence> charSeqMap) {
-        Map<String, String> stringMap = new HashMap<String, String>();
-        for (Map.Entry<CharSequence, CharSequence> entry : charSeqMap.entrySet()) {
+    private static Map<String, String> toStringMap(final Map<CharSequence, CharSequence> charSeqMap) {
+        final Map<String, String> stringMap = new HashMap<String, String>();
+        for (final Map.Entry<CharSequence, CharSequence> entry : charSeqMap.entrySet()) {
             stringMap.put(entry.getKey().toString(), entry.getValue().toString());
         }
         return stringMap;
     }
 
-    private static int[] findFreePorts(int count) throws IOException {
-        int[] ports = new int[count];
-        ServerSocket[] sockets = new ServerSocket[count];
+    private static int[] findFreePorts(final int count) throws IOException {
+        final int[] ports = new int[count];
+        final ServerSocket[] sockets = new ServerSocket[count];
         try {
             for (int i = 0; i < count; ++i) {
                 sockets[i] = new ServerSocket(0);
@@ -313,7 +313,7 @@ public class FlumeEmbeddedAppenderTest {
                 if (sockets[i] != null) {
                     try {
                         sockets[i].close();
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         // Ignore the error.
                     }
                 }

Modified: logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentAppenderTest.java Tue Jul  9 06:08:25 2013
@@ -95,7 +95,7 @@ public class FlumePersistentAppenderTest
         * Clear out all other appenders associated with this logger to ensure we're
         * only hitting the Avro appender.
         */
-        int[] ports = findFreePorts(2);
+        final int[] ports = findFreePorts(2);
         System.setProperty("primaryPort", Integer.toString(ports[0]));
         System.setProperty("alternatePort", Integer.toString(ports[1]));
         primary = new EventCollector(ports[0]);
@@ -145,7 +145,7 @@ public class FlumePersistentAppenderTest
             msg.put("counter", Integer.toString(i));
             EventLogger.logEvent(msg);
         }
-        boolean[] fields = new boolean[10];
+        final boolean[] fields = new boolean[10];
         for (int i = 0; i < 10; ++i) {
             final Event event = primary.poll();
             Assert.assertNotNull("Received " + i + " events. Event " + (i + 1) + " is null", event);
@@ -221,8 +221,8 @@ public class FlumePersistentAppenderTest
     @Test
     public void testSingle() throws InterruptedException, IOException {
 
-        Logger logger = LogManager.getLogger("EventLogger");
-        Marker marker = MarkerManager.getMarker("EVENT");
+        final Logger logger = LogManager.getLogger("EventLogger");
+        final Marker marker = MarkerManager.getMarker("EVENT");
         logger.info(marker, "This is a test message");
 
         final Event event = primary.poll();
@@ -279,8 +279,8 @@ public class FlumePersistentAppenderTest
         private final NettyServer nettyServer;
 
 
-        public EventCollector(int port) {
-            Responder responder = new SpecificResponder(AvroSourceProtocol.class, this);
+        public EventCollector(final int port) {
+            final Responder responder = new SpecificResponder(AvroSourceProtocol.class, this);
             nettyServer = new NettyServer(responder, new InetSocketAddress(HOSTNAME, port));
             nettyServer.start();
         }
@@ -294,7 +294,7 @@ public class FlumePersistentAppenderTest
             AvroFlumeEvent avroEvent = null;
             try {
                 avroEvent = eventQueue.poll(30000, TimeUnit.MILLISECONDS);
-            } catch (InterruptedException ie) {
+            } catch (final InterruptedException ie) {
                 // Ignore the exception.
             }
             if (avroEvent != null) {
@@ -307,33 +307,33 @@ public class FlumePersistentAppenderTest
         }
 
         @Override
-        public Status append(AvroFlumeEvent event) throws AvroRemoteException {
+        public Status append(final AvroFlumeEvent event) throws AvroRemoteException {
             eventQueue.add(event);
             //System.out.println("Received event " + event.getHeaders().get(new org.apache.avro.util.Utf8(FlumeEvent.GUID)));
             return Status.OK;
         }
 
         @Override
-        public Status appendBatch(List<AvroFlumeEvent> events) throws AvroRemoteException {
+        public Status appendBatch(final List<AvroFlumeEvent> events) throws AvroRemoteException {
             Preconditions.checkState(eventQueue.addAll(events));
-            for (AvroFlumeEvent event : events) {
+            for (final AvroFlumeEvent event : events) {
                // System.out.println("Received event " + event.getHeaders().get(new org.apache.avro.util.Utf8(FlumeEvent.GUID)));
             }
             return Status.OK;
         }
     }
 
-    private static Map<String, String> toStringMap(Map<CharSequence, CharSequence> charSeqMap) {
-        Map<String, String> stringMap = new HashMap<String, String>();
-        for (Map.Entry<CharSequence, CharSequence> entry : charSeqMap.entrySet()) {
+    private static Map<String, String> toStringMap(final Map<CharSequence, CharSequence> charSeqMap) {
+        final Map<String, String> stringMap = new HashMap<String, String>();
+        for (final Map.Entry<CharSequence, CharSequence> entry : charSeqMap.entrySet()) {
             stringMap.put(entry.getKey().toString(), entry.getValue().toString());
         }
         return stringMap;
     }
 
-    private static int[] findFreePorts(int count) throws IOException {
-        int[] ports = new int[count];
-        ServerSocket[] sockets = new ServerSocket[count];
+    private static int[] findFreePorts(final int count) throws IOException {
+        final int[] ports = new int[count];
+        final ServerSocket[] sockets = new ServerSocket[count];
         try {
             for (int i = 0; i < count; ++i) {
                 sockets[i] = new ServerSocket(0);
@@ -344,7 +344,7 @@ public class FlumePersistentAppenderTest
                 if (sockets[i] != null) {
                     try {
                         sockets[i].close();
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         // Ignore the error.
                     }
                 }

Modified: logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentPerf.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentPerf.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentPerf.java (original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumePersistentPerf.java Tue Jul  9 06:08:25 2013
@@ -91,7 +91,7 @@ public class FlumePersistentPerf {
         * Clear out all other appenders associated with this logger to ensure we're
         * only hitting the Avro appender.
         */
-        int[] ports = findFreePorts(2);
+        final int[] ports = findFreePorts(2);
         System.setProperty("primaryPort", Integer.toString(ports[0]));
         System.setProperty("alternatePort", Integer.toString(ports[1]));
         primary = new EventCollector(ports[0]);
@@ -122,14 +122,14 @@ public class FlumePersistentPerf {
 
     @Test
     public void testPerformance() throws Exception {
-        long start = System.currentTimeMillis();
-        int count = 10000;
+        final long start = System.currentTimeMillis();
+        final int count = 10000;
         for (int i = 0; i < count; ++i) {
             final StructuredDataMessage msg = new StructuredDataMessage("Test", "Test Primary " + i, "Test");
             msg.put("counter", Integer.toString(i));
             EventLogger.logEvent(msg);
         }
-        long elapsed = System.currentTimeMillis() - start;
+        final long elapsed = System.currentTimeMillis() - start;
         System.out.println("Time to log " + count + " events " + elapsed + "ms");
     }
 
@@ -167,8 +167,8 @@ public class FlumePersistentPerf {
         private final NettyServer nettyServer;
 
 
-        public EventCollector(int port) {
-            Responder responder = new SpecificResponder(AvroSourceProtocol.class, this);
+        public EventCollector(final int port) {
+            final Responder responder = new SpecificResponder(AvroSourceProtocol.class, this);
             nettyServer = new NettyServer(responder, new InetSocketAddress(HOSTNAME, port));
             nettyServer.start();
         }
@@ -182,7 +182,7 @@ public class FlumePersistentPerf {
             AvroFlumeEvent avroEvent = null;
             try {
                 avroEvent = eventQueue.poll(30000, TimeUnit.MILLISECONDS);
-            } catch (InterruptedException ie) {
+            } catch (final InterruptedException ie) {
                 // Ignore the exception.
             }
             if (avroEvent != null) {
@@ -195,30 +195,30 @@ public class FlumePersistentPerf {
         }
 
         @Override
-        public Status append(AvroFlumeEvent event) throws AvroRemoteException {
+        public Status append(final AvroFlumeEvent event) throws AvroRemoteException {
             eventQueue.add(event);
             return Status.OK;
         }
 
         @Override
-        public Status appendBatch(List<AvroFlumeEvent> events)
+        public Status appendBatch(final List<AvroFlumeEvent> events)
             throws AvroRemoteException {
             Preconditions.checkState(eventQueue.addAll(events));
             return Status.OK;
         }
     }
 
-    private static Map<String, String> toStringMap(Map<CharSequence, CharSequence> charSeqMap) {
-        Map<String, String> stringMap = new HashMap<String, String>();
-        for (Map.Entry<CharSequence, CharSequence> entry : charSeqMap.entrySet()) {
+    private static Map<String, String> toStringMap(final Map<CharSequence, CharSequence> charSeqMap) {
+        final Map<String, String> stringMap = new HashMap<String, String>();
+        for (final Map.Entry<CharSequence, CharSequence> entry : charSeqMap.entrySet()) {
             stringMap.put(entry.getKey().toString(), entry.getValue().toString());
         }
         return stringMap;
     }
 
-    private static int[] findFreePorts(int count) throws IOException {
-        int[] ports = new int[count];
-        ServerSocket[] sockets = new ServerSocket[count];
+    private static int[] findFreePorts(final int count) throws IOException {
+        final int[] ports = new int[count];
+        final ServerSocket[] sockets = new ServerSocket[count];
         try {
             for (int i = 0; i < count; ++i) {
                 sockets[i] = new ServerSocket(0);
@@ -229,7 +229,7 @@ public class FlumePersistentPerf {
                 if (sockets[i] != null) {
                     try {
                         sockets[i].close();
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         // Ignore the error.
                     }
                 }

Modified: logging/log4j/log4j2/trunk/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java (original)
+++ logging/log4j/log4j2/trunk/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java Tue Jul  9 06:08:25 2013
@@ -33,7 +33,7 @@ public class SLF4JLoggerContextFactory i
         try {
             Class.forName("org.slf4j.helpers.Log4jLoggerFactory");
             misconfigured = true;
-        } catch (ClassNotFoundException classNotFoundIsGood) {
+        } catch (final ClassNotFoundException classNotFoundIsGood) {
             // org.slf4j.helpers.Log4jLoggerFactory is not on classpath. Good!
         }
         if (misconfigured) {
@@ -49,11 +49,11 @@ public class SLF4JLoggerContextFactory i
 
     @Override
     public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext,
-                                    URI configLocation) {
+                                    final URI configLocation) {
         return context;
     }
 
     @Override
-    public void removeContext(LoggerContext context) {
+    public void removeContext(final LoggerContext context) {
     }
 }

Modified: logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/LoggingTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/LoggingTest.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/LoggingTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/test/java/org/apache/log4j/LoggingTest.java Tue Jul  9 06:08:25 2013
@@ -59,7 +59,7 @@ public class LoggingTest {
     @Test
     public void testParent() {
         final Logger a = Logger.getLogger("org.apache.test.logging.Test");
-        Category parent = a.getParent();
+        final Category parent = a.getParent();
         assertNotNull("No parent Logger", parent);
         assertTrue("Incorrect parent logger", parent.getName().equals("org.apache.test.logging"));
     }

Modified: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingApp.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingApp.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingApp.java (original)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LoggingApp.java Tue Jul  9 06:08:25 2013
@@ -36,21 +36,21 @@ public class LoggingApp {
      */
     private static Logger logger = LogManager.getLogger(LoggingApp.class);
 
-    private Random ran = new Random();
+    private final Random ran = new Random();
 
     private List<AuditEvent> events;
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         String member = "fakemember";
         if (args.length == 1) {
             member = args[0];
         }
-        LoggingApp app = new LoggingApp(member);
+        final LoggingApp app = new LoggingApp(member);
         app.runApp(member);
         System.out.println("Job ended");
     }
 
-    public LoggingApp(String member) {
+    public LoggingApp(final String member) {
 
         ThreadContext.clear();
 
@@ -67,18 +67,18 @@ public class LoggingApp {
         }
     }
 
-    public void runApp(String member) {
-        Worker worker = new Worker(member);
+    public void runApp(final String member) {
+        final Worker worker = new Worker(member);
         worker.start();
         sleep(30000);
         worker.shutdown();
         sleep(5000);
     }
 
-    private void sleep(long millis) {
+    private void sleep(final long millis) {
         try {
             Thread.sleep(millis);
-        } catch (InterruptedException ie) {
+        } catch (final InterruptedException ie) {
             //
         }
     }
@@ -90,7 +90,7 @@ public class LoggingApp {
 
         private boolean shutdown = false;
 
-        public Worker(String member) {
+        public Worker(final String member) {
             this.member = member;
         }
 
@@ -99,19 +99,19 @@ public class LoggingApp {
 
             while (!shutdown) {
                 // Generate rand number between 1 to 10
-                int rand = ran.nextInt(9) + 1;
+                final int rand = ran.nextInt(9) + 1;
 
                 // Sleep for rand seconds
                 try {
                     Thread.sleep(rand * 1000);
-                } catch (InterruptedException e) {
+                } catch (final InterruptedException e) {
                     logger.warn("WARN", e);
                 }
 
                 // Write rand number of logs
                 for (int i = 0; i < rand; i++) {
-                    int eventIndex = (Math.abs(ran.nextInt())) % events.size();
-                    AuditEvent event = events.get(eventIndex);
+                    final int eventIndex = (Math.abs(ran.nextInt())) % events.size();
+                    final AuditEvent event = events.get(eventIndex);
                     RequestContext.setUserId(member);
                     event.logEvent();
 
@@ -133,7 +133,7 @@ public class LoggingApp {
             this.shutdown = true;
             try {
                 this.join();
-            } catch (InterruptedException ie) {
+            } catch (final InterruptedException ie) {
                 //
             }
             System.out.println("SHUTDOWN.......................");

Modified: logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4jMarkerFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4jMarkerFactory.java?rev=1501104&r1=1501103&r2=1501104&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4jMarkerFactory.java (original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4jMarkerFactory.java Tue Jul  9 06:08:25 2013
@@ -39,7 +39,7 @@ public class Log4jMarkerFactory implemen
             return marker;
         }
         marker = new MarkerWrapper(name);
-        Marker existing = markerMap.putIfAbsent(name, marker);
+        final Marker existing = markerMap.putIfAbsent(name, marker);
         return existing == null ? marker : existing;
     }
 



Mime
View raw message