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

Julian Hyde commented on CALCITE-2287:
--------------------------------------

I agree with [~zhong.j.yu] about the class-loader problem; or in fact, any 
class that implements {{equals(o)}} by calling {{o.equals(this)}}. I think 
reversing the arguments is dangerous; other classes should not do it, and in 
case they do, neither should we. So I think the best solution is {code}return o 
instanceof List && ((List) o).size() == 2 && Arrays.asList(t0, 
t1).equals(o);{code}

> StackOverflowError from FlatList equals()
> -----------------------------------------
>
>                 Key: CALCITE-2287
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2287
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Zhong Yu
>            Assignee: Julian Hyde
>            Priority: Major
>
> The equals() method of `Flat3List` and `Flat4List` may invoke each other in 
> an infinite loop.
> See also https://issues.apache.org/jira/browse/HIVE-18427
>  
> We found this problem when such lists are used as keys in 
> `RelMetadataQuery.map`; occasionally there are hashcode collisions between 
> `Flat3List` and `Flat4List`, hence their equals() methods will be invoked.



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

Reply via email to