Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 51956 invoked from network); 23 Jan 2007 18:42:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jan 2007 18:42:11 -0000 Received: (qmail 33562 invoked by uid 500); 23 Jan 2007 18:42:16 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 33543 invoked by uid 500); 23 Jan 2007 18:42:16 -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 33527 invoked by uid 99); 23 Jan 2007 18:42:16 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jan 2007 10:42:16 -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; Tue, 23 Jan 2007 10:42:09 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 544977142D1 for ; Tue, 23 Jan 2007 10:41:49 -0800 (PST) Message-ID: <6123409.1169577709341.JavaMail.jira@brutus> Date: Tue, 23 Jan 2007 10:41:49 -0800 (PST) From: "Alexei Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2781) [classlib][awt] Compatibility: java.awt.image.MultiPixelPackedSampleModel(int,int,int,int) throws RasterFormatException while RI throws ArithmeticException In-Reply-To: <5151579.1166457504756.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-2781?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexei Zakharov updated HARMONY-2781: ------------------------------------- Component/s: (was: Classlib) Non-bug differences from RI I agree it should throw RasterFormatException here. BTW, it doesn't throw RFE even for the second variant of the contructor - MultiPixelPackedSampleModel(int dataType, int w, int h, int numberOfBits, int scanlineStride, int dataBitOffset). So I move it to "non-bug differences from RI" component. > [classlib][awt] Compatibility: java.awt.image.MultiPixelPackedSampleModel(int,int,int,int) throws RasterFormatException while RI throws ArithmeticException > ----------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2781 > URL: https://issues.apache.org/jira/browse/HARMONY-2781 > Project: Harmony > Issue Type: Bug > Components: Non-bug differences from RI > Reporter: Oleg Khaschansky > Assigned To: Alexei Zakharov > Priority: Minor > > java.awt.image.MultiPixelPackedSampleModel(int dataType, int w, int h, int numberOfBits) throws RasterFormatException while RI throws ArithmeticException when numberOfBits parameter is zero. > The API specification says for another version of the constructor MultiPixelPackedSampleModel(int dataType, int w, int h, int numberOfBits, int scanlineStride, int dataBitOffset) the following: > RasterFormatException - if the number of bits per pixel is not a power of 2 or if a power of 2 number of pixels do not fit in one data element. > It's possible to expect the same restrictions for MultiPixelPackedSampleModel(int,int,int,int) also, but API spec says nothing for it. It also says nothing about ArithmeticException. > I suggest to treat this as a non-bug diff from RI. > The following testcase illustrates this: > --------------------------------------------------------------------------------------- > import junit.framework.TestCase; > import java.awt.image.MultiPixelPackedSampleModel; > import java.awt.image.RasterFormatException; > public class Test0 extends TestCase { > public void testcase0() > { > try { > new MultiPixelPackedSampleModel(1, 1, 3, 0); > fail(); > } catch (RasterFormatException expectedException) { > fail(expectedException+" was thrown"); > } catch (ArithmeticException expectedException) { > System.out.println(expectedException+" was thrown"); > } > } > } > --------------------------------------------------------------------------------------- > Harmony: > junit.framework.AssertionFailedError: java.awt.image.RasterFormatException: Number of Bits equals to zero was thrown > at Test0.testcase0(Test0.java:31) > at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) > RI: > java.lang.ArithmeticException: / by zero was thrown -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.