Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8139944

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u60, 9
    • 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.

            lancea Lance Andersen
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: