logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1468521 - in /logging/log4j/log4j2/trunk: api/src/main/java/org/apache/logging/log4j/message/MapMessage.java api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java src/changes/changes.xml
Date Tue, 16 Apr 2013 17:29:42 GMT
Author: rgoers
Date: Tue Apr 16 17:29:42 2013
New Revision: 1468521

URL: http://svn.apache.org/r1468521
Log:
LOG4J2-210 - MapMessage key value was not enclosed in quotes when generating XML

Modified:
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
    logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java?rev=1468521&r1=1468520&r2=1468521&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
Tue Apr 16 17:29:42 2013
@@ -193,7 +193,7 @@ public class MapMessage implements Multi
     public void asXML(final StringBuilder sb) {
         sb.append("<Map>\n");
         for (final Map.Entry<String, String> entry : data.entrySet()) {
-            sb.append("  <Entry key=").append(entry.getKey()).append(">").append(entry.getValue()).append("</Entry>\n");
+            sb.append("  <Entry key=\"").append(entry.getKey()).append("\">").append(entry.getValue()).append("</Entry>\n");
         }
         sb.append("</Map>");
     }

Modified: logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java?rev=1468521&r1=1468520&r2=1468521&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
Tue Apr 16 17:29:42 2013
@@ -43,8 +43,8 @@ public class MapMessageTest {
         msg.put("message", testMsg);
         msg.put("project", "Log4j");
         final String result = msg.getFormattedMessage(new String[]{"XML"});
-        final String expected = "<Map>\n  <Entry key=message>Test message {}</Entry>\n"
+
-            "  <Entry key=project>Log4j</Entry>\n" +
+        final String expected = "<Map>\n  <Entry key=\"message\">Test message
{}</Entry>\n" +
+            "  <Entry key=\"project\">Log4j</Entry>\n" +
             "</Map>";
         assertEquals(expected, result);
     }

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1468521&r1=1468520&r2=1468521&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Tue Apr 16 17:29:42 2013
@@ -23,6 +23,9 @@
 
   <body>
     <release version="2.0-beta5" date="@TBD@" description="Bug fixes and enhancements">
+      <action issue="LOG4J2-210" dev="rgoers" type="fix" due-to="Arkin Yetis">
+        MapMessage was not enclosing key value in quotes when generating XML.
+      </action>
       <action issue="LOG4J2-198" dev="rgoers" type="fix">
         FlumeAvroManager now uses Flume RPCClient.
       </action>



Mime
View raw message