harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2836) [classlib][sql] RI's SerialBlob.setBytes throws ArrayIndexOutOfBoundsException when array index parameters are invalid.
Date Thu, 21 Dec 2006 13:10:26 GMT
[classlib][sql] RI's SerialBlob.setBytes throws ArrayIndexOutOfBoundsException when array index
parameters are invalid.
-----------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2836
                 URL: http://issues.apache.org/jira/browse/HARMONY-2836
             Project: Harmony
          Issue Type: Bug
          Components: Non-bug differences from RI
            Reporter: Andrew Zhang


As discussed in the mailing list, it's more reasonable to throw SerialException instead. 
Consider following code:
public void testSetBytes() throws Exception {
        byte[] buf = { 1, 2, 3, 4, 5, 6, 7, 8 };
        byte[] theBytes = { 9, 9, 9 };
        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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message