You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Kevin Zhou (JIRA)" <ji...@apache.org> on 2009/04/20 12:08:47 UTC

[jira] Commented: (HARMONY-6160) [classlib][beans] java.beans.XMLEncoder.writeObject(Object o) should not change the inner content of the given object

    [ https://issues.apache.org/jira/browse/HARMONY-6160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700738#action_12700738 ] 

Kevin Zhou commented on HARMONY-6160:
-------------------------------------

HY fails and add one more element to the innerTreeMap.

> [classlib][beans] java.beans.XMLEncoder.writeObject(Object o) should not change the inner content of the given object
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6160
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6160
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M9
>            Reporter: Kevin Zhou
>             Fix For: 5.0M10
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> Given a test case [1], RI passes while HY.
> [1] Test Case:
> public class XMLEncoderTest extends TestCase {
>     public static class MockTreeMapInnerClass extends TreeMap {
>         @Override
>         public Object get(Object key) {
>             Object result = super.get(key);
>             if (result == null) {
>                 result = new TreeMap();
>                 put(key, result);
>             }
>             return result;
>         }
>     }
>     public void test_XMLEncoder_writeObject() {
>         Map<String, TreeMap<String, String>> innerTreeMap = new MockTreeMapInnerClass();
>         TreeMap resultTreeMap = innerTreeMap.get("outKey");
>         resultTreeMap.put("innerKey", "innerValue");
>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>         XMLEncoder xmlEncoder = new XMLEncoder(baos);
>         xmlEncoder.writeObject(innerTreeMap);
>         assertEquals(1, innerTreeMap.size());
>     }
> }

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