You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2018/11/23 07:31:00 UTC

[jira] [Updated] (COLLECTIONS-701) StackOverflowError in SetUniqueList.add() when it receives itself

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

Gary Gregory updated COLLECTIONS-701:
-------------------------------------
    Summary: StackOverflowError in SetUniqueList.add() when it receives itself  (was: SetUniqueList.add() crashes due to infinite recursion when it receives itself)

> StackOverflowError in SetUniqueList.add() 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)