[
https://issues.apache.org/jira/browse/COLLECTIONS-701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17939308#comment-17939308
]
Volodymyr Siedlecki edited comment on COLLECTIONS-701 at 3/28/25 8:17 PM:
--------------------------------------------------------------------------
Hi, just tested, and it's still a problem on 4.5.0-M3.
Ah, I read Hans reply a bit closer: `(so I suspect resolving it would (if at
all possible) require a fix to HashSet).`
There may not be a way to fix this after all.
was (Author: volosied):
Hi, just tested, and it's still a problem on 4.5.0-M3.
> 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
> Fix For: 4.3
>
>
> 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
(v8.20.10#820010)