javax.sql.rowset.serial.SerialBlob.getBytes() fails for zero-length blobs

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 8u60, 9
    • Component/s: core-libs
    • x86
    • windows_7

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      There is a bug on line 177 of SerialBlob.java (Java 8 - has been around for a long time though) which incorrectly throws an exception when the blob is of zero length instead of returning a zero length byte array.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      If the length of the blob is zero then the method should return a zero-length byte array.
      ACTUAL -
      SerialException is thrown

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Create a subclass which overloads getBytes() to do an extra check.

            Assignee:
            Lance Andersen
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: