You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2009/06/26 15:43:07 UTC
[jira] Closed: (HARMONY-4448) XMLEncoded Strings with \n are
decoded incorrectly
[ https://issues.apache.org/jira/browse/HARMONY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Ellison closed HARMONY-4448.
--------------------------------
Verified by Andrew
> 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.