You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Nathan Marz (JIRA)" <ji...@apache.org> on 2009/11/10 04:33:32 UTC

[jira] Created: (THRIFT-624) compareTo is broken for Unions with binary fields

compareTo is broken for Unions with binary fields
-------------------------------------------------

                 Key: THRIFT-624
                 URL: https://issues.apache.org/jira/browse/THRIFT-624
             Project: Thrift
          Issue Type: Bug
          Components: Compiler (Java)
            Reporter: Nathan Marz


When comparing binary fields, it attempts to do the comparison by casting the objects to "Comparable" resulting in a class cast exception.

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


[jira] Resolved: (THRIFT-624) compareTo is broken for Unions with binary fields

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury resolved THRIFT-624.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.2

I just committed this.

> compareTo is broken for Unions with binary fields
> -------------------------------------------------
>
>                 Key: THRIFT-624
>                 URL: https://issues.apache.org/jira/browse/THRIFT-624
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>            Reporter: Nathan Marz
>            Assignee: Bryan Duxbury
>             Fix For: 0.2
>
>         Attachments: thrift-624-v2.patch, thrift-624.patch
>
>
> When comparing binary fields, it attempts to do the comparison by casting the objects to "Comparable" resulting in a class cast exception.

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


[jira] Updated: (THRIFT-624) compareTo is broken for Unions with binary fields

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-624:
---------------------------------

    Attachment: thrift-624-v2.patch

Hm, looks like there was actually a bug in TBaseHelper for comparing byte[]s. Test coverage for the win.

This patch adds a test for comparing unions with binaries in them and corrects noted bugs in previous patch.

> compareTo is broken for Unions with binary fields
> -------------------------------------------------
>
>                 Key: THRIFT-624
>                 URL: https://issues.apache.org/jira/browse/THRIFT-624
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>            Reporter: Nathan Marz
>            Assignee: Bryan Duxbury
>         Attachments: thrift-624-v2.patch, thrift-624.patch
>
>
> When comparing binary fields, it attempts to do the comparison by casting the objects to "Comparable" resulting in a class cast exception.

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


[jira] Updated: (THRIFT-624) compareTo is broken for Unions with binary fields

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-624:
---------------------------------

    Attachment: thrift-624.patch

This patch makes a special case branch for byte[]s.

> compareTo is broken for Unions with binary fields
> -------------------------------------------------
>
>                 Key: THRIFT-624
>                 URL: https://issues.apache.org/jira/browse/THRIFT-624
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>            Reporter: Nathan Marz
>            Assignee: Bryan Duxbury
>         Attachments: thrift-624.patch
>
>
> When comparing binary fields, it attempts to do the comparison by casting the objects to "Comparable" resulting in a class cast exception.

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


[jira] Commented: (THRIFT-624) compareTo is broken for Unions with binary fields

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776602#action_12776602 ] 

David Reiss commented on THRIFT-624:
------------------------------------

Is this related to THRIFT-226 ?

> compareTo is broken for Unions with binary fields
> -------------------------------------------------
>
>                 Key: THRIFT-624
>                 URL: https://issues.apache.org/jira/browse/THRIFT-624
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>            Reporter: Nathan Marz
>            Assignee: Bryan Duxbury
>         Attachments: thrift-624.patch
>
>
> When comparing binary fields, it attempts to do the comparison by casting the objects to "Comparable" resulting in a class cast exception.

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


[jira] Commented: (THRIFT-624) compareTo is broken for Unions with binary fields

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776608#action_12776608 ] 

Bryan Duxbury commented on THRIFT-624:
--------------------------------------

@Nathan: I see now that I do not have a comparable Union type defined in the test thrift files. I'll fix that.

@David: Yes. If we switched to ByteBuffers, then this wouldn't be an issue.

> compareTo is broken for Unions with binary fields
> -------------------------------------------------
>
>                 Key: THRIFT-624
>                 URL: https://issues.apache.org/jira/browse/THRIFT-624
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>            Reporter: Nathan Marz
>            Assignee: Bryan Duxbury
>         Attachments: thrift-624.patch
>
>
> When comparing binary fields, it attempts to do the comparison by casting the objects to "Comparable" resulting in a class cast exception.

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


[jira] Commented: (THRIFT-624) compareTo is broken for Unions with binary fields

Posted by "Nathan Marz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776599#action_12776599 ] 

Nathan Marz commented on THRIFT-624:
------------------------------------

In java "instanceof" is all lowercase. This seems like a good thing to add a test case for as well.

> compareTo is broken for Unions with binary fields
> -------------------------------------------------
>
>                 Key: THRIFT-624
>                 URL: https://issues.apache.org/jira/browse/THRIFT-624
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>            Reporter: Nathan Marz
>            Assignee: Bryan Duxbury
>         Attachments: thrift-624.patch
>
>
> When comparing binary fields, it attempts to do the comparison by casting the objects to "Comparable" resulting in a class cast exception.

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


[jira] Commented: (THRIFT-624) compareTo is broken for Unions with binary fields

Posted by "Nathan Marz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776633#action_12776633 ] 

Nathan Marz commented on THRIFT-624:
------------------------------------

Looks good.

> compareTo is broken for Unions with binary fields
> -------------------------------------------------
>
>                 Key: THRIFT-624
>                 URL: https://issues.apache.org/jira/browse/THRIFT-624
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>            Reporter: Nathan Marz
>            Assignee: Bryan Duxbury
>         Attachments: thrift-624-v2.patch, thrift-624.patch
>
>
> When comparing binary fields, it attempts to do the comparison by casting the objects to "Comparable" resulting in a class cast exception.

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


[jira] Updated: (THRIFT-624) compareTo is broken for Unions with binary fields

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-624:
---------------------------------

    Patch Info: [Patch Available]

> compareTo is broken for Unions with binary fields
> -------------------------------------------------
>
>                 Key: THRIFT-624
>                 URL: https://issues.apache.org/jira/browse/THRIFT-624
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>            Reporter: Nathan Marz
>            Assignee: Bryan Duxbury
>         Attachments: thrift-624.patch
>
>
> When comparing binary fields, it attempts to do the comparison by casting the objects to "Comparable" resulting in a class cast exception.

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


[jira] Assigned: (THRIFT-624) compareTo is broken for Unions with binary fields

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury reassigned THRIFT-624:
------------------------------------

    Assignee: Bryan Duxbury

> compareTo is broken for Unions with binary fields
> -------------------------------------------------
>
>                 Key: THRIFT-624
>                 URL: https://issues.apache.org/jira/browse/THRIFT-624
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Java)
>            Reporter: Nathan Marz
>            Assignee: Bryan Duxbury
>         Attachments: thrift-624.patch
>
>
> When comparing binary fields, it attempts to do the comparison by casting the objects to "Comparable" resulting in a class cast exception.

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