harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Zhou (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6160) [classlib][beans] java.beans.XMLEncoder.writeObject(Object o) should not change the inner content of the given object
Date Mon, 20 Apr 2009 09:48:47 GMT
[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


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.


Mime
View raw message