Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-2463

Various Bytes.* functions silently ignore invalid arguments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.90.0
    • util
    • None
    • Reviewed

    Description

      Many functions in hbase.util.Bytes silently ignore invalid arguments.
      For instance, Bytes.toInt(null) deliberately returns -1. There are tons of cases like that.

      • All functions that are given a null pointer should throw an NPE.
      • All functions that are given otherwise invalid arguments should throw an IllegalArgumentException.

      Anyone relying on "special return values" such as -1 for Bytes.toInt(null) is guilty of writing broken code (-1 is a valid return value for toInt!).

      Attachments

        Activity

          People

            tsuna Benoit Sigoure
            tsuna Benoit Sigoure
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: