Michael Pradel created COLLECTIONS-423:
------------------------------------------

             Summary: FastArrayList.toString() fails to check for reference to 
itself
                 Key: COLLECTIONS-423
                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-423
             Project: Commons Collections
          Issue Type: Bug
          Components: List
    Affects Versions: 3.2.1
         Environment: All environments
            Reporter: Michael Pradel


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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to