Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 98275 invoked from network); 14 Dec 2006 15:34:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Dec 2006 15:34:26 -0000 Received: (qmail 53157 invoked by uid 500); 14 Dec 2006 15:34:33 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 53132 invoked by uid 500); 14 Dec 2006 15:34:33 -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 53119 invoked by uid 99); 14 Dec 2006 15:34:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2006 07:34:33 -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, 14 Dec 2006 07:33:55 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 343DB7140F6 for ; Thu, 14 Dec 2006 07:33:21 -0800 (PST) Message-ID: <9439910.1166110401211.JavaMail.jira@brutus> Date: Thu, 14 Dec 2006 07:33:21 -0800 (PST) From: "Oleg Khaschansky (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-2712) [classlib][awt][compatibility] java.awt.image.Raster.createBandedRaster(int,int,int,int,int[],int[],Point) throws ArrayIndexOutOfBoundsException while Ri throws NPE 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][awt][compatibility] java.awt.image.Raster.createBandedRaster(int,int,int,int,int[],int[],Point) throws ArrayIndexOutOfBoundsException while Ri throws NPE -------------------------------------------------------------------------------------------------------------------------------------------------------------------- Key: HARMONY-2712 URL: http://issues.apache.org/jira/browse/HARMONY-2712 Project: Harmony Issue Type: Bug Components: Classlib Reporter: Oleg Khaschansky Priority: Trivial RI throws unspecified NPE while Harmony throws specified ArrayIndexOutOfBoundsException. API specification says: "ArrayIndexOutOfBoundsException - if bankIndices or bandOffsets is null". This issue seems to be mostly RI problem. I think it is a non-bug difference from RI. Testcase: import junit.framework.TestCase; import java.awt.Point; import java.awt.image.Raster; import java.awt.image.WritableRaster; import java.awt.image.RasterFormatException; public class test extends TestCase { public void testcase0() { int[] array0 = new int[] {}; int[] array1 =null; Point localPoint = new Point(-17796, 8); try { Raster.createBandedRaster(9,65412,5,-1,array0,array1,localPoint); assertEquals(true, false); } catch (IllegalArgumentException expectedException) { fail(expectedException +" was thrown"); } catch (ArrayIndexOutOfBoundsException expectedException) { System.out.println(expectedException +" was thrown"); assertEquals(true,true); } } } OUTPUT: Harmony+j9 .java.lang.ArrayIndexOutOfBoundsException: bankIndices or bandOffsets is null was thrown Time: 0.031 OK (1 test) ------------------------------------------------------------------------ Harmony+drlvm .java.lang.ArrayIndexOutOfBoundsException: bankIndices or bandOffsets is null was thrown Time: 0.032 OK (1 test) ------------------------------------------------------------------------ RI .E Time: 0.125 There was 1 error: 1) testcase0(test)java.lang.NullPointerException at java.awt.image.Raster.createBandedRaster(Raster.java:362) at test.testcase0(test.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) FAILURES!!! Tests run: 1, Failures: 0, Errors: 1 If array1 is just empty (not null!) RI also throws ArrayIndexOutOfBoundsException while Harmony throws IllegalArgumentException , which is correct. So it's RI's behavior contradicts the spec. -- 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