[jira] [Created] (COLLECTIONS-423) FastArrayList.toString() fails to check for reference to itself

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (COLLECTIONS-423) FastArrayList.toString() fails to check for reference to itself

AD_LB (Jira)
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 | Threaded
Open this post in threaded view
|

[jira] [Commented] (COLLECTIONS-423) FastArrayList.toString() fails to check for reference to itself

AD_LB (Jira)

    [ https://issues.apache.org/jira/browse/COLLECTIONS-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422509#comment-13422509 ]

Thomas Neidhart commented on COLLECTIONS-423:
---------------------------------------------

Hi Michael,

thanks for your bug report. It is unlikely that there will be a 3.2.2 release and the FastArrayList has been dropped for future major releases (currently preparing release 4.0) in favor of CopyOnWriteArrayList which is available from the standard JDK.

Thomas
               

> 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 | Threaded
Open this post in threaded view
|

[jira] [Resolved] (COLLECTIONS-423) FastArrayList.toString() fails to check for reference to itself

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

     [ https://issues.apache.org/jira/browse/COLLECTIONS-423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart resolved COLLECTIONS-423.
-----------------------------------------

    Resolution: Won't Fix
   

> 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
For more information on JIRA, see: http://www.atlassian.com/software/jira