Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
3.2.1
-
None
-
None
-
All environments
Description
FastArrayList.toString() throws a StackOverflowError when the list contains itself, because toString() is called recursively. In contrast, ArrayList checks for this case and deals with it appropriately. E.g.:
ArrayList l = new FastArrayList();
l.add(l);
l.toString(); // StackOverflowError
But:
ArrayList l = new ArrayList();
l.add(l);
l.toString(); // OK
To be compatible with its superclass, FastArrayList should also consider this special case.