harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohanraj Loganathan <mohanra...@gmail.com>
Subject [classlib][luni] HDK's HashSet returns the element in different order compare to RI
Date Fri, 21 Aug 2009 03:03:52 GMT
When i run the testcase[1] i am getting the different output with RI and
HDK. Any thoughts on this.

I dont find anything specific to the order for HashSet mentioned in the
spec.

RI prints : [c, b, e, d]

HDK prints : [b, c, d, e]

HDK prints in Character order. But not sure in what order RI prints. One of
the Maven unit test depicts the same scenario, and it fails with HDK.

[1] Test
    public void test_HashSet() {
        HashSet hashSet = new HashSet();
        hashSet.add("b");
        hashSet.add("e");
        hashSet.add("c");
        hashSet.add("d");
        System.out.println(hashSet);
    }

Thanks and Regards.
Mohan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message