logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1419697 [17/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/slf4j-impl/src/main/java/org/slf4j/impl/SLF4JLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/impl/SLF4JLogger.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/impl/SLF4JLogger.java (original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/impl/SLF4JLogger.java Mon
Dec 10 19:36:06 2012
@@ -43,40 +43,40 @@ public class SLF4JLogger implements Loca
     private final AbstractLoggerWrapper logger;
     private final String name;
 
-    public SLF4JLogger(AbstractLogger logger, String name) {
-        Logger l = LogManager.getLogger(name);
+    public SLF4JLogger(final AbstractLogger logger, final String name) {
+        final Logger l = LogManager.getLogger(name);
         this.logger = new AbstractLoggerWrapper(logger, name, null);
         eventLogger = "EventLogger".equals(name);
         this.name = name;
     }
 
-    public void trace(String format) {
+    public void trace(final String format) {
         if (logger.isTraceEnabled()) {
             logger.log(null, FQCN, Level.TRACE, new SimpleMessage(format), null);
         }
     }
 
-    public void trace(String format, Object o) {
+    public void trace(final String format, final Object o) {
         if (logger.isTraceEnabled()) {
             logger.log(null, FQCN, Level.TRACE, new ParameterizedMessage(format, o), null);
         }
     }
 
-    public void trace(String format, Object arg1, Object arg2) {
+    public void trace(final String format, final Object arg1, final Object arg2) {
         if (logger.isTraceEnabled()) {
-            ParameterizedMessage msg = new ParameterizedMessage(format, arg1, arg2);
+            final ParameterizedMessage msg = new ParameterizedMessage(format, arg1, arg2);
             logger.log(null, FQCN, Level.TRACE, msg, msg.getThrowable());
         }
     }
 
-    public void trace(String format, Object[] args) {
+    public void trace(final String format, final Object[] args) {
         if (logger.isTraceEnabled()) {
-            ParameterizedMessage msg = new ParameterizedMessage(format, args);
+            final ParameterizedMessage msg = new ParameterizedMessage(format, args);
             logger.log(null, FQCN, Level.TRACE, msg, msg.getThrowable());
         }
     }
 
-    public void trace(String format, Throwable t) {
+    public void trace(final String format, final Throwable t) {
         if (logger.isTraceEnabled()) {
             logger.log(null, FQCN, Level.TRACE, new SimpleMessage(format), t);
         }
@@ -86,71 +86,71 @@ public class SLF4JLogger implements Loca
         return logger.isTraceEnabled();
     }
 
-    public boolean isTraceEnabled(Marker marker) {
+    public boolean isTraceEnabled(final Marker marker) {
         return logger.isTraceEnabled((org.apache.logging.log4j.Marker) marker);
     }
 
-    public void trace(Marker marker, String s) {
+    public void trace(final Marker marker, final String s) {
         if (isTraceEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.TRACE, new SimpleMessage(s),
null);
         }
     }
 
-    public void trace(Marker marker, String s, Object o) {
+    public void trace(final Marker marker, final String s, final Object o) {
         if (isTraceEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.TRACE,
                 new ParameterizedMessage(s, o), null);
         }
     }
 
-    public void trace(Marker marker, String s, Object o, Object o1) {
+    public void trace(final Marker marker, final String s, final Object o, final Object o1)
{
         if (isTraceEnabled(marker)) {
-            ParameterizedMessage msg = new ParameterizedMessage(s, o, o1);
+            final ParameterizedMessage msg = new ParameterizedMessage(s, o, o1);
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.TRACE, msg,
msg.getThrowable());
         }
     }
 
-    public void trace(Marker marker, String s, Object[] objects) {
+    public void trace(final Marker marker, final String s, final Object[] objects) {
         if (isTraceEnabled(marker)) {
-            ParameterizedMessage msg = new ParameterizedMessage(s, objects);
+            final ParameterizedMessage msg = new ParameterizedMessage(s, objects);
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.TRACE, msg,
msg.getThrowable());
         }
     }
 
-    public void trace(Marker marker, String s, Throwable throwable) {
+    public void trace(final Marker marker, final String s, final Throwable throwable) {
         if (isTraceEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.TRACE,
                 new SimpleMessage(s), throwable);
         }
     }
 
-    public void debug(String format) {
+    public void debug(final String format) {
         if (logger.isDebugEnabled()) {
             logger.log(null, FQCN, Level.DEBUG, new SimpleMessage(format), null);
         }
     }
 
-    public void debug(String format, Object o) {
+    public void debug(final String format, final Object o) {
         if (logger.isDebugEnabled()) {
             logger.log(null, FQCN, Level.DEBUG, new ParameterizedMessage(format, o), null);
         }
     }
 
-    public void debug(String format, Object arg1, Object arg2) {
+    public void debug(final String format, final Object arg1, final Object arg2) {
         if (logger.isDebugEnabled()) {
-            ParameterizedMessage msg = new ParameterizedMessage(format, arg1, arg2);
+            final ParameterizedMessage msg = new ParameterizedMessage(format, arg1, arg2);
             logger.log(null, FQCN, Level.DEBUG, msg, msg.getThrowable());
         }
     }
 
-    public void debug(String format, Object[] args) {
+    public void debug(final String format, final Object[] args) {
         if (logger.isDebugEnabled()) {
-            ParameterizedMessage msg = new ParameterizedMessage(format, args);
+            final ParameterizedMessage msg = new ParameterizedMessage(format, args);
             logger.log(null, FQCN, Level.DEBUG, msg, msg.getThrowable());
         }
     }
 
-    public void debug(String format, Throwable t) {
+    public void debug(final String format, final Throwable t) {
         if (logger.isDebugEnabled()) {
             logger.log(null, FQCN, Level.DEBUG, new SimpleMessage(format), t);
         }
@@ -160,71 +160,71 @@ public class SLF4JLogger implements Loca
         return logger.isDebugEnabled();
     }
 
-    public boolean isDebugEnabled(Marker marker) {
+    public boolean isDebugEnabled(final Marker marker) {
         return logger.isDebugEnabled((org.apache.logging.log4j.Marker) marker);
     }
 
-    public void debug(Marker marker, String s) {
+    public void debug(final Marker marker, final String s) {
         if (isDebugEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.DEBUG, new SimpleMessage(s),
null);
         }
     }
 
-    public void debug(Marker marker, String s, Object o) {
+    public void debug(final Marker marker, final String s, final Object o) {
         if (isDebugEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.DEBUG,
                 new ParameterizedMessage(s, o), null);
         }
     }
 
-    public void debug(Marker marker, String s, Object o, Object o1) {
+    public void debug(final Marker marker, final String s, final Object o, final Object o1)
{
         if (isDebugEnabled(marker)) {
-            ParameterizedMessage msg = new ParameterizedMessage(s, o, o1);
+            final ParameterizedMessage msg = new ParameterizedMessage(s, o, o1);
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.DEBUG, msg,
msg.getThrowable());
         }
     }
 
-    public void debug(Marker marker, String s, Object[] objects) {
+    public void debug(final Marker marker, final String s, final Object[] objects) {
         if (isDebugEnabled(marker)) {
-            ParameterizedMessage msg = new ParameterizedMessage(s, objects);
+            final ParameterizedMessage msg = new ParameterizedMessage(s, objects);
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.DEBUG, msg,
msg.getThrowable());
         }
     }
 
-    public void debug(Marker marker, String s, Throwable throwable) {
+    public void debug(final Marker marker, final String s, final Throwable throwable) {
         if (isDebugEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.DEBUG,
                 new SimpleMessage(s), throwable);
         }
     }
 
-    public void info(String format) {
+    public void info(final String format) {
         if (logger.isInfoEnabled()) {
             logger.log(null, FQCN, Level.INFO, new SimpleMessage(format), null);
         }
     }
 
-    public void info(String format, Object o) {
+    public void info(final String format, final Object o) {
         if (logger.isInfoEnabled()) {
             logger.log(null, FQCN, Level.INFO, new ParameterizedMessage(format, o), null);
         }
     }
 
-    public void info(String format, Object arg1, Object arg2) {
+    public void info(final String format, final Object arg1, final Object arg2) {
         if (logger.isInfoEnabled()) {
-            ParameterizedMessage msg = new ParameterizedMessage(format, arg1, arg2);
+            final ParameterizedMessage msg = new ParameterizedMessage(format, arg1, arg2);
             logger.log(null, FQCN, Level.INFO, msg, msg.getThrowable());
         }
     }
 
-    public void info(String format, Object[] args) {
+    public void info(final String format, final Object[] args) {
         if (logger.isInfoEnabled()) {
-            ParameterizedMessage msg = new ParameterizedMessage(format, args);
+            final ParameterizedMessage msg = new ParameterizedMessage(format, args);
             logger.log(null, FQCN, Level.INFO, msg, msg.getThrowable());
         }
     }
 
-    public void info(String format, Throwable t) {
+    public void info(final String format, final Throwable t) {
         if (logger.isInfoEnabled()) {
             logger.log(null, FQCN, Level.INFO, new SimpleMessage(format), t);
         }
@@ -234,71 +234,71 @@ public class SLF4JLogger implements Loca
         return logger.isInfoEnabled();
     }
 
-    public boolean isInfoEnabled(Marker marker) {
+    public boolean isInfoEnabled(final Marker marker) {
         return logger.isInfoEnabled((org.apache.logging.log4j.Marker) marker);
     }
 
-    public void info(Marker marker, String s) {
+    public void info(final Marker marker, final String s) {
         if (isInfoEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.INFO, new SimpleMessage(s),
null);
         }
     }
 
-    public void info(Marker marker, String s, Object o) {
+    public void info(final Marker marker, final String s, final Object o) {
         if (isInfoEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.INFO,
                 new ParameterizedMessage(s, o), null);
         }
     }
 
-    public void info(Marker marker, String s, Object o, Object o1) {
+    public void info(final Marker marker, final String s, final Object o, final Object o1)
{
         if (isInfoEnabled(marker)) {
-            ParameterizedMessage msg = new ParameterizedMessage(s, o, o1);
+            final ParameterizedMessage msg = new ParameterizedMessage(s, o, o1);
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.INFO, msg, msg.getThrowable());
         }
     }
 
-    public void info(Marker marker, String s, Object[] objects) {
+    public void info(final Marker marker, final String s, final Object[] objects) {
         if (isInfoEnabled(marker)) {
-            ParameterizedMessage msg = new ParameterizedMessage(s, objects);
+            final ParameterizedMessage msg = new ParameterizedMessage(s, objects);
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.INFO, msg, msg.getThrowable());
         }
     }
 
-    public void info(Marker marker, String s, Throwable throwable) {
+    public void info(final Marker marker, final String s, final Throwable throwable) {
         if (isInfoEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.INFO,
                 new SimpleMessage(s), throwable);
         }
     }
 
-    public void warn(String format) {
+    public void warn(final String format) {
         if (logger.isWarnEnabled()) {
             logger.log(null, FQCN, Level.WARN, new SimpleMessage(format), null);
         }
     }
 
-    public void warn(String format, Object o) {
+    public void warn(final String format, final Object o) {
         if (logger.isWarnEnabled()) {
             logger.log(null, FQCN, Level.WARN, new ParameterizedMessage(format, o), null);
         }
     }
 
-    public void warn(String format, Object arg1, Object arg2) {
+    public void warn(final String format, final Object arg1, final Object arg2) {
         if (logger.isWarnEnabled()) {
-            ParameterizedMessage msg = new ParameterizedMessage(format, arg1, arg2);
+            final ParameterizedMessage msg = new ParameterizedMessage(format, arg1, arg2);
             logger.log(null, FQCN, Level.WARN, msg, msg.getThrowable());
         }
     }
 
-    public void warn(String format, Object[] args) {
+    public void warn(final String format, final Object[] args) {
         if (logger.isWarnEnabled()) {
-            ParameterizedMessage msg = new ParameterizedMessage(format, args);
+            final ParameterizedMessage msg = new ParameterizedMessage(format, args);
             logger.log(null, FQCN, Level.WARN, msg, msg.getThrowable());
         }
     }
 
-    public void warn(String format, Throwable t) {
+    public void warn(final String format, final Throwable t) {
         if (logger.isWarnEnabled()) {
             logger.log(null, FQCN, Level.WARN, new SimpleMessage(format), t);
         }
@@ -308,71 +308,71 @@ public class SLF4JLogger implements Loca
         return logger.isWarnEnabled();
     }
 
-    public boolean isWarnEnabled(Marker marker) {
+    public boolean isWarnEnabled(final Marker marker) {
         return logger.isWarnEnabled((org.apache.logging.log4j.Marker) marker);
     }
 
-    public void warn(Marker marker, String s) {
+    public void warn(final Marker marker, final String s) {
         if (isWarnEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.WARN, new SimpleMessage(s),
null);
         }
     }
 
-    public void warn(Marker marker, String s, Object o) {
+    public void warn(final Marker marker, final String s, final Object o) {
         if (isWarnEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.WARN,
                 new ParameterizedMessage(s, o), null);
         }
     }
 
-    public void warn(Marker marker, String s, Object o, Object o1) {
+    public void warn(final Marker marker, final String s, final Object o, final Object o1)
{
         if (isWarnEnabled(marker)) {
-            ParameterizedMessage msg = new ParameterizedMessage(s, o, o1);
+            final ParameterizedMessage msg = new ParameterizedMessage(s, o, o1);
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.WARN, msg, msg.getThrowable());
         }
     }
 
-    public void warn(Marker marker, String s, Object[] objects) {
+    public void warn(final Marker marker, final String s, final Object[] objects) {
         if (isWarnEnabled(marker)) {
-            ParameterizedMessage msg = new ParameterizedMessage(s, objects);
+            final ParameterizedMessage msg = new ParameterizedMessage(s, objects);
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.WARN, msg, msg.getThrowable());
         }
     }
 
-    public void warn(Marker marker, String s, Throwable throwable) {
+    public void warn(final Marker marker, final String s, final Throwable throwable) {
         if (isWarnEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.WARN,
                 new SimpleMessage(s), throwable);
         }
     }
 
-    public void error(String format) {
+    public void error(final String format) {
         if (logger.isErrorEnabled()) {
             logger.log(null, FQCN, Level.ERROR, new SimpleMessage(format), null);
         }
     }
 
-    public void error(String format, Object o) {
+    public void error(final String format, final Object o) {
         if (logger.isErrorEnabled()) {
             logger.log(null, FQCN, Level.ERROR, new ParameterizedMessage(format, o), null);
         }
     }
 
-    public void error(String format, Object arg1, Object arg2) {
+    public void error(final String format, final Object arg1, final Object arg2) {
         if (logger.isErrorEnabled()) {
-            ParameterizedMessage msg = new ParameterizedMessage(format, arg1, arg2);
+            final ParameterizedMessage msg = new ParameterizedMessage(format, arg1, arg2);
             logger.log(null, FQCN, Level.ERROR, msg, msg.getThrowable());
         }
     }
 
-    public void error(String format, Object[] args) {
+    public void error(final String format, final Object[] args) {
         if (logger.isErrorEnabled()) {
-            ParameterizedMessage msg = new ParameterizedMessage(format, args);
+            final ParameterizedMessage msg = new ParameterizedMessage(format, args);
             logger.log(null, FQCN, Level.ERROR, msg, msg.getThrowable());
         }
     }
 
-    public void error(String format, Throwable t) {
+    public void error(final String format, final Throwable t) {
         if (logger.isErrorEnabled()) {
             logger.log(null, FQCN, Level.ERROR, new SimpleMessage(format), t);
         }
@@ -382,38 +382,38 @@ public class SLF4JLogger implements Loca
         return logger.isErrorEnabled();
     }
 
-    public boolean isErrorEnabled(Marker marker) {
+    public boolean isErrorEnabled(final Marker marker) {
         return logger.isErrorEnabled((org.apache.logging.log4j.Marker) marker);
     }
 
-    public void error(Marker marker, String s) {
+    public void error(final Marker marker, final String s) {
         if (isErrorEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.ERROR, new SimpleMessage(s),
null);
         }
     }
 
-    public void error(Marker marker, String s, Object o) {
+    public void error(final Marker marker, final String s, final Object o) {
         if (isErrorEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.ERROR,
                 new ParameterizedMessage(s, o), null);
         }
     }
 
-    public void error(Marker marker, String s, Object o, Object o1) {
+    public void error(final Marker marker, final String s, final Object o, final Object o1)
{
         if (isErrorEnabled(marker)) {
-            ParameterizedMessage msg = new ParameterizedMessage(s, o, o1);
+            final ParameterizedMessage msg = new ParameterizedMessage(s, o, o1);
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.ERROR, msg,
msg.getThrowable());
         }
     }
 
-    public void error(Marker marker, String s, Object[] objects) {
+    public void error(final Marker marker, final String s, final Object[] objects) {
         if (isErrorEnabled(marker)) {
-            ParameterizedMessage msg = new ParameterizedMessage(s, objects);
+            final ParameterizedMessage msg = new ParameterizedMessage(s, objects);
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.ERROR, msg,
msg.getThrowable());
         }
     }
 
-    public void error(Marker marker, String s, Throwable throwable) {
+    public void error(final Marker marker, final String s, final Throwable throwable) {
         if (isErrorEnabled(marker)) {
             logger.log((org.apache.logging.log4j.Marker) marker, FQCN, Level.ERROR,
                 new SimpleMessage(s), throwable);
@@ -421,25 +421,25 @@ public class SLF4JLogger implements Loca
     }
 
 
-    public void log(Marker marker, String fqcn, int i, String s1, Object[] objects, Throwable
throwable) {
+    public void log(final Marker marker, final String fqcn, final int i, final String s1,
final Object[] objects, Throwable throwable) {
         if (!logger.isEnabled(getLevel(i), (org.apache.logging.log4j.Marker) marker, s1))
{
             return;
         }
         Message msg;
         if (eventLogger && marker != null && marker.contains(EVENT_MARKER))
{
             try {
-                EventData data = (objects != null && objects[0] instanceof EventData)
? (EventData) objects[0] :
+                final EventData data = (objects != null && objects[0] instanceof
EventData) ? (EventData) objects[0] :
                     new EventData(s1);
                 msg = new StructuredDataMessage(data.getEventId(), data.getMessage(), data.getEventType());
-                for (Map.Entry entry : data.getEventMap().entrySet()) {
-                    String key = entry.getKey().toString();
+                for (final Map.Entry entry : data.getEventMap().entrySet()) {
+                    final String key = entry.getKey().toString();
                     if (EventData.EVENT_TYPE.equals(key) || EventData.EVENT_ID.equals(key)
||
                         EventData.EVENT_MESSAGE.equals(key)) {
                         continue;
                     }
                     ((StructuredDataMessage) msg).put(entry.getKey().toString(), entry.getValue().toString());
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 msg = new ParameterizedMessage(s1, objects, throwable);
             }
 
@@ -458,7 +458,7 @@ public class SLF4JLogger implements Loca
         return name;
     }
 
-    private Level getLevel(int i) {
+    private Level getLevel(final int i) {
 
         switch (i) {
             case TRACE_INT :

Modified: logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java
(original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java
Mon Dec 10 19:36:06 2012
@@ -60,7 +60,7 @@ public class LoggerTest {
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
-        Configuration config = ctx.getConfiguration();
+        final Configuration config = ctx.getConfiguration();
     }
 
     @AfterClass
@@ -99,7 +99,7 @@ public class LoggerTest {
     public void catching() {
         try {
             throw new NullPointerException();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             xlogger.catching(e);
             verify("List", "o.a.l.s.LoggerTest catching MDC{}" + LINE_SEP);
         }
@@ -142,7 +142,7 @@ public class LoggerTest {
 
     @Test
     public void testRootLogger() {
-        Logger l = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        final Logger l = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
         assertNotNull("No Root Logger", l);
         assertEquals(Logger.ROOT_LOGGER_NAME, l.getName());
     }
@@ -160,7 +160,7 @@ public class LoggerTest {
         MDC.put("loginId", "JohnDoe");
         MDC.put("ipAddress", "192.168.0.120");
         MDC.put("locale", Locale.US.getDisplayName());
-        EventData data = new EventData();
+        final EventData data = new EventData();
         data.setEventType("Transfer");
         data.setEventId("Audit@18060");
         data.setMessage("Transfer Complete");
@@ -172,15 +172,15 @@ public class LoggerTest {
         verify("EventLogger", "o.a.l.s.LoggerTest Transfer [Audit@18060 Amount=\"200.00\"
FromAccount=\"123457\" ToAccount=\"123456\"] Transfer Complete" + LINE_SEP);
     }
 
-    private void verify(String name, String expected) {
+    private void verify(final String name, final String expected) {
         //LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
-        Map<String, Appender> list = ctx.getConfiguration().getAppenders();
-        Appender listApp = list.get(name);
+        final Map<String, Appender> list = ctx.getConfiguration().getAppenders();
+        final Appender listApp = list.get(name);
         assertNotNull("Missing Appender", listApp);
         assertTrue("Not a ListAppender", listApp instanceof ListAppender);
-        List<String> events = ((ListAppender) listApp).getMessages();
+        final List<String> events = ((ListAppender) listApp).getMessages();
         assertTrue("Incorrect number of messages. Expected 1 Actual " + events.size(), events.size()==
1);
-        String actual = events.get(0);
+        final String actual = events.get(0);
         assertEquals("Incorrect message. Expected " + expected + ". Actual " + actual, expected,
actual);
         ((ListAppender) listApp).clear();
     }
@@ -188,10 +188,10 @@ public class LoggerTest {
     @Before
     public void cleanup()
     {
-        Map<String, Appender> list = ctx.getConfiguration().getAppenders();
-        Appender listApp = list.get("List");
+        final Map<String, Appender> list = ctx.getConfiguration().getAppenders();
+        final Appender listApp = list.get("List");
         ((ListAppender) listApp).clear();
-        Appender eventApp = list.get("EventLogger");
+        final Appender eventApp = list.get("EventLogger");
         ((ListAppender) eventApp).clear();
     }
 }

Modified: logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/MarkerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/MarkerTest.java?rev=1419697&r1=1419696&r2=1419697&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/MarkerTest.java
(original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/MarkerTest.java
Mon Dec 10 19:36:06 2012
@@ -30,11 +30,11 @@ public class MarkerTest {
 
     @Test
     public void testMarker() {
-        org.slf4j.Marker slf4jMarker = org.slf4j.MarkerFactory.getMarker("TEST");
-        org.slf4j.Marker slf4jParent = org.slf4j.MarkerFactory.getMarker("PARENT");
+        final org.slf4j.Marker slf4jMarker = org.slf4j.MarkerFactory.getMarker("TEST");
+        final org.slf4j.Marker slf4jParent = org.slf4j.MarkerFactory.getMarker("PARENT");
         slf4jMarker.add(slf4jParent);
-        Marker log4jParent = MarkerManager.getMarker("PARENT");
-        Marker log4jMarker = MarkerManager.getMarker("TEST", log4jParent);
+        final Marker log4jParent = MarkerManager.getMarker("PARENT");
+        final Marker log4jMarker = MarkerManager.getMarker("TEST", log4jParent);
 
         assertTrue("Incorrect Marker class", slf4jMarker instanceof MarkerWrapper);
         assertTrue("SLF4J Marker doesn't match Log4j Marker", ((MarkerWrapper) slf4jMarker).isInstanceOf(log4jMarker));



Mime
View raw message