harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Li (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-4448) XMLEncoded Strings with \n are decoded incorrectly
Date Mon, 23 Jul 2007 08:17:31 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Leo Li resolved HARMONY-4448.
-----------------------------

    Resolution: Fixed

Fixed at r558543.

Good luck!
Leo.

> XMLEncoded Strings with \n are decoded incorrectly
> --------------------------------------------------
>
>                 Key: HARMONY-4448
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4448
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: M2 on Win x86
>            Reporter: Andrew Cornwall
>            Assignee: Leo Li
>
> XMLEncoded Strings which have a \n in them (such as "hello\nthere") are decoded
> incorrectly.
> The following testcase demonstrates the issue:
> public class Bug126404 {
>     public static void main (String args[]) {
> 	Object object = null;
> 	String encodedString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
> 	"<java version=\"1.5.0\" class=\"java.beans.XMLDecoder\">\n" +
> 	" <string>hello\n" +
> 	"there</string>\n" +
> 	"</java>\n";
> 	byte[] in = encodedString.getBytes();
> 	ByteArrayInputStream inputStream = new ByteArrayInputStream(in);
> 	XMLDecoder decoder = new XMLDecoder(inputStream, "CDS");
> 	try{
> 	    object = decoder.readObject();
> 	}
> 	catch (Exception ex) { 
> 	    ex.printStackTrace();
> 	}
> 	System.out.println(new String(object.toString()));
>     }
> }
> On Sun JDK, this results in:
> hello
> there
> On Harmony M2, this results in:
> there

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message