You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/09/19 22:37:54 UTC

DO NOT REPLY [Bug 23201] - [collections] TestObservedBag and TestObservedSet fail under Java 1.3.1

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23201>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23201

[collections] TestObservedBag and TestObservedSet fail under Java 1.3.1





------- Additional Comments From janekdb@yahoo.co.uk  2003-09-19 20:37 -------
I looked into this a (tiny) bit and discovered that the fault is related to an
assumption made in ObservedTestHelper.doTestRemoveIterated(ObservedFactory
factory) about the order of elements returned by the iterator:

        coll.addAll(SIX_SEVEN_LIST);
        LISTENER.preEvent = null;
        LISTENER.postEvent = null;
        Assert.assertEquals(2, coll.size());
        Iterator it = coll.iterator();
        it.next();
        it.next();
        it.remove();
        Assert.assertEquals(1, coll.size());

Here the last element of the collection is removed however the order the
elements returned by the iterator is different between JDK 1.3.1 and JDK 1.4.1.

The order by type is show here:

                       1.3.1    1.4.1     

  ObservedBag          7, 6     6, 7
  ObservedBuffer       6, 7     6, 7
  ObservedCollection   6, 7     6, 7
  ObservedList         6, 7     6, 7
  ObservedSet          7, 6     6, 7