Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 4011 invoked from network); 10 Jan 2007 13:38:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jan 2007 13:38:55 -0000 Received: (qmail 65383 invoked by uid 500); 10 Jan 2007 13:38:58 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 65347 invoked by uid 500); 10 Jan 2007 13:38:58 -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 65245 invoked by uid 99); 10 Jan 2007 13:38:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jan 2007 05:38:57 -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; Wed, 10 Jan 2007 05:34:48 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 647F87142F7 for ; Wed, 10 Jan 2007 05:34:28 -0800 (PST) Message-ID: <26339008.1168436068408.JavaMail.jira@brutus> Date: Wed, 10 Jan 2007 05:34:28 -0800 (PST) From: "Alexander D Shipilov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2885) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect In-Reply-To: <32886412.1167208042568.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-2885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexander D Shipilov updated HARMONY-2885: ------------------------------------------ Attachment: RasterDataTypes2885Test.patch > [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if DataBuffer type is incorrect > --------------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2885 > URL: https://issues.apache.org/jira/browse/HARMONY-2885 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Ilya Okomin > Priority: Minor > Attachments: RasterDataTypes2885.patch, RasterDataTypes2885Test.patch > > > java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't throw RasterFormatException if DataBuffer type is not the same as SampleModel has as it is done on RI. > Test case to reproduce, it fails on Harmony and passes on RI: > ------------------ test.java -------------------- > import java.awt.Point; > import java.awt.image.DataBuffer; > import java.awt.image.DataBufferShort; > import java.awt.image.Raster; > import java.awt.image.RasterFormatException; > import java.awt.image.SinglePixelPackedSampleModel; > 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 testRun() { > int dataType = DataBuffer.TYPE_USHORT; > int w = 2; > int h = 26; > int[] array0 = new int[798]; > SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel( > dataType, w, h, array0); > DataBufferShort localDataBufferShort = new DataBufferShort(1,1); > Point location = new Point(); > try { > Raster localRaster = Raster.createRaster(sm, localDataBufferShort, > location); > fail("RasterFormatException expected!"); > } catch (RasterFormatException expectedException) { > // Expected > System.out.println(expectedException + " was thrown"); > } > } > } > --------------------------------------------------- > On RI output is: > ============ > .java.awt.image.RasterFormatException: ShortComponentRasters must have short DataBuffers was thrown > Time: 0,13 > OK (1 test) -- 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