You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Jingkei Ly (JIRA)" <ji...@apache.org> on 2009/10/15 12:22:31 UTC

[jira] Created: (HARMONY-6354) XMLEncoder does not encode enumerations correctly

XMLEncoder does not encode enumerations correctly
-------------------------------------------------

                 Key: HARMONY-6354
                 URL: https://issues.apache.org/jira/browse/HARMONY-6354
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M11
            Reporter: Jingkei Ly


This is also a bug in the RI of Java 5 (the bug report is here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=50154030) and was only fixed in the RI of Java 6. 

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


[jira] Commented: (HARMONY-6354) XMLEncoder does not encode enumerations correctly

Posted by "Li Jing Qin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767278#action_12767278 ] 

Li Jing Qin commented on HARMONY-6354:
--------------------------------------

RI6 outputs what is expected. RI5 does not.

> XMLEncoder does not encode enumerations correctly
> -------------------------------------------------
>
>                 Key: HARMONY-6354
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6354
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M11
>            Reporter: Jingkei Ly
>
> This is also a bug in the RI of Java 5 (the bug report is here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=50154030) and was only fixed in the RI of Java 6. 

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


[jira] Commented: (HARMONY-6354) XMLEncoder does not encode enumerations correctly

Posted by "Li Jing Qin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767277#action_12767277 ] 

Li Jing Qin commented on HARMONY-6354:
--------------------------------------

It seems like to be a java6 issue.

> XMLEncoder does not encode enumerations correctly
> -------------------------------------------------
>
>                 Key: HARMONY-6354
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6354
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M11
>            Reporter: Jingkei Ly
>
> This is also a bug in the RI of Java 5 (the bug report is here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=50154030) and was only fixed in the RI of Java 6. 

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


[jira] Commented: (HARMONY-6354) XMLEncoder does not encode enumerations correctly

Posted by "Jingkei Ly (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766004#action_12766004 ] 

Jingkei Ly commented on HARMONY-6354:
-------------------------------------

The following demonstrates the problem:

{code}
package test;

import java.beans.XMLEncoder;
import java.io.FileOutputStream;

public class TestEnum {
	public static void main(String[] args) throws Exception {
		FileOutputStream os = new FileOutputStream("test1.xml");
		
		XMLEncoder encoder = new XMLEncoder(os);
		encoder.writeObject(NumbersEnum.ONE);
		encoder.flush();
		encoder.close();
		
	}
}

enum NumbersEnum {
	ONE, TWO;
}
{code}

Running this prints this message to stderr:

Exception during encoding:java.lang.Exception: failed to write expression: NumbersEnum=Class.new();
Continue...

And the bean encoded in test1.xml is:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.5.0" class="java.beans.XMLDecoder">
 <object class="test.NumbersEnum"/>
</java>
{code:xml}

Instead of the expected:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.5.0" class="java.beans.XMLDecoder">
 <object class="java.lang.Enum" method="valueOf">
   <class>test.NumbersEnum</class>
   <string>ONE</string>
 </object>
</java>
{code:xml}

> XMLEncoder does not encode enumerations correctly
> -------------------------------------------------
>
>                 Key: HARMONY-6354
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6354
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M11
>            Reporter: Jingkei Ly
>
> This is also a bug in the RI of Java 5 (the bug report is here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=50154030) and was only fixed in the RI of Java 6. 

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