I know I'm being a bit assine on these issues, but... Despite Sun's documentation of toString on AbstractCollection, it handles the case where an element of the collection is in fact itsself. E.g. the following code: import java.util.*; public class Test { public static void main(String[] args) { ArrayList list = new ArrayList(); list.add(list); System.out.println(list); ArrayList list2 = new ArrayList(); list2.add(list); list.add(list2); System.out.println(list); } } produces on sun: [(this Collection)] <<Stack Overflow error>> and (what should) on IKVM: <<Stack Overflow error>> (what IKVM actually produces is fatal stack overflow error).
Mauve test added and fix checked in.
Subject: Bug 25769 CVSROOT: /cvsroot/classpath Module name: classpath Branch: Changes by: Mark Wielaard <mark@savannah.gnu.org> 06/02/02 13:29:01 Modified files: . : ChangeLog java/util : AbstractCollection.java Log message: Fixes bug #25769 reported by Artemus Harper <subanark@gmail.com> * java/util/AbstractCollection.java (toString): Only use Iterator, check whether collection contains itself. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6250&tr2=1.6251&r1=text&r2=text http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/java/util/AbstractCollection.java.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
Subject: Bug 25769 Author: mark Date: Mon Feb 6 19:18:36 2006 New Revision: 110662 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110662 Log: Backports from 0.21. 2006-01-26 Mark Wielaard <mark@klomp.org> Fixes bug #25970 reported by Michael Kay <mike@saxonica.com> * java/math/BigDecimal.java (compareTo): Don't strip trailing zeros. Add trailing zeros to the fraction of the decimal with the smallest scale. 2006-02-02 Mark Wielaard <mark@klomp.org> Fixes bug #25769 reported by Artemus Harper <subanark@gmail.com> * java/util/AbstractCollection.java (toString): Only use Iterator, check whether collection contains itself. Modified: branches/gcc-4_1-branch/libjava/classpath/ChangeLog.gcj branches/gcc-4_1-branch/libjava/classpath/java/math/BigDecimal.java branches/gcc-4_1-branch/libjava/classpath/java/util/AbstractCollection.java