You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Benedict (JIRA)" <ji...@apache.org> on 2018/09/06 21:28:00 UTC

[jira] [Commented] (CASSANDRA-14700) AbstractReplicaCollection equals and hash code should throw due to conflict between order sensitive/insensitive uses

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

Benedict commented on CASSANDRA-14700:
--------------------------------------

+1

It's a shame the JUnit Assert methods cannot accept a lambda for {{String}} construction.

If I were nitpicking, I'd suggest maybe a helper method like {{assertElementsEqual}} that avoids duplicating the string construction logic.  But it's not absolutely necessary.

> AbstractReplicaCollection equals and hash code should throw due to conflict between order sensitive/insensitive uses
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-14700
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14700
>             Project: Cassandra
>          Issue Type: Task
>          Components: Core
>            Reporter: Ariel Weisberg
>            Assignee: Ariel Weisberg
>            Priority: Major
>             Fix For: 4.0
>
>
> AbstractReplicaCollection implements equals and hashCode in an order sensitive fashion. It's a bit ambiguous and contextual whether uses of it are actually sensitive to order. Many aren't. It turns out we don't actually use those methods in the database so rather then pick one over the other have it throw UnsupportedOperationException so someone doesn't accidentally get the wrong behavior.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org