You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2010/09/30 04:09:35 UTC

[jira] Updated: (THRIFT-939) optional binary fields throw NPE on default byte[] getters

     [ https://issues.apache.org/jira/browse/THRIFT-939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-939:
---------------------------------

    Attachment: thrift-939.patch

This patch adds some tests for this case and includes a fix.

> optional binary fields throw NPE on default byte[] getters
> ----------------------------------------------------------
>
>                 Key: THRIFT-939
>                 URL: https://issues.apache.org/jira/browse/THRIFT-939
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Compiler
>    Affects Versions: 0.5
>            Reporter: Eric Jensen
>            Assignee: Bryan Duxbury
>            Priority: Critical
>             Fix For: 0.5, 0.6
>
>         Attachments: thrift-939.patch
>
>
> As it turns out, the fix for https://issues.apache.org/jira/browse/THRIFT-894 in 0.5.0-rc0 is broken wrt optional binary fields, the BufferFor<Field> methods work fine and return a null ByteBuffer, however the get<Field> will NPE, for example a call to the accessor for the unfilled optional binary field ColumnEntry.data causes:
> java.lang.NullPointerException
>        at org.apache.thrift.TBaseHelper.wrapsFullArray(TBaseHelper.java:256)
>        at org.apache.thrift.TBaseHelper.rightSize(TBaseHelper.java:273)
>        at com.twitter.service.metastore.gen.ColumnEntry.getData(Unknown Source)

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