Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-939

optional binary fields throw NPE on default byte[] getters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 0.5
    • 0.5, 0.6
    • Java - Compiler
    • None

    Description

      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)

      Attachments

        1. thrift-939.patch
          2 kB
          Bryan Duxbury

        Activity

          People

            bryanduxbury Bryan Duxbury
            ericcj Eric Jensen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: