Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 22125 invoked from network); 14 Jan 2007 09:37:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jan 2007 09:37:49 -0000 Received: (qmail 20411 invoked by uid 500); 14 Jan 2007 09:37:56 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 20316 invoked by uid 500); 14 Jan 2007 09:37:55 -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 20062 invoked by uid 99); 14 Jan 2007 09:37:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jan 2007 01:37:55 -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; Sun, 14 Jan 2007 01:37:48 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DDC0A7142FC for ; Sun, 14 Jan 2007 01:37:27 -0800 (PST) Message-ID: <13231582.1168767447903.JavaMail.jira@brutus> Date: Sun, 14 Jan 2007 01:37:27 -0800 (PST) From: "Mark Hindess (JIRA)" To: commits@harmony.apache.org Subject: [jira] Resolved: (HARMONY-2689) [classlib][awt] java.awt.image.RescaleOp.getOffsets() throws unexpected IAE if an array has zero legth size. In-Reply-To: <25399213.1166097022555.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-2689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mark Hindess resolved HARMONY-2689. ----------------------------------- Resolution: Fixed Assignee: Mark Hindess Applied patches in r496048. Please confirm they have been applied as expected. > [classlib][awt] java.awt.image.RescaleOp.getOffsets() throws unexpected IAE if an array has zero legth size. > ------------------------------------------------------------------------------------------------------------ > > Key: HARMONY-2689 > URL: https://issues.apache.org/jira/browse/HARMONY-2689 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Ilya Okomin > Assigned To: Mark Hindess > Priority: Minor > Attachments: RescaleOp2689.patch, RescaleOp2689Test.patch > > > There is no mention about any exception in the specification. > Harmony throws IAE for RescaleOp.getOffsets(float[] offsets) if offsets is empty array while RI returns empty array. > The same problem is for getScaleFactors(float[] scaleFactors) method. > -------------- test.java ----------------- > import java.awt.image.*; > import junit.framework.TestCase; > import java.awt.*; > public class test extends TestCase { > public void testcase1() { > RescaleOp res = new RescaleOp(new float[1],new float[2],null); > assertEquals(res.getOffsets(new float[] {}).length, 0); > } > public void testcase2() { > RescaleOp res = new RescaleOp(new float[1],new float[2],null); > assertEquals(res.getScaleFactors(new float[] {}).length, 0); > } > } > -------------------------------------- > Output on RI > ================= > .. > Time: 0 > OK (2 tests) > Output on Harmony_drlvm/j9: > =========================== > .E.E > Time: 0 > There were 2 errors: > 1) testcase1(test)java.lang.ArrayIndexOutOfBoundsException > at java.lang.System.arraycopy(System.java:249) > at java.awt.image.RescaleOp.getOffsets(RescaleOp.java:92) > at test.testcase1(test.java:8) > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) > 2) testcase2(test)java.lang.ArrayIndexOutOfBoundsException > at java.lang.System.arraycopy(System.java:249) > at java.awt.image.RescaleOp.getScaleFactors(RescaleOp.java:83) > at test.testcase2(test.java:12) > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) > FAILURES!!! > Tests run: 2, Failures: 0, Errors: 2 > This issue can be treated as non-bug difference, because it is unclear what is the appropriate result if sizes of given array and sizes of offsets and scaleFactors arrays in RescaleOp object are different. Otherwise, to be compatible with RI I can suggest to use min between argument array and RescaleOp object's array length as length param in j.l.System.arraycopy() call. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira