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:

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
    }
}


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

Reply via email to