Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 32030 invoked from network); 11 Jan 2007 16:38:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jan 2007 16:38:35 -0000 Received: (qmail 89963 invoked by uid 500); 11 Jan 2007 16:38:33 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 89925 invoked by uid 500); 11 Jan 2007 16:38:33 -0000 Mailing-List: contact dev-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 dev@harmony.apache.org Received: (qmail 89870 invoked by uid 99); 11 Jan 2007 16:38:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jan 2007 08:38:33 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [134.134.136.20] (HELO mga02.intel.com) (134.134.136.20) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jan 2007 08:38:21 -0800 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by mga02.intel.com with ESMTP; 11 Jan 2007 08:38:01 -0800 Received: from fmsmsx334.amr.corp.intel.com ([132.233.42.1]) by orsmga001.jf.intel.com with ESMTP; 11 Jan 2007 08:38:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: i="4.13,174,1167638400"; d="scan'208"; a="184006047:sNHT182144718" Received: from mssmsx411.ccr.corp.intel.com ([10.125.2.10]) by fmsmsx334.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 11 Jan 2007 08:37:16 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: [classlib][awt] java.awt.image.Raster.createPackedRaster() throws RasterFormatException on RI while it doesn't on Harmony Date: Thu, 11 Jan 2007 19:37:13 +0300 Message-ID: <2A786EB15713B544AB79607529273B047FADAC@mssmsx411> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [classlib][awt] java.awt.image.Raster.createPackedRaster() throws RasterFormatException on RI while it doesn't on Harmony Thread-Index: Acc1nr9UHYYhQOe5RXm29bY2dm9gTQ== From: "Shipilov, Alexander D" To: X-OriginalArrivalTime: 11 Jan 2007 16:37:16.0736 (UTC) FILETIME=[C14AD400:01C7359E] X-Virus-Checked: Checked by ClamAV on apache.org Hi, Please, help me to make clear JIRA HARMONY-2884. RI throws RasterFormatException (Harmony doesn't) in the following case: DataBufferUShort db =3D new DataBufferUShort(new short[5], 3); SinglePixelPackedSampleModel sm =3D new=20 SinglePixelPackedSampleModel(1, 10, 1, 0, new int[431]); Raster localRaster =3D Raster.createRaster(sm, db, new Point()); Result: RasterFormatException: Data array too small (should be 10 ) Central numbers in this example - short[5] and 10. RI compares DataBufferUShort.dataArray.length (=3D=3D5) with SampleModel.width (=3D=3D10). RI supposes that (width - 1) should be = less than dataArray.length (Spec says nothing about this situation). But here arises several questions: 1. Why width? Not (width * height)? 2. Why dataArray.length? Not dataArray.size? I'll explain this point. Spec says about DataBufferUShort(short[] dataArray, int size): Constructs an unsigned-short based DataBuffer with a single bank using the specified array. Only the first "size" elements should be used by accessors of this DataBuffer. dataArray must be large enough to hold "size" elements. So, size criteria should be size, not length. Am I right? Harmony doesn't produce any comparisons and this behavior doesn't contradict spec. I suggest close this bug as non-bug diff. Thanks, Alexander Shipilov