logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpo...@apache.org
Subject svn commit: r1514231 [4/4] - in /logging/log4j/log4j2/trunk: api/src/main/java/org/apache/logging/log4j/util/ core/src/main/java/org/apache/logging/log4j/core/ core/src/main/java/org/apache/logging/log4j/core/appender/ core/src/main/java/org/apache/log...
Date Thu, 15 Aug 2013 10:47:35 GMT
Modified: logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java?rev=1514231&r1=1514230&r2=1514231&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java
(original)
+++ logging/log4j/log4j2/trunk/samples/flume-common/src/main/java/org/apache/logging/log4j/samples/app/LogEventFactory.java
Thu Aug 15 10:47:33 2013
@@ -44,9 +44,9 @@ public class LogEventFactory {
     private static class AuditProxy implements InvocationHandler {
 
         private final StructuredDataMessage msg;
-        private final Class intrface;
+        private final Class<?> intrface;
 
-        public AuditProxy(final StructuredDataMessage msg, final Class intrface) {
+        public AuditProxy(final StructuredDataMessage msg, final Class<?> intrface)
{
             this.msg = msg;
             this.intrface = intrface;
         }

Modified: logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/EventDataConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/EventDataConverter.java?rev=1514231&r1=1514230&r2=1514231&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/EventDataConverter.java
(original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/EventDataConverter.java
Thu Aug 15 10:47:33 2013
@@ -18,13 +18,13 @@ public class EventDataConverter {
             final EventData data = (objects != null && objects[0] instanceof EventData)
? (EventData) objects[0] :
                 new EventData(s1);
             msg = new StructuredDataMessage(data.getEventId(), data.getMessage(), data.getEventType());
-            for (final Map.Entry entry : data.getEventMap().entrySet()) {
-                final String key = entry.getKey().toString();
+            for (final Map.Entry<String, Object> entry : data.getEventMap().entrySet())
{
+                final String key = entry.getKey();
                 if (EventData.EVENT_TYPE.equals(key) || EventData.EVENT_ID.equals(key) ||
                     EventData.EVENT_MESSAGE.equals(key)) {
                     continue;
                 }
-                ((StructuredDataMessage) msg).put(entry.getKey().toString(), entry.getValue().toString());
+                ((StructuredDataMessage) msg).put(entry.getKey(), String.valueOf(entry.getValue()));
             }
         } catch (final Exception ex) {
             msg = new ParameterizedMessage(s1, objects, throwable);

Modified: logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4jMDCAdapter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4jMDCAdapter.java?rev=1514231&r1=1514230&r2=1514231&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4jMDCAdapter.java
(original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/main/java/org/slf4j/helpers/Log4jMDCAdapter.java
Thu Aug 15 10:47:33 2013
@@ -53,7 +53,7 @@ public class Log4jMDCAdapter implements 
 
     @Override
     @SuppressWarnings("unchecked") // nothing we can do about this, restricted by SLF4J API
-    public void setContextMap(final Map map) {
+    public void setContextMap(@SuppressWarnings("rawtypes") final Map map) {
         ThreadContext.clear();
         for (final Map.Entry<String, String> entry : ((Map<String, String>) map).entrySet())
{
             ThreadContext.put(entry.getKey(), entry.getValue());

Modified: logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java?rev=1514231&r1=1514230&r2=1514231&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java
(original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/LoggerTest.java
Thu Aug 15 10:47:33 2013
@@ -169,14 +169,13 @@ public class LoggerTest {
         verify("EventLogger", "o.a.l.s.LoggerTest Transfer [Audit@18060 Amount=\"200.00\"
FromAccount=\"123457\" ToAccount=\"123456\"] Transfer Complete" + Constants.LINE_SEP);
     }
 
-    @SuppressWarnings("unchecked")
     private void verify(final String name, final String expected) {
         //LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
-        final Map<String, Appender<?>> list = ctx.getConfiguration().getAppenders();
-        final Appender<?> listApp = list.get(name);
+        final Map<String, Appender> list = ctx.getConfiguration().getAppenders();
+        final Appender listApp = list.get(name);
         assertNotNull("Missing Appender", listApp);
         assertTrue("Not a ListAppender", listApp instanceof ListAppender);
-        final List<String> events = ((ListAppender<String>) listApp).getMessages();
+        final List<String> events = ((ListAppender) listApp).getMessages();
         assertTrue("Incorrect number of messages. Expected 1 Actual " + events.size(), events.size()==
1);
         final String actual = events.get(0);
         assertEquals("Incorrect message. Expected " + expected + ". Actual " + actual, expected,
actual);
@@ -186,10 +185,10 @@ public class LoggerTest {
     @Before
     public void cleanup()
     {
-        final Map<String, Appender<?>> list = ctx.getConfiguration().getAppenders();
-        final Appender<?> listApp = list.get("List");
+        final Map<String, Appender> list = ctx.getConfiguration().getAppenders();
+        final Appender listApp = list.get("List");
         ((ListAppender) listApp).clear();
-        final Appender<?> eventApp = list.get("EventLogger");
+        final Appender eventApp = list.get("EventLogger");
         ((ListAppender) eventApp).clear();
     }
 }

Modified: logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/OptionalTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/OptionalTest.java?rev=1514231&r1=1514230&r2=1514231&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/OptionalTest.java
(original)
+++ logging/log4j/log4j2/trunk/slf4j-impl/src/test/java/org/apache/logging/slf4j/OptionalTest.java
Thu Aug 15 10:47:33 2013
@@ -70,14 +70,13 @@ public class OptionalTest {
         verify("EventLogger", "o.a.l.s.OptionalTest This is a test" + Constants.LINE_SEP);
     }
 
-    @SuppressWarnings("unchecked")
     private void verify(final String name, final String expected) {
         //LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
-        final Map<String, Appender<?>> list = ctx.getConfiguration().getAppenders();
-        final Appender<?> listApp = list.get(name);
+        final Map<String, Appender> list = ctx.getConfiguration().getAppenders();
+        final Appender listApp = list.get(name);
         assertNotNull("Missing Appender", listApp);
         assertTrue("Not a ListAppender", listApp instanceof ListAppender);
-        final List<String> events = ((ListAppender<String>) listApp).getMessages();
+        final List<String> events = ((ListAppender) listApp).getMessages();
         assertTrue("Incorrect number of messages. Expected 1 Actual " + events.size(), events.size()==
1);
         final String actual = events.get(0);
         assertEquals("Incorrect message. Expected " + expected + ". Actual " + actual, expected,
actual);
@@ -87,10 +86,10 @@ public class OptionalTest {
     @Before
     public void cleanup()
     {
-        final Map<String, Appender<?>> list = ctx.getConfiguration().getAppenders();
-        final Appender<?> listApp = list.get("List");
+        final Map<String, Appender> list = ctx.getConfiguration().getAppenders();
+        final Appender listApp = list.get("List");
         ((ListAppender) listApp).clear();
-        final Appender<?> eventApp = list.get("EventLogger");
+        final Appender eventApp = list.get("EventLogger");
         ((ListAppender) eventApp).clear();
     }
 }

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1514231&r1=1514230&r2=1514231&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Thu Aug 15 10:47:33 2013
@@ -21,6 +21,9 @@
   </properties>
   <body>
     <release version="2.0-beta9" date="soon, very soon" description="Bug fixes and enhancements">
+      <action issue="LOG4J2-343" dev="rpopma" type="fix" due-to="Henning Schmiedehausen">
+        Removed unnecessary generics from Appender interface and implementing classes.
+      </action>
       <action issue="LOG4J2-351" dev="rpopma" type="fix" due-to="Roland Weiglhofer">
         [OSGi] wrong Fragment-Host in manifest files.
       </action>

Modified: logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/CatchingTagTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/CatchingTagTest.java?rev=1514231&r1=1514230&r2=1514231&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/CatchingTagTest.java
(original)
+++ logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/CatchingTagTest.java
Thu Aug 15 10:47:33 2013
@@ -93,14 +93,13 @@ public class CatchingTagTest {
         verify("catching WARN M-CATCHING[ EXCEPTION ] E java.lang.Error: This is the last
test.");
     }
 
-    @SuppressWarnings("unchecked")
     private void verify(final String expected) {
         final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
-        final Map<String, Appender<?>> list = ctx.getConfiguration().getAppenders();
-        final Appender<?> listApp = list.get("List");
+        final Map<String, Appender> list = ctx.getConfiguration().getAppenders();
+        final Appender listApp = list.get("List");
         assertNotNull("Missing Appender", listApp);
         assertTrue("Not a ListAppender", listApp instanceof ListAppender);
-        final List<String> events = ((ListAppender<String>) listApp).getMessages();
+        final List<String> events = ((ListAppender) listApp).getMessages();
         try
         {
             assertEquals("Incorrect number of messages.", 1, events.size());

Modified: logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/EntryTagTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/EntryTagTest.java?rev=1514231&r1=1514230&r2=1514231&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/EntryTagTest.java
(original)
+++ logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/EntryTagTest.java
Thu Aug 15 10:47:33 2013
@@ -81,14 +81,13 @@ public class EntryTagTest {
         verify("entry params(log4j-test1.xml, 5792) TRACE M-ENTRY[ FLOW ] E");
     }
 
-    @SuppressWarnings("unchecked")
     private void verify(final String expected) {
         final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
-        final Map<String, Appender<?>> list = ctx.getConfiguration().getAppenders();
-        final Appender<?> listApp = list.get("List");
+        final Map<String, Appender> list = ctx.getConfiguration().getAppenders();
+        final Appender listApp = list.get("List");
         assertNotNull("Missing Appender", listApp);
         assertTrue("Not a ListAppender", listApp instanceof ListAppender);
-        final List<String> events = ((ListAppender<String>) listApp).getMessages();
+        final List<String> events = ((ListAppender) listApp).getMessages();
         try
         {
             assertEquals("Incorrect number of messages.", 1, events.size());

Modified: logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/ExitTagTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/ExitTagTest.java?rev=1514231&r1=1514230&r2=1514231&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/ExitTagTest.java
(original)
+++ logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/ExitTagTest.java
Thu Aug 15 10:47:33 2013
@@ -88,14 +88,13 @@ public class ExitTagTest {
         verify("exit with(5792) TRACE M-EXIT[ FLOW ] E");
     }
 
-    @SuppressWarnings("unchecked")
     private void verify(final String expected) {
         final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
-        final Map<String, Appender<?>> list = ctx.getConfiguration().getAppenders();
-        final Appender<?> listApp = list.get("List");
+        final Map<String, Appender> list = ctx.getConfiguration().getAppenders();
+        final Appender listApp = list.get("List");
         assertNotNull("Missing Appender", listApp);
         assertTrue("Not a ListAppender", listApp instanceof ListAppender);
-        final List<String> events = ((ListAppender<String>) listApp).getMessages();
+        final List<String> events = ((ListAppender) listApp).getMessages();
         try
         {
             assertEquals("Incorrect number of messages.", 1, events.size());

Modified: logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/LoggingMessageTagSupportTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/LoggingMessageTagSupportTest.java?rev=1514231&r1=1514230&r2=1514231&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/LoggingMessageTagSupportTest.java
(original)
+++ logging/log4j/log4j2/trunk/taglib/src/test/java/org/apache/logging/log4j/taglib/LoggingMessageTagSupportTest.java
Thu Aug 15 10:47:33 2013
@@ -296,11 +296,11 @@ public class LoggingMessageTagSupportTes
     @SuppressWarnings("unchecked")
     private void verify(final String expected) {
         final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
-        final Map<String, Appender<?>> list = ctx.getConfiguration().getAppenders();
-        final Appender<?> listApp = list.get("List");
+        final Map<String, Appender> list = ctx.getConfiguration().getAppenders();
+        final Appender listApp = list.get("List");
         assertNotNull("Missing Appender", listApp);
         assertTrue("Not a ListAppender", listApp instanceof ListAppender);
-        final List<String> events = ((ListAppender<String>) listApp).getMessages();
+        final List<String> events = ((ListAppender) listApp).getMessages();
         try
         {
             assertEquals("Incorrect number of messages.", 1, events.size());



Mime
View raw message