Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 76509 invoked from network); 5 Feb 2007 14:58:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Feb 2007 14:58:26 -0000 Received: (qmail 87388 invoked by uid 500); 5 Feb 2007 14:58:33 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 87370 invoked by uid 500); 5 Feb 2007 14:58: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 87361 invoked by uid 99); 5 Feb 2007 14:58:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Feb 2007 06:58: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; Mon, 05 Feb 2007 06:58:25 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AD1977142D4 for ; Mon, 5 Feb 2007 06:58:05 -0800 (PST) Message-ID: <28763607.1170687485706.JavaMail.jira@brutus> Date: Mon, 5 Feb 2007 06:58:05 -0800 (PST) From: "Andrey Pavlenko (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2875) [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI In-Reply-To: <25060861.1167130521049.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-2875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrey Pavlenko updated HARMONY-2875: ------------------------------------- Attachment: HARMONY-2875-RasterTest.patch HARMONY-2875-BandedSampleModel.patch I've attached the patch for the first test case. In the 2d and 3d cases I think Harmony follows the spec. > [classlib][awt] Compatibility: java.awt.image.Raster.getPixels() thows ArrayIndexOutOfBoundsException on Harmony and works silent on RI > --------------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2875 > URL: https://issues.apache.org/jira/browse/HARMONY-2875 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Ilya Okomin > Priority: Minor > Attachments: HARMONY-2875-BandedSampleModel.patch, HARMONY-2875-RasterTest.patch > > > According to the specification for getPixels(int x,int y, int w, int h, int/float/double[] array) > "An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed." > a)Harmony does not throw ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has integer type while RI does. > b)Harmony throws ArrayIndexOutOfBoundsException if y==Integer.MAX_VALUE and preallocated array has float or double type while RI does not. > Run next Test case to reproduce, it fails on Harmony and successfully passes on RI: > ------------- test.java -------------- > import java.awt.Point; > import java.awt.image.BandedSampleModel; > import java.awt.image.DataBufferByte; > import java.awt.image.Raster; > import junit.framework.TestCase; > import junit.textui.TestRunner; > public class test extends TestCase { > public static void main(String args[]) { > TestRunner.run(test.class); > } > public void testCase1() { > Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4), > new DataBufferByte(new byte[191], 0), > new Point(new Point(28, 43))); > try { > rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new int[] {}); > fail("ArrayIndexOutOfBoundsException should be thrown"); > } catch (ArrayIndexOutOfBoundsException e) { > //expected > } > } > public void testCase2() { > Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4), > new DataBufferByte(new byte[191], 0), > new Point(new Point(28,43))); > rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new float[] {}); > } > public void testCase3() { > Raster rst = Raster.createRaster(new BandedSampleModel(1, 2, 3, 4), > new DataBufferByte(new byte[191], 0), new Point(new Point(28, > 43))); > rst.getPixels(6, Integer.MAX_VALUE, 1, 0, new double[] {}); > } > } > ---------------------------------------- -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.