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

Nulls in set<string> throw an exception in Java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • 0.3
    • Java - Compiler
    • None

    Description

      From Amit Sudharshan:

      I recently noticed a bug(feature?) in com.facebook.thrift.protocol.TBinaryProtocol.writeString where if it is passed a null pointer it will throw NPE.

      Now, the autogenerated stub code tries to prevent this, however we recently came across a case where we had a Set<String> which contained a "NULL" (legal in java). Thrift tests to see if the set is non-null and implicitely whether it has any elements, both of these pass in this case, and so the null string is passed to the writeString method where we get the NPE.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dreiss David Reiss
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: