Thanks, I've committed the change.

By the way, the trim (and the following check) ensure blank lines aren't 
processed.


-----Original Message-----
From:   Evans Mark-PT1167 [mailto:[EMAIL PROTECTED]
Sent:   Wed 2/16/2005 4:33 PM
To:     'Log4j Users List'
Cc:     
Subject:        Log4j 1.3 XMLDecoder.java bug
Background:  I was losing spaces in messages when using the XMLSocketReceiver.  
I tracked it down to the XMLDecoder.

The decodeEvents(String document) method of XMLDecoder.java in Log4j 1.3 has a 
bug.  The first thing this method does is to trim() the given decode buffer.  
However, that buffer can be a partial XML string, and if the XML string is 
broken in the middle of a field that contains a space, that space will be lost. 
 (Believe me, I'm losing spaces.)

The bug is in log4j 1.3 alpha 6, org.apache.log4j.xml.XMLDecoder.java, line 
184.  The fix is to remove the statement "document = document.trim();".  (I'm 
curious if the trim() was added to solve some other problem.)

--Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to