logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1476703 [2/4] - in /logging/log4j/log4j2/trunk: ./ api/ core/ core/src/main/java/org/apache/logging/log4j/core/appender/ core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/ core/src/main/java/org/apache/logging/log4j/core/ap...
Date Sun, 28 Apr 2013 01:27:29 GMT
Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/DefaultConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/DefaultConfiguration.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/DefaultConfiguration.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/DefaultConfiguration.java Sun Apr 28 01:27:27 2013
@@ -23,6 +23,8 @@ import org.apache.logging.log4j.core.app
 import org.apache.logging.log4j.core.layout.PatternLayout;
 import org.apache.logging.log4j.util.PropertiesUtil;
 
+import java.io.Serializable;
+
 /**
  * The default configuration writes all output to the Console using the default logging level. You configure default
  * logging level by setting the system property "org.apache.logging.log4j.level" to a level name. If you do not
@@ -46,10 +48,10 @@ public class DefaultConfiguration extend
     public DefaultConfiguration() {
 
         setName(DEFAULT_NAME);
-        final Layout layout = PatternLayout.createLayout("%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n",
-            null, null, null);
-        final Appender appender = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "false",
-            "true");
+        final Layout<? extends Serializable> layout =
+                PatternLayout.createLayout("%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n", null, null, null);
+        final Appender<? extends Serializable> appender =
+                ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "false", "true");
         appender.start();
         addAppender(appender);
         final LoggerConfig root = getRootLogger();

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/JSONConfiguration.java Sun Apr 28 01:27:27 2013
@@ -120,7 +120,8 @@ public class JSONConfiguration extends B
                     final String advertiserString = getSubst().replace(entry.getValue());
                     if (advertiserString != null)
                     {
-                        final PluginType type = getPluginManager().getPluginType(advertiserString);
+                        @SuppressWarnings("unchecked")
+                        final PluginType<Advertiser> type = getPluginManager().getPluginType(advertiserString);
                         if (type != null)
                         {
                             final Class<Advertiser> clazz = type.getPluginClass();

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java Sun Apr 28 01:27:27 2013
@@ -23,21 +23,22 @@ import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.Filter;
 import org.apache.logging.log4j.core.LifeCycle;
+import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.async.AsyncLoggerContextSelector;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+import org.apache.logging.log4j.core.config.plugins.PluginAttr;
 import org.apache.logging.log4j.core.config.plugins.PluginConfiguration;
+import org.apache.logging.log4j.core.config.plugins.PluginElement;
+import org.apache.logging.log4j.core.config.plugins.PluginFactory;
 import org.apache.logging.log4j.core.filter.AbstractFilterable;
 import org.apache.logging.log4j.core.helpers.Constants;
 import org.apache.logging.log4j.core.impl.Log4jLogEvent;
-import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.impl.LogEventFactory;
 import org.apache.logging.log4j.core.lookup.StrSubstitutor;
-import org.apache.logging.log4j.core.config.plugins.Plugin;
-import org.apache.logging.log4j.core.config.plugins.PluginAttr;
-import org.apache.logging.log4j.core.config.plugins.PluginFactory;
-import org.apache.logging.log4j.core.config.plugins.PluginElement;
-import org.apache.logging.log4j.status.StatusLogger;
 import org.apache.logging.log4j.message.Message;
+import org.apache.logging.log4j.status.StatusLogger;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -163,9 +164,9 @@ public class LoggerConfig extends Abstra
      * @param level The Level to use.
      * @param filter A Filter for the Appender reference.
      */
-    public void addAppender(final Appender appender, final Level level,
+    public <T extends Serializable> void addAppender(final Appender<T> appender, final Level level,
             final Filter filter) {
-        appenders.put(appender.getName(), new AppenderControl(appender, level,
+        appenders.put(appender.getName(), new AppenderControl<T>(appender, level,
                 filter));
     }
 

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java Sun Apr 28 01:27:27 2013
@@ -144,7 +144,8 @@ public class XMLConfiguration extends Ba
                     final String advertiserString = getSubst().replace(entry.getValue());
                     if (advertiserString != null)
                     {
-                        final PluginType type = getPluginManager().getPluginType(advertiserString);
+                        @SuppressWarnings("unchecked")
+                        final PluginType<Advertiser> type = getPluginManager().getPluginType(advertiserString);
                         if (type != null)
                         {
                             final Class<Advertiser> clazz = type.getPluginClass();

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/PluginManager.java Sun Apr 28 01:27:27 2013
@@ -135,6 +135,7 @@ public class PluginManager {
      * @param pkgs A comma separated list of package names to scan for plugins. If
      * null the default Log4j package name will be used.
      */
+    @SuppressWarnings("unchecked")
     public void collectPlugins(boolean preLoad, final String pkgs) {
         if (pluginTypeMap.containsKey(type)) {
             plugins = pluginTypeMap.get(type);
@@ -195,6 +196,7 @@ public class PluginManager {
         LOGGER.debug(sb.toString());
     }
 
+    @SuppressWarnings("unchecked")
     private static ConcurrentMap<String, ConcurrentMap<String, PluginType>> decode(final ClassLoader loader) {
         Enumeration<URL> resources;
         try {

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/ResolverUtil.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/ResolverUtil.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/ResolverUtil.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/plugins/ResolverUtil.java Sun Apr 28 01:27:27 2013
@@ -276,8 +276,7 @@ public class ResolverUtil {
 
     private void loadImplementationsInBundle(final Test test, final String packageName) {
         //Do not remove the cast on the next line as removing it will cause a compile error on Java 7.
-        final BundleWiring wiring =
-            (BundleWiring) FrameworkUtil.getBundle(ResolverUtil.class).adapt(BundleWiring.class);
+        final BundleWiring wiring = FrameworkUtil.getBundle(ResolverUtil.class).adapt(BundleWiring.class);
         final Collection<String> list = wiring.listResources(packageName, "*.class",
             BundleWiring.LISTRESOURCES_RECURSE);
         for (final String name : list) {
@@ -300,8 +299,10 @@ public class ResolverUtil {
      */
     private void loadImplementationsInDirectory(final Test test, final String parent, final File location) {
         final File[] files = location.listFiles();
-        StringBuilder builder;
+        if(files == null)
+            return;
 
+        StringBuilder builder;
         for (final File file : files) {
             builder = new StringBuilder();
             builder.append(parent).append("/").append(file.getName());
@@ -434,14 +435,17 @@ public class ResolverUtil {
      * Test against a Class.
      */
     public abstract static class ClassTest implements Test {
+        @Override
         public boolean matches(final URI resource) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public boolean doesMatchClass() {
             return true;
         }
 
+        @Override
         public boolean doesMatchResource() {
             return false;
         }
@@ -451,14 +455,17 @@ public class ResolverUtil {
      * Test against a resource.
      */
     public abstract static class ResourceTest implements Test {
+        @Override
         public boolean matches(final Class<?> cls) {
             throw new UnsupportedOperationException();
         }
 
+        @Override
         public boolean doesMatchClass() {
             return false;
         }
 
+        @Override
         public boolean doesMatchResource() {
             return true;
         }
@@ -482,6 +489,7 @@ public class ResolverUtil {
          * @param type The Class to check.
          * @return true if the Class matches.
          */
+        @Override
         public boolean matches(final Class<?> type) {
             return type != null && parent.isAssignableFrom(type);
         }
@@ -509,6 +517,7 @@ public class ResolverUtil {
          * @param type The Class to check.
          * @return true if the Class matches.
          */
+        @Override
         public boolean matches(final Class<?> type) {
             return type != null && type.getName().endsWith(suffix);
         }
@@ -539,6 +548,7 @@ public class ResolverUtil {
          * @param type the Class to match against.
          * @return true if the Classes match.
          */
+        @Override
         public boolean matches(final Class<?> type) {
             return type != null && type.isAnnotationPresent(annotation);
         }
@@ -557,6 +567,7 @@ public class ResolverUtil {
 
         public NameIs(final String name) { this.name = "/" + name; }
 
+        @Override
         public boolean matches(final URI resource) {
             return resource.getPath().endsWith(name);
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java Sun Apr 28 01:27:27 2013
@@ -511,8 +511,8 @@ public class ThrowableProxy extends Thro
     private ThrowableProxy[] getSuppressedProxies() {
         if (getSuppressed != null) {
             try {
-                return (ThrowableProxy[]) getSuppressed.invoke(this, null);
-            } catch (final Exception ex) {
+                return (ThrowableProxy[]) getSuppressed.invoke(this);
+            } catch (final Exception ignore) {
                 return null;
             }
         }
@@ -522,11 +522,11 @@ public class ThrowableProxy extends Thro
     private void setSuppressed(final Throwable throwable) {
         if (getSuppressed != null && addSuppressed != null) {
             try {
-                final Throwable[] array = (Throwable[]) getSuppressed.invoke(throwable, null);
+                final Throwable[] array = (Throwable[]) getSuppressed.invoke(throwable);
                 for (final Throwable t : array) {
                     addSuppressed.invoke(this, new ThrowableProxy(t));
                 }
-            } catch (final Exception ex) {
+            } catch (final Exception ignore) {
                 //
             }
         }

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java Sun Apr 28 01:27:27 2013
@@ -46,6 +46,7 @@ public class Interpolator implements Str
         final Map<String, PluginType> plugins = manager.getPlugins();
 
         for (final Map.Entry<String, PluginType> entry : plugins.entrySet()) {
+            @SuppressWarnings("unchecked")
             final Class<StrLookup> clazz = entry.getValue().getPluginClass();
             try {
                 lookups.put(entry.getKey(), clazz.newInstance());
@@ -72,6 +73,7 @@ public class Interpolator implements Str
      * @return the value of this variable or <b>null</b> if it cannot be
      * resolved
      */
+    @Override
     public String lookup(final String var) {
         return lookup(null, var);
     }
@@ -89,6 +91,7 @@ public class Interpolator implements Str
      * @return the value of this variable or <b>null</b> if it cannot be
      * resolved
      */
+    @Override
     public String lookup(final LogEvent event, String var) {
         if (var == null) {
             return null;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/PatternParser.java Sun Apr 28 01:27:27 2013
@@ -16,6 +16,12 @@
  */
 package org.apache.logging.log4j.core.pattern;
 
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.config.Configuration;
+import org.apache.logging.log4j.core.config.plugins.PluginManager;
+import org.apache.logging.log4j.core.config.plugins.PluginType;
+import org.apache.logging.log4j.status.StatusLogger;
+
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.util.ArrayList;
@@ -24,12 +30,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.core.config.plugins.PluginManager;
-import org.apache.logging.log4j.core.config.plugins.PluginType;
-import org.apache.logging.log4j.status.StatusLogger;
-
 /**
  * Most of the work of the {@link org.apache.logging.log4j.core.layout.PatternLayout} class
  * is delegated to the PatternParser class.
@@ -118,7 +118,8 @@ public final class PatternParser {
 
         for (final PluginType type : plugins.values()) {
             try {
-                final Class<PatternConverter> clazz = type.getPluginClass();
+                @SuppressWarnings("unchecked")
+                final Class<PatternConverter> clazz = (Class<PatternConverter>)type.getPluginClass();
                 if (filterClass != null && !filterClass.isAssignableFrom(clazz)) {
                     continue;
                 }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/dumbster/smtp/SimpleSmtpServer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/dumbster/smtp/SimpleSmtpServer.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/dumbster/smtp/SimpleSmtpServer.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/dumbster/smtp/SimpleSmtpServer.java Sun Apr 28 01:27:27 2013
@@ -35,7 +35,7 @@ public class SimpleSmtpServer implements
     /**
      * Stores all of the email received since this instance started up.
      */
-    private final List receivedMail;
+    private final List<SmtpMessage> receivedMail;
 
     /**
      * Default SMTP port is 25.
@@ -68,13 +68,14 @@ public class SimpleSmtpServer implements
      * @param port port number
      */
     public SimpleSmtpServer(final int port) {
-        receivedMail = new ArrayList();
+        receivedMail = new ArrayList<SmtpMessage>();
         this.port = port;
     }
 
     /**
      * Main loop of the SMTP server.
      */
+    @Override
     public void run() {
         stopped = false;
         try {
@@ -112,7 +113,7 @@ public class SimpleSmtpServer implements
            * For higher concurrency, we could just change handle to return void and update the list inside the method
            * to limit the duration that we hold the lock.
            */
-                    final List msgs = handleTransaction(out, input);
+                    final List<SmtpMessage> msgs = handleTransaction(out, input);
                     receivedMail.addAll(msgs);
                 }
                 socket.close();
@@ -163,7 +164,7 @@ public class SimpleSmtpServer implements
      * @return List of SmtpMessage
      * @throws IOException
      */
-    private List handleTransaction(final PrintWriter out, final BufferedReader input) throws IOException {
+    private List<SmtpMessage> handleTransaction(final PrintWriter out, final BufferedReader input) throws IOException {
         // Initialize the state machine
         SmtpState smtpState = SmtpState.CONNECT;
         final SmtpRequest smtpRequest = new SmtpRequest(SmtpActionType.CONNECT, "", smtpState);
@@ -175,7 +176,7 @@ public class SimpleSmtpServer implements
         sendResponse(out, smtpResponse);
         smtpState = smtpResponse.getNextState();
 
-        final List msgList = new ArrayList();
+        final List<SmtpMessage> msgList = new ArrayList<SmtpMessage>();
         SmtpMessage msg = new SmtpMessage();
 
         while (smtpState != SmtpState.CONNECT) {

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/dumbster/smtp/SmtpMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/dumbster/smtp/SmtpMessage.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/dumbster/smtp/SmtpMessage.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/dumbster/smtp/SmtpMessage.java Sun Apr 28 01:27:27 2013
@@ -30,7 +30,7 @@ public class SmtpMessage {
     /**
      * Headers: Map of List of String hashed on header name.
      */
-    private final Map headers;
+    private final Map<String, List<String>> headers;
     /**
      * Message body.
      */
@@ -40,7 +40,7 @@ public class SmtpMessage {
      * Constructor. Initializes headers Map and body buffer.
      */
     public SmtpMessage() {
-        headers = new HashMap(10);
+        headers = new HashMap<String, List<String>>(10);
         body = new StringBuffer();
     }
 
@@ -82,11 +82,11 @@ public class SmtpMessage {
      * @return value(s) associated with the header name
      */
     public String[] getHeaderValues(final String name) {
-        final List values = (List) headers.get(name);
+        final List<String> values = headers.get(name);
         if (values == null) {
             return new String[0];
         } else {
-            return (String[]) values.toArray(new String[0]);
+            return values.toArray(new String[values.size()]);
         }
     }
 
@@ -97,12 +97,12 @@ public class SmtpMessage {
      * @return first value associated with the header name
      */
     public String getHeaderValue(final String name) {
-        final List values = (List) headers.get(name);
+        final List<String> values = headers.get(name);
         if (values == null) {
             return null;
         } else {
-            final Iterator iterator = values.iterator();
-            return (String) iterator.next();
+            final Iterator<String> iterator = values.iterator();
+            return iterator.hasNext() ? iterator.next() : null;
         }
     }
 
@@ -122,9 +122,9 @@ public class SmtpMessage {
      * @param value header value
      */
     private void addHeader(final String name, final String value) {
-        List valueList = (List) headers.get(name);
+        List<String> valueList = headers.get(name);
         if (valueList == null) {
-            valueList = new ArrayList(1);
+            valueList = new ArrayList<String>(1);
             headers.put(name, valueList);
         }
         valueList.add(value);
@@ -137,12 +137,11 @@ public class SmtpMessage {
      */
     @Override
     public String toString() {
-        final StringBuffer msg = new StringBuffer();
-        for (final Iterator i = headers.keySet().iterator(); i.hasNext(); ) {
-            final String name = (String) i.next();
-            final List values = (List) headers.get(name);
-            for (final Iterator j = values.iterator(); j.hasNext(); ) {
-                final String value = (String) j.next();
+        final StringBuilder msg = new StringBuilder();
+        for (final Map.Entry<String, List<String>> entry : headers.entrySet()) {
+            String name = entry.getKey();
+            List<String> values = entry.getValue();
+            for (String value : values) {
                 msg.append(name);
                 msg.append(": ");
                 msg.append(value);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java Sun Apr 28 01:27:27 2013
@@ -40,20 +40,21 @@ public class AppenderRefLevelTest {
 
     private static final String CONFIG = "log4j-reference-level.xml";
     private static Configuration config;
-    private static ListAppender app1;
-    private static ListAppender app2;
+    private static ListAppender<LogEvent> app1;
+    private static ListAppender<LogEvent> app2;
     private static LoggerContext ctx;
 
     @BeforeClass
+    @SuppressWarnings("unchecked")
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("LIST1")) {
-                app1 = (ListAppender) entry.getValue();
+                app1 = (ListAppender<LogEvent>) entry.getValue();
             } else if (entry.getKey().equals("LIST2")) {
-                app2 = (ListAppender) entry.getValue();
+                app2 = (ListAppender<LogEvent>) entry.getValue();
             }
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java Sun Apr 28 01:27:27 2013
@@ -16,16 +16,6 @@
  */
 package org.apache.logging.log4j.core;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.MarkerManager;
 import org.apache.logging.log4j.ThreadContext;
@@ -44,6 +34,14 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import java.io.File;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import static org.junit.Assert.*;
+
 /**
  *
  */
@@ -51,9 +49,9 @@ public class LoggerTest {
 
     private static final String CONFIG = "log4j-test2.xml";
     private static Configuration config;
-    private static ListAppender app;
-    private static ListAppender host;
-    private static ListAppender noThrown;
+    private static ListAppender<LogEvent> app;
+    private static ListAppender<String> host;
+    private static ListAppender<String> noThrown;
     private static LoggerContext ctx;
 
     @BeforeClass
@@ -70,15 +68,16 @@ public class LoggerTest {
     }
 
     @Before
+    @SuppressWarnings("unchecked")
     public void before() {
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<LogEvent>) entry.getValue();
             } else if (entry.getKey().equals("HostTest")) {
-                host = (ListAppender) entry.getValue();
+                host = (ListAppender<String>) entry.getValue();
             } else if (entry.getKey().equals("NoThrowable")) {
-                noThrown = (ListAppender) entry.getValue();
+                noThrown = (ListAppender<String>) entry.getValue();
             }
         }
         assertNotNull("No Appender", app);
@@ -216,7 +215,7 @@ public class LoggerTest {
 
     @Test
     public void mdc() {
-        ThreadContext.put("TestYear", new Integer(2010).toString());
+        ThreadContext.put("TestYear", "2010");
         logger.debug("Debug message");
         ThreadContext.clear();
         logger.debug("Debug message");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/StrictXMLConfigTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/StrictXMLConfigTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/StrictXMLConfigTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/StrictXMLConfigTest.java Sun Apr 28 01:27:27 2013
@@ -42,17 +42,18 @@ public class StrictXMLConfigTest {
 
     private static final String CONFIG = "log4j-strict1.xml";
     private static Configuration config;
-    private static ListAppender app;
+    private static ListAppender<LogEvent> app;
     private static LoggerContext ctx;
 
     @BeforeClass
+    @SuppressWarnings("unchecked")
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<LogEvent>) entry.getValue();
                 break;
             }
         }
@@ -132,7 +133,7 @@ public class StrictXMLConfigTest {
     @Test
     public void mdc() {
 
-        ThreadContext.put("TestYear", new Integer(2010).toString());
+        ThreadContext.put("TestYear", "2010");
         logger.debug("Debug message");
         ThreadContext.clear();
         logger.debug("Debug message");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/AsynchAppenderNoLocationTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/AsynchAppenderNoLocationTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/AsynchAppenderNoLocationTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/AsynchAppenderNoLocationTest.java Sun Apr 28 01:27:27 2013
@@ -16,11 +16,6 @@
  */
 package org.apache.logging.log4j.core.appender;
 
-import static org.junit.Assert.*;
-
-import java.util.List;
-import java.util.Map;
-
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.Appender;
@@ -34,23 +29,30 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 /**
  *
  */
 public class AsynchAppenderNoLocationTest {
     private static final String CONFIG = "log4j-asynch-no-location.xml";
     private static Configuration config;
-    private static ListAppender app;
+    private static ListAppender<String> app;
     private static LoggerContext ctx;
 
     @BeforeClass
+    @SuppressWarnings("unchecked")
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<String>) entry.getValue();
                 break;
             }
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/AsynchAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/AsynchAppenderTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/AsynchAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/AsynchAppenderTest.java Sun Apr 28 01:27:27 2013
@@ -41,17 +41,18 @@ import static org.junit.Assert.*;
 public class AsynchAppenderTest {
     private static final String CONFIG = "log4j-asynch.xml";
     private static Configuration config;
-    private static ListAppender app;
+    private static ListAppender<String> app;
     private static LoggerContext ctx;
 
     @BeforeClass
+    @SuppressWarnings("unchecked")
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<String>) entry.getValue();
                 break;
             }
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java Sun Apr 28 01:27:27 2013
@@ -51,8 +51,8 @@ public class ConsoleAppenderTest {
     @Test
     public void testFollow() {
         final PrintStream ps = System.out;
-        final Layout layout = PatternLayout.createLayout(null, null, null, null);
-        final ConsoleAppender app = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "true", "false");
+        final Layout<String> layout = PatternLayout.createLayout(null, null, null, null);
+        final ConsoleAppender<String> app = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "true", "false");
         app.start();
         final LogEvent event = new Log4jLogEvent("TestLogger", null, ConsoleAppenderTest.class.getName(), Level.INFO,
             new SimpleMessage("Test"), null);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java Sun Apr 28 01:27:27 2013
@@ -41,18 +41,19 @@ import static org.junit.Assert.assertNot
 public class FailoverAppenderTest {
     private static final String CONFIG = "log4j-failover.xml";
     private static Configuration config;
-    private static ListAppender app;
-    private static FailOnceAppender foApp;
+    private static ListAppender<LogEvent> app;
+    private static FailOnceAppender<LogEvent> foApp;
     private static LoggerContext ctx;
 
     @BeforeClass
+    @SuppressWarnings("unchecked")
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<LogEvent>) entry.getValue();
             } else if (entry.getKey().equals("Once")) {
                 foApp = (FailOnceAppender) entry.getValue();
             }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java Sun Apr 28 01:27:27 2013
@@ -18,18 +18,16 @@ package org.apache.logging.log4j.core.ap
 
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.core.Layout;
-import org.apache.logging.log4j.core.impl.Log4jLogEvent;
 import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.impl.Log4jLogEvent;
 import org.apache.logging.log4j.core.layout.PatternLayout;
 import org.apache.logging.log4j.message.SimpleMessage;
 import org.junit.After;
-import org.junit.Test;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Test;
 
-import java.io.BufferedInputStream;
 import java.io.BufferedReader;
-import java.io.DataInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
@@ -139,8 +137,8 @@ public class FileAppenderTest {
     }
 
     private static void writer(final boolean lock, final int count, final String name) throws Exception {
-        final Layout layout = PatternLayout.createLayout(PatternLayout.SIMPLE_CONVERSION_PATTERN, null, null, null);
-        final FileAppender app = FileAppender.createAppender(FILENAME, "true", Boolean.toString(lock), "test", "false",
+        final Layout<String> layout = PatternLayout.createLayout(PatternLayout.SIMPLE_CONVERSION_PATTERN, null, null, null);
+        final FileAppender<String> app = FileAppender.createAppender(FILENAME, "true", Boolean.toString(lock), "test", "false",
             "false", "false", layout, null, "false", null, null);
         final Thread t = Thread.currentThread();
         app.start();
@@ -164,10 +162,10 @@ public class FileAppenderTest {
         final String expected = "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{3} \\[[^\\]]*\\] INFO TestLogger - Test";
         final Pattern pattern = Pattern.compile(expected);
         final FileInputStream fis = new FileInputStream(FILENAME);
-        final DataInputStream is = new DataInputStream(new BufferedInputStream(fis));
+        final BufferedReader is = new BufferedReader(new InputStreamReader(fis));
         int counter = 0;
         String str = "";
-        while (is.available() != 0) {
+        while (is.ready()) {
             str = is.readLine();
             //System.out.println(str);
             ++counter;
@@ -196,6 +194,7 @@ public class FileAppenderTest {
             this.lock = lock;
             this.count = count;
         }
+        @Override
         public void run() {
             final Thread thread = Thread.currentThread();
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/OutputStreamAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/OutputStreamAppenderTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/OutputStreamAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/OutputStreamAppenderTest.java Sun Apr 28 01:27:27 2013
@@ -37,8 +37,8 @@ public class OutputStreamAppenderTest {
 
     @Test
     public void testAppender() {
-        final Layout layout = PatternLayout.createLayout(null, null, null, null);
-        final InMemoryAppender app = new InMemoryAppender("test", layout, null, false);
+        final Layout<String> layout = PatternLayout.createLayout(null, null, null, null);
+        final InMemoryAppender<String> app = new InMemoryAppender<String>("test", layout, null, false);
         final LogEvent event = new Log4jLogEvent("TestLogger", null, OutputStreamAppenderTest.class.getName(), Level.INFO,
             new SimpleMessage("Test"), null);
         app.start();

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java Sun Apr 28 01:27:27 2013
@@ -50,7 +50,6 @@ import static org.junit.Assert.fail;
  */
 public class SocketAppenderTest {
 
-    private static final String HOST = "localhost";
     private static final String PORT = "8199";
     private static final String DYN_PORT = "8300";
     private static final String ERROR_PORT = "8301";
@@ -109,7 +108,6 @@ public class SocketAppenderTest {
         root.setAdditive(false);
         root.setLevel(Level.DEBUG);
         root.debug("This is a test message");
-        final Exception parent = new IllegalStateException("Test");
         final Throwable child = new LoggingException("This is a test");
         root.error("Throwing an exception", child);
         root.debug("This is another test message");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java Sun Apr 28 01:27:27 2013
@@ -49,7 +49,6 @@ import static org.junit.Assert.assertTru
  */
 public class SyslogAppenderTest {
 
-    private static final String HOST = "localhost";
     private static final String PORT = "8199";
     private static final int PORTNUM = Integer.parseInt(PORT);
 
@@ -272,7 +271,6 @@ public class SyslogAppenderTest {
                     final byte[] buffer = new byte[4096];
                     final Socket socket = sock.accept();
                     socket.setSoLinger(true, 0);
-                    final StringBuilder sb = new StringBuilder();
                     if (socket != null) {
                         final InputStream in = socket.getInputStream();
                         int i = in.read(buffer, 0, buffer.length);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java Sun Apr 28 01:27:27 2013
@@ -47,20 +47,21 @@ import static org.junit.Assert.assertEqu
 public class RewriteAppenderTest {
     private static final String CONFIG = "log4j-rewrite.xml";
     private static Configuration config;
-    private static ListAppender app;
-    private static ListAppender app2;
+    private static ListAppender<LogEvent> app;
+    private static ListAppender<String> app2;
     private static LoggerContext ctx;
 
     @BeforeClass
+    @SuppressWarnings("unchecked")
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<LogEvent>) entry.getValue();
             } else if (entry.getKey().equals("List2")) {
-                app2 = (ListAppender) entry.getValue();
+                app2 = (ListAppender<String>) entry.getValue();
             }
         }
     }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/TestRewritePolicy.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/TestRewritePolicy.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/TestRewritePolicy.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/TestRewritePolicy.java Sun Apr 28 01:27:27 2013
@@ -27,6 +27,7 @@ import org.apache.logging.log4j.core.imp
 @Plugin(name = "TestRewritePolicy", type = "Core", elementType = "rewritePolicy", printObject = true)
 public class TestRewritePolicy implements RewritePolicy {
 
+    @Override
     public LogEvent rewrite(final LogEvent source) {
 
         return new Log4jLogEvent(source.getLoggerName(), source.getMarker(), source.getFQCN(), source.getLevel(),

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppender2Test.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppender2Test.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppender2Test.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppender2Test.java Sun Apr 28 01:27:27 2013
@@ -43,17 +43,18 @@ import static org.junit.Assert.assertTru
 public class JSONRoutingAppender2Test {
     private static final String CONFIG = "log4j-routing2.json";
     private static Configuration config;
-    private static ListAppender app;
+    private static ListAppender<LogEvent> app;
     private static LoggerContext ctx;
 
     @BeforeClass
+    @SuppressWarnings("unchecked")
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<LogEvent>) entry.getValue();
                 break;
             }
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppenderTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/JSONRoutingAppenderTest.java Sun Apr 28 01:27:27 2013
@@ -43,17 +43,18 @@ import static org.junit.Assert.assertTru
 public class JSONRoutingAppenderTest {
     private static final String CONFIG = "log4j-routing.json";
     private static Configuration config;
-    private static ListAppender app;
+    private static ListAppender<LogEvent> app;
     private static LoggerContext ctx;
 
     @BeforeClass
+    @SuppressWarnings("unchecked")
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<LogEvent>) entry.getValue();
                 break;
             }
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java Sun Apr 28 01:27:27 2013
@@ -43,17 +43,18 @@ import static org.junit.Assert.assertTru
 public class RoutingAppenderTest {
     private static final String CONFIG = "log4j-routing.xml";
     private static Configuration config;
-    private static ListAppender app;
+    private static ListAppender<LogEvent> app;
     private static LoggerContext ctx;
 
     @BeforeClass
+    @SuppressWarnings("unchecked")
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<LogEvent>) entry.getValue();
                 break;
             }
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestDriver.java Sun Apr 28 01:27:27 2013
@@ -16,6 +16,8 @@
  */
 package org.apache.logging.log4j.core.async.perftest;
 
+import org.apache.logging.log4j.core.async.AsyncLoggerContextSelector;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
@@ -24,17 +26,16 @@ import java.io.InputStreamReader;
 import java.nio.CharBuffer;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
-import org.apache.logging.log4j.core.async.AsyncLoggerContextSelector;
-
 /**
  * Runs a sequence of performance tests.
  */
 public class PerfTestDriver {
     static enum WaitStrategy {
         Sleep, Yield, Block
-    };
+    }
 
     /**
      * Defines the setup for a java process running a performance test.
@@ -91,9 +92,7 @@ public class PerfTestDriver {
             args.add("-DAsyncLoggerConfig.WaitStrategy=" + _wait);
             args.add("-DAsyncLogger.WaitStrategy=" + _wait);
             if (_systemProperties != null) {
-                for (String property : _systemProperties) {
-                    args.add(property);
-                }
+                Collections.addAll(args, _systemProperties);
             }
             args.add("-cp");
             args.add(System.getProperty("java.class.path"));
@@ -167,7 +166,7 @@ public class PerfTestDriver {
                     _average += Long.parseLong(parts[i++].split("=")[1]);
                     _pct99 += Long.parseLong(parts[i++].split("=")[1]);
                     _pct99_99 += Long.parseLong(parts[i++].split("=")[1]);
-                    _count += Integer.parseInt(parts[i++].split("=")[1]);
+                    _count += Integer.parseInt(parts[i].split("=")[1]);
                 } else {
                     _throughputRowCount++;
                     String number = line.substring(0, line.indexOf(' '));
@@ -175,7 +174,7 @@ public class PerfTestDriver {
                     totalOps += opsPerSec;
                 }
             }
-            _averageOpsPerSec = totalOps / (int) _throughputRowCount;
+            _averageOpsPerSec = totalOps / _throughputRowCount;
         }
 
         public String toString() {
@@ -294,8 +293,7 @@ public class PerfTestDriver {
             pb.redirectErrorStream(true); // merge System.out and System.err
             long t1 = System.nanoTime();
             // int count = config._threadCount >= 16 ? 2 : repeat;
-            int count = repeat;
-            runPerfTest(count, x++, config, pb);
+            runPerfTest(repeat, x++, config, pb);
             System.out.printf(" took %.1f seconds%n", (System.nanoTime() - t1)
                     / (1000.0 * 1000.0 * 1000.0));
 
@@ -319,7 +317,7 @@ public class PerfTestDriver {
                         (System.nanoTime() - start)
                                 / (60.0 * 1000.0 * 1000.0 * 1000.0));
 
-        printRanking((Setup[]) tests.toArray(new Setup[tests.size()]));
+        printRanking(tests.toArray(new Setup[tests.size()]));
     }
 
     private static void printRanking(Setup[] tests) {
@@ -357,6 +355,7 @@ public class PerfTestDriver {
             final boolean[] stop) {
 
         Thread t = new Thread("OutputWriter") {
+            @Override
             public void run() {
                 BufferedReader in = new BufferedReader(new InputStreamReader(
                         process.getInputStream()));

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestResultFormatter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestResultFormatter.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestResultFormatter.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/async/perftest/PerfTestResultFormatter.java Sun Apr 28 01:27:27 2013
@@ -71,8 +71,7 @@ class PerfTestResultFormatter {
 		char[] tabs = new char[subKeys.size()];
 		Arrays.fill(tabs, '\t');
 		String sep = new String(tabs);
-		sb.append("\tAverage latency" + sep + "99% less than" + sep
-				+ "99.99% less than");
+		sb.append("\tAverage latency").append(sep).append("99% less than").append(sep).append("99.99% less than");
 		sb.append(LF);
 		for (int i = 0; i < 3; i++) {
 			for (String subKey : subKeys) {
@@ -118,7 +117,7 @@ class PerfTestResultFormatter {
 			Map<String, Stats> sub = results.get(key);
 			for (String subKey : sub.keySet()) {
 				Stats stats = sub.get(subKey);
-				sb.append("\t").append((long) stats.throughput);
+				sb.append("\t").append(stats.throughput);
 			}
 			sb.append(LF);
 		}
@@ -172,7 +171,7 @@ class PerfTestResultFormatter {
 		PerfTestResultFormatter fmt = new PerfTestResultFormatter();
 		BufferedReader reader = new BufferedReader(new InputStreamReader(
 				System.in));
-		String line = null;
+		String line;
 		while ((line = reader.readLine()) != null) {
 			fmt.process(line);
 		}

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationTest.java Sun Apr 28 01:27:27 2013
@@ -28,16 +28,14 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import java.io.BufferedInputStream;
-import java.io.DataInputStream;
+import java.io.BufferedReader;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.InputStreamReader;
 import java.util.Iterator;
 import java.util.Map;
 
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
 
 /**
  *
@@ -53,7 +51,7 @@ public class XMLConfigurationTest {
         final LoggerContext ctx = (LoggerContext) LogManager.getContext();
         final Configuration config = ctx.getConfiguration();
         if (config instanceof XMLConfiguration) {
-            final String name = ((XMLConfiguration) config).getName();
+            final String name = config.getName();
             if (name == null || !name.equals("XMLConfigTest")) {
                 ctx.reconfigure();
             }
@@ -104,11 +102,11 @@ public class XMLConfigurationTest {
         fos.close();
         final Logger logger = LogManager.getLogger("org.apache.logging.log4j.test2.Test");
         logger.debug("This is a test");
-        final DataInputStream is = new DataInputStream(new BufferedInputStream(new FileInputStream(LOGFILE)));
+        final BufferedReader is = new BufferedReader(new InputStreamReader(new FileInputStream(LOGFILE)));
         try {
             int count = 0;
             String str = "";
-            while (is.available() != 0) {
+            while (is.ready()) {
                 str = is.readLine();
                 ++count;
             }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLLoggerPropsTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLLoggerPropsTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLLoggerPropsTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLLoggerPropsTest.java Sun Apr 28 01:27:27 2013
@@ -39,10 +39,11 @@ public class XMLLoggerPropsTest {
 
     private static final String CONFIG = "log4j-loggerprops.xml";
     private static Configuration config;
-    private static ListAppender app;
+    private static ListAppender<String> app;
     private static LoggerContext ctx;
 
     @BeforeClass
+    @SuppressWarnings("unchecked")
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         System.setProperty("test", "test");
@@ -50,7 +51,7 @@ public class XMLLoggerPropsTest {
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<String>) entry.getValue();
                 break;
             }
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java Sun Apr 28 01:27:27 2013
@@ -40,18 +40,19 @@ public class BurstFilterTest {
     private static final String CONFIG = "log4j-burst.xml";
 
     private static Configuration config;
-    private static ListAppender app;
+    private static ListAppender<String> app;
     private static BurstFilter filter;
     private static LoggerContext ctx;
 
     @BeforeClass
+    @SuppressWarnings("unchecked")
     public static void setupClass() {
         System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
         ctx = (LoggerContext) LogManager.getContext(false);
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("ListAppender")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<String>) entry.getValue();
                 filter = (BurstFilter) app.getFilter();
                 break;
             }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/MapFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/MapFilterTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/MapFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/MapFilterTest.java Sun Apr 28 01:27:27 2013
@@ -87,7 +87,7 @@ public class MapFilterTest {
         final MapFilter mapFilter = (MapFilter) filter;
         assertFalse("Should not be And filter", mapFilter.isAnd());
         final Map<String, List<String>> map = mapFilter.getMap();
-        assertNotNull("No Map", map == null);
+        assertNotNull("No Map", map);
         assertTrue("No elements in Map", map.size() != 0);
         assertTrue("Incorrect number of elements in Map", map.size() == 1);
         assertTrue("Map does not contain key eventId", map.containsKey("eventId"));
@@ -99,7 +99,8 @@ public class MapFilterTest {
         final Map<String,Appender<?>> appenders = config.getAppenders();
         final Appender app = appenders.get("LIST");
         assertNotNull("No List appender", app);
-        final List<String> msgs = ((ListAppender) app).getMessages();
+        @SuppressWarnings("unchecked")
+        final List<String> msgs = ((ListAppender<String>) app).getMessages();
         assertNotNull("No messages", msgs);
         assertTrue("No messages", msgs.size() > 0);
 

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/StructuredDataFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/StructuredDataFilterTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/StructuredDataFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/StructuredDataFilterTest.java Sun Apr 28 01:27:27 2013
@@ -49,9 +49,9 @@ public class StructuredDataFilterTest {
         msg.put("FromAccount", "211000");
         msg.put("Amount", "1000.00");
         assertTrue(filter.isStarted());
-        assertTrue(filter.filter(null, Level.DEBUG, null, msg, (Throwable)null) == Filter.Result.NEUTRAL);
+        assertTrue(filter.filter(null, Level.DEBUG, null, msg, null) == Filter.Result.NEUTRAL);
         msg.put("ToAccount", "111111");
-        assertTrue(filter.filter(null, Level.ERROR, null, msg, (Throwable)null) == Filter.Result.DENY);
+        assertTrue(filter.filter(null, Level.ERROR, null, msg, null) == Filter.Result.DENY);
         filter = StructuredDataFilter.createFilter(pairs, "or", null, null);
         filter.start();
         msg = new StructuredDataMessage("AccountTransfer@18060", "Transfer Successful", "Audit");
@@ -59,9 +59,9 @@ public class StructuredDataFilterTest {
         msg.put("FromAccount", "211000");
         msg.put("Amount", "1000.00");
         assertTrue(filter.isStarted());
-        assertTrue(filter.filter(null, Level.DEBUG, null, msg, (Throwable)null) == Filter.Result.NEUTRAL);
+        assertTrue(filter.filter(null, Level.DEBUG, null, msg, null) == Filter.Result.NEUTRAL);
         msg.put("ToAccount", "111111");
-        assertTrue(filter.filter(null, Level.ERROR, null, msg, (Throwable)null) == Filter.Result.NEUTRAL);
+        assertTrue(filter.filter(null, Level.ERROR, null, msg, null) == Filter.Result.NEUTRAL);
     }
 
     @Test

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/filter/TimeFilterTest.java Sun Apr 28 01:27:27 2013
@@ -38,7 +38,7 @@ public class TimeFilterTest {
         filter.start();
         assertTrue(filter.isStarted());
         final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("America/LosAngeles"));
-        cal.set(Calendar.HOUR_OF_DAY, 02);
+        cal.set(Calendar.HOUR_OF_DAY, 2);
         long tod = cal.getTimeInMillis();
         LogEvent event = new Log4jLogEvent(null, null, null, null, null, null, null, null, null, null, tod);
         assertTrue(filter.filter(null, Level.ERROR, null, null, (Throwable)null) == Filter.Result.NEUTRAL);
@@ -47,7 +47,7 @@ public class TimeFilterTest {
         tod = cal.getTimeInMillis();
         event = new Log4jLogEvent(null, null, null, null, null, null, null, null, null, null, tod);
         assertTrue(filter.filter(event) == Filter.Result.NEUTRAL);
-        cal.set(Calendar.HOUR_OF_DAY, 04);
+        cal.set(Calendar.HOUR_OF_DAY, 4);
         tod = cal.getTimeInMillis();
         event = new Log4jLogEvent(null, null, null, null, null, null, null, null, null, null, tod);
         assertTrue(filter.filter(event) == Filter.Result.DENY);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/HTMLLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/HTMLLayoutTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/HTMLLayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/HTMLLayoutTest.java Sun Apr 28 01:27:27 2013
@@ -68,7 +68,7 @@ public class HTMLLayoutTest {
 
         // set up appender
         final HTMLLayout layout = HTMLLayout.createLayout("true", null, null, null, "small", null);
-        final ListAppender appender = new ListAppender("List", null, layout, true, false);
+        final ListAppender<String> appender = new ListAppender<String>("List", null, layout, true, false);
         appender.start();
 
         // set appender on root and set level to debug

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=1476703&r1=1476702&r2=1476703&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 Sun Apr 28 01:27:27 2013
@@ -82,7 +82,7 @@ public class RFC5424LayoutTest {
         // set up appender
         final AbstractStringLayout layout = RFC5424Layout.createLayout("Local0", "Event", "3692", "true", "RequestContext",
             null, null, "true", null, "ATM", null, "key1, key2, locale", null, "loginId", null, null, null);
-        final ListAppender appender = new ListAppender("List", null, layout, true, false);
+        final ListAppender<String> appender = new ListAppender<String>("List", null, layout, true, false);
 
         appender.start();
 
@@ -146,7 +146,7 @@ public class RFC5424LayoutTest {
         // set up appender
         final AbstractStringLayout layout = RFC5424Layout.createLayout("Local0", "Event", "3692", "true", "RequestContext",
             null, null, "true", "#012", "ATM", null, "key1, key2, locale", null, "loginId", null, null, null);
-        final ListAppender appender = new ListAppender("List", null, layout, true, false);
+        final ListAppender<String> appender = new ListAppender<String>("List", null, layout, true, false);
 
         appender.start();
 
@@ -209,7 +209,7 @@ public class RFC5424LayoutTest {
         // set up appender
         final AbstractStringLayout layout = RFC5424Layout.createLayout("Local0", "Event", "3692", "true", "RequestContext",
             null, null, "true", null, "ATM", null, "key1, key2, locale", null, "loginId", null, "%xEx", null);
-        final ListAppender appender = new ListAppender("List", null, layout, true, false);
+        final ListAppender<String> appender = new ListAppender<String>("List", null, layout, true, false);
         appender.start();
 
         // set appender on root and set level to debug

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SerializedLayoutTest.java Sun Apr 28 01:27:27 2013
@@ -78,7 +78,7 @@ public class SerializedLayoutTest {
 
         // set up appender
         final SerializedLayout layout = SerializedLayout.createLayout();
-        final ListAppender appender = new ListAppender("List", null, layout, false, true);
+        final ListAppender<LogEvent> appender = new ListAppender<LogEvent>("List", null, layout, false, true);
         appender.start();
 
         // set appender on root and set level to debug

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/SyslogLayoutTest.java Sun Apr 28 01:27:27 2013
@@ -78,7 +78,7 @@ public class SyslogLayoutTest {
         // set up appender
         final SyslogLayout layout = SyslogLayout.createLayout("Local0", "true", null, null);
         //ConsoleAppender appender = new ConsoleAppender("Console", layout);
-        final ListAppender appender = new ListAppender("List", null, layout, true, false);
+        final ListAppender<String> appender = new ListAppender<String>("List", null, layout, true, false);
         appender.start();
 
         // set appender on root and set level to debug

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java Sun Apr 28 01:27:27 2013
@@ -65,7 +65,7 @@ public class XMLLayoutTest {
 
         // set up appender
         final XMLLayout layout = XMLLayout.createLayout("true", "true", "true", null);
-        final ListAppender appender = new ListAppender("List", null, layout, true, false);
+        final ListAppender<String> appender = new ListAppender<String>("List", null, layout, true, false);
         appender.start();
 
         // set appender on root and set level to debug

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueFailoverTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueFailoverTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueFailoverTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueFailoverTest.java Sun Apr 28 01:27:27 2013
@@ -58,7 +58,7 @@ public class JMSQueueFailoverTest {
     private static final String CONFIG = "log4j-jmsqueue-failover.xml";
 
     private static Configuration config;
-    private static ListAppender app;
+    private static ListAppender<LogEvent> app;
     private static LoggerContext ctx;
 
     @BeforeClass
@@ -76,11 +76,12 @@ public class JMSQueueFailoverTest {
     }
 
     @Before
+    @SuppressWarnings("unchecked")
     public void before() {
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<LogEvent>) entry.getValue();
                 break;
             }
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueTest.java Sun Apr 28 01:27:27 2013
@@ -100,7 +100,7 @@ public class JMSQueueTest {
                 QUEUE_NAME, null, null, null, clientFilters, "true");
         appender.start();
         final CompositeFilter serverFilters = CompositeFilter.createFilters(new Filter[]{serverFilter});
-        final ListAppender listApp = new ListAppender("Events", serverFilters, null, false, false);
+        final ListAppender<LogEvent> listApp = new ListAppender<LogEvent>("Events", serverFilters, null, false, false);
         listApp.start();
         final PatternLayout layout = PatternLayout.createLayout("%m %ex%n", null, null, null);
         final ConsoleAppender console = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "false", "true");

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicFailoverTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicFailoverTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicFailoverTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicFailoverTest.java Sun Apr 28 01:27:27 2013
@@ -57,7 +57,7 @@ public class JMSTopicFailoverTest {
     private static final String CONFIG = "log4j-jmstopic-failover.xml";
 
     private static Configuration config;
-    private static ListAppender app;
+    private static ListAppender<LogEvent> app;
     private static LoggerContext ctx;
 
     @BeforeClass
@@ -75,11 +75,12 @@ public class JMSTopicFailoverTest {
     }
 
     @Before
+    @SuppressWarnings("unchecked")
     public void before() {
         config = ctx.getConfiguration();
         for (final Map.Entry<String, Appender<?>> entry : config.getAppenders().entrySet()) {
             if (entry.getKey().equals("List")) {
-                app = (ListAppender) entry.getValue();
+                app = (ListAppender<LogEvent>) entry.getValue();
                 break;
             }
         }

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicTest.java Sun Apr 28 01:27:27 2013
@@ -43,6 +43,7 @@ import org.mockejb.jndi.MockContextFacto
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
+import java.io.Serializable;
 import java.util.List;
 import java.util.Map;
 
@@ -100,10 +101,11 @@ public class JMSTopicTest {
                 TOPIC_NAME, null, null, null, clientFilters, "true");
         appender.start();
         final CompositeFilter serverFilters = CompositeFilter.createFilters(new Filter[]{serverFilter});
-        final ListAppender listApp = new ListAppender("Events", serverFilters, null, false, false);
+        final ListAppender<Serializable> listApp = new ListAppender<Serializable>("Events", serverFilters, null, false, false);
         listApp.start();
         final PatternLayout layout = PatternLayout.createLayout("%m %ex%n", null, null, null);
-        final ConsoleAppender console = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "false", "true");
+        final ConsoleAppender<? extends Serializable> console =
+                ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "false", "true");
         console.start();
         final Logger serverLogger = ctx.getLogger(JMSTopicReceiver.class.getName());
         serverLogger.addAppender(console);

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java Sun Apr 28 01:27:27 2013
@@ -16,6 +16,13 @@
  */
 package org.apache.logging.log4j.core.net;
 
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
+import org.apache.logging.log4j.core.config.XMLConfigurationFactory;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
@@ -27,16 +34,7 @@ import java.util.concurrent.ExecutorServ
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.core.appender.AppenderRuntimeException;
-import org.apache.logging.log4j.core.config.XMLConfigurationFactory;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 public class SocketMessageLossTest {
     private static final int SOCKET_PORT = 5514;
@@ -105,6 +103,7 @@ public class SocketMessageLossTest {
             server = new ServerSocket(SOCKET_PORT);
         }
 
+        @Override
         public InputStream call() throws Exception {
             client = server.accept();
             return client.getInputStream();

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=1476703&r1=1476702&r2=1476703&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 Sun Apr 28 01:27:27 2013
@@ -133,6 +133,7 @@ public class SocketReconnectTest {
             this.list = list;
         }
 
+        @Override
         public void run() {
             ServerSocket server = null;
             client = null;

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketServerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketServerTest.java?rev=1476703&r1=1476702&r2=1476703&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketServerTest.java (original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketServerTest.java Sun Apr 28 01:27:27 2013
@@ -24,10 +24,10 @@ import org.apache.logging.log4j.core.Log
 import org.apache.logging.log4j.core.Logger;
 import org.apache.logging.log4j.core.LoggerContext;
 import org.apache.logging.log4j.core.appender.ConsoleAppender;
-import org.apache.logging.log4j.test.appender.ListAppender;
 import org.apache.logging.log4j.core.appender.SocketAppender;
 import org.apache.logging.log4j.core.filter.AbstractFilter;
 import org.apache.logging.log4j.core.layout.PatternLayout;
+import org.apache.logging.log4j.test.appender.ListAppender;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -35,8 +35,6 @@ import org.junit.Test;
 
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -46,12 +44,9 @@ import static org.junit.Assert.assertTru
  */
 public class SocketServerTest {
 
-    private static final String HOST = "localhost";
     private static final String PORT = "8199";
     private static final int PORTNUM = Integer.parseInt(PORT);
 
-    private static BlockingQueue<LogEvent> list = new ArrayBlockingQueue<LogEvent>(10);
-
     private static SocketServer tcp;
     private static Thread thread;
 
@@ -94,7 +89,7 @@ public class SocketServerTest {
         final SocketAppender appender = SocketAppender.createAppender("localhost", PORT, "tcp", "-1",
             null, "Test", null, null, null, socketFilter, null, null);
         appender.start();
-        final ListAppender listApp = new ListAppender("Events", serverFilter, null, false, false);
+        final ListAppender<LogEvent> listApp = new ListAppender<LogEvent>("Events", serverFilter, null, false, false);
         listApp.start();
         final PatternLayout layout = PatternLayout.createLayout("%m %ex%n", null, null, null);
         final ConsoleAppender console = ConsoleAppender.createAppender(layout, null, "SYSTEM_OUT", "Console", "false", "true");



Mime
View raw message