[jira] [Commented] (COLLECTIONS-701) SetUniqueList.add() crashes due to infinite recursion when it receives itself

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (COLLECTIONS-701) SetUniqueList.add() crashes due to infinite recursion when it receives itself

JIRA jira@apache.org

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

ASF GitHub Bot commented on COLLECTIONS-701:
--------------------------------------------

GitHub user drajakumar opened a pull request:

    https://github.com/apache/commons-collections/pull/57

    COLLECTIONS-701 SetUniqueList.add() crashes due to infinite recursion…

    … when it receives itself

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/drajakumar/commons-collections master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-collections/pull/57.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #57
   
----
commit be0cea3c907bb4ab1083384377521942d17e15bd
Author: Don Jeba <donjeba@...>
Date:   2018-11-08T17:36:05Z

    COLLECTIONS-701 SetUniqueList.add() crashes due to infinite recursion when it receives itself

----


> SetUniqueList.add() crashes due to infinite recursion when it receives itself
> -----------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-701
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-701
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2.2
>            Reporter: Shin Hong
>            Priority: Critical
>
> Hi.
> We found that the following test case fails with a StackOverFlowError exception:
> {code:java}
> test() {       
>    SetUniqueList l = new SetUniqueList(new LinkedList<Object>()) ;       
>    l.add((Object) l) ;   
> }{code}
> The add() execution traps into an infinite recursion which crashes the program.
> From the stack trace, we found that the infinite recursion occurs
> at AbstractList.hashCode() since it invokes hashCode() of each of its elements.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)