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.
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.