Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 70891 invoked from network); 24 Jan 2007 15:59:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jan 2007 15:59:45 -0000 Received: (qmail 43554 invoked by uid 500); 24 Jan 2007 15:59:46 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 43533 invoked by uid 500); 24 Jan 2007 15:59:46 -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 43521 invoked by uid 99); 24 Jan 2007 15:59:46 -0000 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, 24 Jan 2007 07:59:45 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 580BA7142D6 for ; Wed, 24 Jan 2007 07:58:49 -0800 (PST) Message-ID: <1520923.1169654329357.JavaMail.jira@brutus> Date: Wed, 24 Jan 2007 07:58:49 -0800 (PST) From: "Alexei Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Assigned: (HARMONY-2435) [classlib][awt] Raster.createPackedRaster(...) throws RasterFormatException while RI throws IAE In-Reply-To: <1616438.1165241421091.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-2435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexei Zakharov reassigned HARMONY-2435: ---------------------------------------- Assignee: Alexei Zakharov > [classlib][awt] Raster.createPackedRaster(...) throws RasterFormatException while RI throws IAE > ----------------------------------------------------------------------------------------------- > > Key: HARMONY-2435 > URL: https://issues.apache.org/jira/browse/HARMONY-2435 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Denis Kishenko > Assigned To: Alexei Zakharov > Attachments: Raster.patch, Raster1.patch, RasterTest.patch, RasterTest1.patch > > > java.awt.image.Raster.createPackedRaster(int datatype, int w, int h, int[],Point) throws RasterFormatException while RI throws IllegalArgumentException when datatype is not valid. > java 1.5.0 spec says: > "Throws: RasterFormatException - if w or h is less than or equal to zero, or computing > either location.x + w or location.y + h results in integer overflow > IllegalArgumentException - if dataType is not one of the supported data types, > which are DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT". > It's a compatibility issue of exception order throwing. > ============ Test ============== > import junit.framework.TestCase; > import java.awt.Point; > import java.awt.image.WritableRaster; > import java.awt.image.Raster; > public class test extends TestCase > { > public void testcase1() > { > int localVariable0 = 109; > int localVariable1 = -28; > int localVariable2 = 3; > int[] array0 = new int[] {}; > Point localPoint2 = new Point(); > Point localPoint1 = new Point(localPoint2); > Point localPoint = new Point(localPoint1); > try > { > Raster.createPackedRaster( > localVariable0, > localVariable1, > localVariable2, > array0, > localPoint); > assertEquals(true, false); > } > catch (IllegalArgumentException e) > {e.printStackTrace(); > assertEquals(true, true); > } > } > } > OUTPUT: > DEV : > Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software > Foundatio > n or its licensors, as applicable. > java version "1.5.0" > pre-alpha : not complete or compatible > svn = rsvn: '.' is not a working copy, (Sep 29 2006), Windows/ia32/msvc 1310, > de > bug build > http://incubator.apache.org/harmony > .E > Time: 0.031 > There was 1 error: > 1) testcase1(test)java.awt.image.RasterFormatException: w or h is less than or > e > qual to zero > at java.awt.image.Raster.createPackedRaster(Raster.java:476) > at test.testcase1(test.java:16) > at java.lang.reflect.VMReflection.invokeMethod(Native Method) > FAILURES!!! > Tests run: 1, Failures: 0, Errors: 1 > ----------------------------------------------------------------------- > SUN > java version "1.5.0_06" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) > Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode) > .java.lang.IllegalArgumentException: Unsupported data type 109 > at java.awt.image.Raster.createPackedRaster(Raster.java:462) > at test.testcase1(test.java:19) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces > sorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at junit.framework.TestCase.runTest(TestCase.java:154) > at junit.framework.TestCase.runBare(TestCase.java:127) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at junit.framework.TestSuite.runTest(TestSuite.java:208) > at junit.framework.TestSuite.run(TestSuite.java:203) > at junit.textui.TestRunner.doRun(TestRunner.java:116) > at junit.textui.TestRunner.start(TestRunner.java:172) > at junit.textui.TestRunner.main(TestRunner.java:138) > Time: 0.094 > OK (1 test) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.