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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.2.1
    • Fix Version/s: None
    • Component/s: List
    • Labels:
      None
    • Environment:

      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

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

              Dates

              • Created:
                Updated:
                Resolved: