Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 89115 invoked from network); 21 Dec 2006 13:10:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Dec 2006 13:10:47 -0000 Received: (qmail 69219 invoked by uid 500); 21 Dec 2006 13:10:54 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 69199 invoked by uid 500); 21 Dec 2006 13:10:54 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 69172 invoked by uid 99); 21 Dec 2006 13:10:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Dec 2006 05:10:54 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Dec 2006 05:10:46 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 307A17142AD for ; Thu, 21 Dec 2006 05:10:26 -0800 (PST) Message-ID: <28923809.1166706626195.JavaMail.jira@brutus> Date: Thu, 21 Dec 2006 05:10:26 -0800 (PST) From: "Andrew Zhang (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-2836) [classlib][sql] RI's SerialBlob.setBytes throws ArrayIndexOutOfBoundsException when array index parameters are invalid. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [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