Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
As discussed in the mailing list, it's more reasonable to throw SerialException instead. Consider following code:
public void testSetBytes() throws Exception {
byte[] buf =
;
byte[] theBytes =
;
SerialBlob serialBlob = new SerialBlob(buf);
serialBlob.setBytes (7, theBytes); // ArrayIndexOutOfBoundsException
serialBlob.setBytes(7, theBytes, 0, 3); // ArrayIndexOutOfBoundsException
serialBlob.setBytes(7, theBytes, 0, 10); // SerialException
}
RI throws ArrayIndexOutOfBoundsException, but according to spec and consistency, it's better throw SerialException.
Harmony won't follow RI's behaviour for this issue. For Harmony implementation details, please refer to Harmony-2835.
The tests are also included in Harmony-2835. Thanks!
Best regards,
Andrew
Attachments
Issue Links
- is related to
-
HARMONY-2835 [classlib][sql] Implementation for SerialBlob.setBytes(long, byte[]) and SerialBlob.setBytes(long, byte[], int, int)
- Closed