Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-423

FastArrayList.toString() fails to check for reference to itself

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 3.2.1
    • None
    • List
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            michaelpradel Michael Pradel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: