You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Eric Jensen (JIRA)" <ji...@apache.org> on 2010/09/30 00:50:38 UTC
[jira] Created: (THRIFT-939) optional binary fields throw NPE on
default byte[] getters
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
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.
[jira] Updated: (THRIFT-939) optional binary fields throw NPE on
default byte[] getters
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryan Duxbury updated THRIFT-939:
---------------------------------
Fix Version/s: 0.5
0.6
> 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.
[jira] Updated: (THRIFT-939) optional binary fields throw NPE on
default byte[] getters
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Commented: (THRIFT-939) optional binary fields throw NPE on
default byte[] getters
Posted by "Mathias Herberts (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12916381#action_12916381 ]
Mathias Herberts commented on THRIFT-939:
-----------------------------------------
Looks Good To Me.
> 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.
[jira] Closed: (THRIFT-939) optional binary fields throw NPE on
default byte[] getters
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryan Duxbury closed THRIFT-939.
--------------------------------
Resolution: Fixed
I just committed this to 0.5 branch and TRUNK.
> 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.