logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1563331 - in /logging/log4j/log4j2/trunk: log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageTest.java src/changes/changes.xml
Date Fri, 31 Jan 2014 23:12:40 GMT
Author: ggregory
Date: Fri Jan 31 23:12:39 2014
New Revision: 1563331

URL: http://svn.apache.org/r1563331
Log:
[LOG4J2-523] LocalizedMessage serialization is broken.

Modified:
    logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageTest.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java?rev=1563331&r1=1563330&r2=1563331&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
Fri Jan 31 23:12:39 2014
@@ -265,6 +265,7 @@ public class LocalizedMessage implements
             stringArgs[i] = obj.toString();
             ++i;
         }
+        out.writeObject(stringArgs);
     }
 
     private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException
{
@@ -273,10 +274,7 @@ public class LocalizedMessage implements
         messagePattern = in.readUTF();
         baseName = in.readUTF();
         final int length = in.readInt();
-        stringArgs = new String[length];
-        for (int i = 0; i < length; ++i) {
-            stringArgs[i] = in.readUTF();
-        }
+        stringArgs = (String[]) in.readObject();
         logger = StatusLogger.getLogger();
         resourceBundle = null;
         argArray = null;

Modified: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageTest.java?rev=1563331&r1=1563330&r2=1563331&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageTest.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageTest.java
Fri Jan 31 23:12:39 2014
@@ -43,7 +43,6 @@ public class LocalizedMessageTest {
         assertEquals("This is test number 1 with string argument Test.", msg.getFormattedMessage());
     }
 
-    @Ignore("org.apache.commons.lang3.SerializationException: java.io.EOFException")
     @Test
     public void testSerializationMessageFormat() {
         final LocalizedMessage msg = new LocalizedMessage("MF", new Locale("en", "US"), "msg1",
new Object[] { "1", "Test" });
@@ -52,7 +51,6 @@ public class LocalizedMessageTest {
         assertEquals("This is test number 1 with string argument Test.", msg2.getFormattedMessage());
     }
 
-    @Ignore("org.apache.commons.lang3.SerializationException: java.io.EOFException")
     @Test
     public void testSerializationStringFormat() {
         final LocalizedMessage msg = new LocalizedMessage("SF", new Locale("en", "US"), "msg1",
new Object[] { "1", "Test" });

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1563331&r1=1563330&r2=1563331&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Fri Jan 31 23:12:39 2014
@@ -21,6 +21,9 @@
   </properties>
   <body>
     <release version="2.0-RC1" date="2014-MM-DD" description="Bug fixes and enhancements">
+      <action issue="LOG4J2-523" dev="ggregory" type="fix">
+        LocalizedMessage serialization is broken.
+      </action>
       <action issue="LOG4J2-385" dev="rpopma" type="fix" due-to="Ace Funk, Porfirio Partida">
         Fixed issues with time-based file rollover (monthly, weekly, hourly and every minute).
       </action>



Mime
View raw message