Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 18000 invoked from network); 2 Jan 2007 14:29:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jan 2007 14:29:25 -0000 Received: (qmail 47886 invoked by uid 500); 2 Jan 2007 14:29:31 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 47858 invoked by uid 500); 2 Jan 2007 14:29:31 -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 47849 invoked by uid 99); 2 Jan 2007 14:29:31 -0000 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; Tue, 02 Jan 2007 06:29:31 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BDE457142D4 for ; Tue, 2 Jan 2007 06:28:32 -0800 (PST) Message-ID: <18069895.1167748111943.JavaMail.jira@brutus> Date: Tue, 2 Jan 2007 06:28:31 -0800 (PST) From: "Andrew Zhang (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-2937) [classlib][sql] SerialBlob.truncate(long length) should not change buffer length is the length parameter is 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] SerialBlob.truncate(long length) should not change buffer length is the length parameter is invalid. -------------------------------------------------------------------------------------------------------------------- Key: HARMONY-2937 URL: http://issues.apache.org/jira/browse/HARMONY-2937 Project: Harmony Issue Type: Bug Components: Non-bug differences from RI Reporter: Andrew Zhang Hi, as discussed in dev mailing list, SerialBlob.truncate(long length) should not change buffer length is the length parameter is invalid. Following test shows the case: public void testTruncateJ() throws Exception { byte[] buf = { 1, 2, 3, 4, 5, 6, 7, 8 }; SerialBlob serialBlob1 = new SerialBlob(buf); try { serialBlob1.truncate(-1); } catch (SerialException e) { System.out.println(e.getMessage()); } System.out.println(serialBlob1.length()); } RI output is as follow: Invalid arguments: position cannot be less that 1 -1 The buffer length is changed to -1 while SerialException is thrown too. Keeping the length as the old value makes more sense. Harmony won't follow RI's behaviour for this case, and keep it as a non-different-bug from RI. 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