avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1136) Pair.equals returns false positives
Date Mon, 06 Aug 2012 18:38:03 GMT

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

Doug Cutting commented on AVRO-1136:
------------------------------------

This is by design.  Pair is intended for key/value pairs that are ordered by key only.

Perhaps we should make this clearer in the documentation?
                
> Pair.equals returns false positives
> -----------------------------------
>
>                 Key: AVRO-1136
>                 URL: https://issues.apache.org/jira/browse/AVRO-1136
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.1
>            Reporter: Jeremy Lewi
>            Priority: Minor
>
> Here is a test that fails and indicates the bug. pair1.equals(pair2) should return false
because the values aren't the same but it returns true causing the test to fail. This appears
to be a bug in both 1.6.1 and 1.7.1.
> package contrail.avro;
> import static org.junit.Assert.*;
> import org.apache.avro.mapred.Pair;
> import org.junit.Test;
> public class TestAssertEquals {
>   @Test
>   public void test() {
>     Pair<Integer, Integer> pair1 = new Pair<Integer, Integer>(1, 2);
>     Pair<Integer, Integer> pair2 = new Pair<Integer, Integer>(1, 1);
>     assertFalse(pair1.equals(pair2));
>   }
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message