cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Ellis (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CASSANDRA-1775) SlicePredicate doesn't support the java.lang.Object.equals() method contract
Date Wed, 24 Nov 2010 16:17:15 GMT

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

Jonathan Ellis commented on CASSANDRA-1775:
-------------------------------------------

do we ever actually call .equals on SlicePredicate?

> SlicePredicate doesn't support the java.lang.Object.equals() method contract
> ----------------------------------------------------------------------------
>
>                 Key: CASSANDRA-1775
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1775
>             Project: Cassandra
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 0.6.6
>         Environment: apcahe cassandra 0.6.6
> lib thrift r917130
>            Reporter: Igor Demydenko
>            Priority: Minor
>
> SlicePredicate doesn't support the java.lang.Object.equals() method contract.
> Execute following test:
> {code:title=SlicePredicateTest.java}
> public class SlicePredicateTest {
>     private static final String ENCODING = "UTF-8";
>     private static final String COLUMN_NAME = "ColumnName";
>     @Test
>     public void testEquals() throws Exception {
>         SlicePredicate predicate = new SlicePredicate();
>         predicate.setColumn_names(Arrays.asList(COLUMN_NAME.getBytes(ENCODING)));
>         SlicePredicate predicate2 = new SlicePredicate();
>         predicate2.setColumn_names(Arrays.asList(COLUMN_NAME.getBytes(ENCODING)));
>         SlicePredicate predicate3 = new SlicePredicate();
>         predicate3.setColumn_names(Arrays.asList(COLUMN_NAME.getBytes(ENCODING)));
>         assertFalse(predicate.equals(null)); // not null
>         assertTrue(predicate.equals(predicate)); // reflexivity
>         assertTrue(predicate.equals(predicate2) && predicate2.equals(predicate));
// symmetry
>         assertTrue(predicate.equals(predicate2) && predicate2.equals(predicate3)

>                 && predicate.equals(predicate3)); // transitivity
>     }
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message