logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1436711 - in /logging/log4j/log4j2/trunk: core/src/main/java/org/apache/logging/log4j/core/ core/src/main/java/org/apache/logging/log4j/core/config/ core/src/test/java/org/apache/logging/log4j/core/appender/ core/src/test/java/org/apache/l...
Date Tue, 22 Jan 2013 01:26:20 GMT
Author: ggregory
Date: Tue Jan 22 01:26:19 2013
New Revision: 1436711

URL: http://svn.apache.org/viewvc?rev=1436711&view=rev
Log:
Generics.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/Logger.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/XMLConfigurationTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSQueueTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/JMSTopicTest.java
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketServerTest.java
    logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
    logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAppenderTest.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/Logger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/Logger.java?rev=1436711&r1=1436710&r2=1436711&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/Logger.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/Logger.java
Tue Jan 22 01:26:19 2013
@@ -153,7 +153,7 @@ public class Logger extends AbstractLogg
      * This method is not exposed through the public API and is used primarily for unit testing.
      * @return A Map containing the Appender's name as the key and the Appender as the value.
      */
-    public Map<String, Appender> getAppenders() {
+    public Map<String, Appender<?>> getAppenders() {
          return config.loggerConfig.getAppenders();
     }
 

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=1436711&r1=1436710&r2=1436711&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
Tue Jan 22 01:26:19 2013
@@ -56,7 +56,7 @@ public class LoggerConfig extends Abstra
     private static final long WAIT_TIME = 1000;
 
     private List<AppenderRef> appenderRefs = new ArrayList<AppenderRef>();
-    private final Map<String, AppenderControl> appenders = new ConcurrentHashMap<String,
AppenderControl>();
+    private final Map<String, AppenderControl<?>> appenders = new ConcurrentHashMap<String,
AppenderControl<?>>();
     private final String name;
     private LogEventFactory logEventFactory;
     private Level level;
@@ -168,9 +168,9 @@ public class LoggerConfig extends Abstra
      * Returns all Appenders as a Map.
      * @return a Map with the Appender name as the key and the Appender as the value.
      */
-    public Map<String, Appender> getAppenders() {
-        final Map<String, Appender> map = new HashMap<String, Appender>();
-        for (final Map.Entry<String, AppenderControl> entry : appenders.entrySet())
{
+    public Map<String, Appender<?>> getAppenders() {
+        final Map<String, Appender<?>> map = new HashMap<String, Appender<?>>();
+        for (final Map.Entry<String, AppenderControl<?>> entry : appenders.entrySet())
{
             map.put(entry.getKey(), entry.getValue().getAppender());
         }
         return map;
@@ -181,10 +181,10 @@ public class LoggerConfig extends Abstra
      */
     protected void clearAppenders() {
         waitForCompletion();
-        final Collection<AppenderControl> controls = appenders.values();
-        final Iterator<AppenderControl> iterator = controls.iterator();
+        final Collection<AppenderControl<?>> controls = appenders.values();
+        final Iterator<AppenderControl<?>> iterator = controls.iterator();
         while (iterator.hasNext()) {
-            final AppenderControl ctl = iterator.next();
+            final AppenderControl<?> ctl = iterator.next();
             iterator.remove();
             cleanupFilter(ctl);
         }

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=1436711&r1=1436710&r2=1436711&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
Tue Jan 22 01:26:19 2013
@@ -82,9 +82,9 @@ public class SocketAppenderTest {
 
     @After
     public void teardown() {
-        final Map<String,Appender> map = root.getAppenders();
-        for (final Map.Entry<String, Appender> entry : map.entrySet()) {
-            final Appender app = entry.getValue();
+        final Map<String,Appender<?>> map = root.getAppenders();
+        for (final Map.Entry<String, Appender<?>> entry : map.entrySet()) {
+            final Appender<?> app = entry.getValue();
             root.removeAppender(app);
             app.stop();
         }

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=1436711&r1=1436710&r2=1436711&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
Tue Jan 22 01:26:19 2013
@@ -85,9 +85,9 @@ public class SyslogAppenderTest {
 
     @After
     public void teardown() {
-        final Map<String,Appender> map = root.getAppenders();
-        for (final Map.Entry<String, Appender> entry : map.entrySet()) {
-            final Appender app = entry.getValue();
+        final Map<String,Appender<?>> map = root.getAppenders();
+        for (final Map.Entry<String, Appender<?>> entry : map.entrySet()) {
+            final Appender<?> app = entry.getValue();
             root.removeAppender(app);
             app.stop();
         }

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=1436711&r1=1436710&r2=1436711&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
Tue Jan 22 01:26:19 2013
@@ -81,7 +81,7 @@ public class XMLConfigurationTest {
         final Iterator<Filter> iter = l.getFilters();
         final Filter filter = iter.next();
         assertTrue(filter instanceof ThreadContextMapFilter);
-        final Map<String, Appender> appenders = l.getAppenders();
+        final Map<String, Appender<?>> appenders = l.getAppenders();
         assertNotNull(appenders);
         assertTrue("number of appenders = " + appenders.size(), appenders.size() == 1);
         final Appender a = appenders.get("STDOUT");

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=1436711&r1=1436710&r2=1436711&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
Tue Jan 22 01:26:19 2013
@@ -83,9 +83,9 @@ public class JMSQueueTest {
 
     @After
     public void teardown() {
-        final Map<String,Appender> map = root.getAppenders();
-        for (final Map.Entry<String, Appender> entry : map.entrySet()) {
-            final Appender app = entry.getValue();
+        final Map<String,Appender<?>> map = root.getAppenders();
+        for (final Map.Entry<String, Appender<?>> entry : map.entrySet()) {
+            final Appender<?> app = entry.getValue();
             root.removeAppender(app);
             app.stop();
         }

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=1436711&r1=1436710&r2=1436711&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
Tue Jan 22 01:26:19 2013
@@ -83,9 +83,9 @@ public class JMSTopicTest {
 
     @After
     public void teardown() {
-        final Map<String,Appender> map = root.getAppenders();
-        for (final Map.Entry<String, Appender> entry : map.entrySet()) {
-            final Appender app = entry.getValue();
+        final Map<String,Appender<?>> map = root.getAppenders();
+        for (final Map.Entry<String, Appender<?>> entry : map.entrySet()) {
+            final Appender<?> app = entry.getValue();
             root.removeAppender(app);
             app.stop();
         }

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=1436711&r1=1436710&r2=1436711&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
Tue Jan 22 01:26:19 2013
@@ -79,9 +79,9 @@ public class SocketServerTest {
 
     @After
     public void teardown() {
-        final Map<String,Appender> map = root.getAppenders();
-        for (final Map.Entry<String, Appender> entry : map.entrySet()) {
-            final Appender app = entry.getValue();
+        final Map<String,Appender<?>> map = root.getAppenders();
+        for (final Map.Entry<String, Appender<?>> entry : map.entrySet()) {
+            final Appender<?> app = entry.getValue();
             root.removeAppender(app);
             app.stop();
         }

Modified: logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java?rev=1436711&r1=1436710&r2=1436711&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
(original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAvroManager.java
Tue Jan 22 01:26:19 2013
@@ -132,11 +132,11 @@ public class FlumeAvroManager extends Ab
         String msg = "No Flume agents are available";
         if (client != null) {
             final AvroFlumeEvent avroEvent = new AvroFlumeEvent();
-            avroEvent.body = ByteBuffer.wrap(event.getBody());
-            avroEvent.headers = new HashMap<CharSequence, CharSequence>();
+            avroEvent.setBody(ByteBuffer.wrap(event.getBody()));
+            avroEvent.setHeaders(new HashMap<CharSequence, CharSequence>());
 
             for (final Map.Entry<String, String> entry : event.getHeaders().entrySet())
{
-                avroEvent.headers.put(entry.getKey(), entry.getValue());
+                avroEvent.getHeaders().put(entry.getKey(), entry.getValue());
             }
 
             final List<AvroFlumeEvent> batch = batchSize > 1 ? events.addAndGet(avroEvent,
batchSize) : null;

Modified: logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAppenderTest.java?rev=1436711&r1=1436710&r2=1436711&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAppenderTest.java
(original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAppenderTest.java
Tue Jan 22 01:26:19 2013
@@ -372,8 +372,8 @@ public class FlumeAppenderTest {
 
 
     private void removeAppenders(final Logger logger) {
-        final Map<String,Appender> map = logger.getAppenders();
-        for (final Map.Entry<String, Appender> entry : map.entrySet()) {
+        final Map<String,Appender<?>> map = logger.getAppenders();
+        for (final Map.Entry<String, Appender<?>> entry : map.entrySet()) {
             final Appender app = entry.getValue();
             avroLogger.removeAppender(app);
             app.stop();
@@ -381,7 +381,7 @@ public class FlumeAppenderTest {
     }
 
     private Appender getAppender(final Logger logger, final String name) {
-        final Map<String,Appender> map = logger.getAppenders();
+        final Map<String,Appender<?>> map = logger.getAppenders();
         return map.get(name);
     }
 



Mime
View raw message