[logback-dev] [Bug 100] Serialization of objectArray in LoggingEvent does not always work

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Tue Mar 4 23:31:57 CET 2008


joern at huxhorn.de changed:

           What    |Removed                     |Added
  Attachment #11 is|0                           |1
           obsolete|                            |

------- Comment #6 from joern at huxhorn.de  2008-03-04 23:31 -------
Created an attachment (id=23)
 --> (http://bugzilla.qos.ch/attachment.cgi?id=23&action=view)
arguments serialization and formattedMessage fix

This is a better version of my previous patch (no creation of "null" string).

Additionally, I discovered that formattedMessage was not initialized properly
if the argumentsArray was initialized by the setArgumentArray method instead of
the c'tor.

So all in all I changed the following:
- removed formatting of message from c'tor.
- formattedMessage is initialized lazily in getFormattedMessage.
- before the LoggingEvent is serialized, all arguments that are neither null
nor a String are converted to String. Also, formattedMessage is cleared since
it only occupies space but can be recreated lazily after deserialization.
- added LoggingEventTest containing same tests concerning LoggingEvent
serialization and formattedMessage. Some will fail without the patch applied.

This patch prevents both java.lang.ClassNotFoundExceptions in the deserializer
as well as java.io.NotSerializableExceptions in the serializer.

Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the logback-dev mailing list