harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-2781) [classlib][awt] Compatibility: java.awt.image.MultiPixelPackedSampleModel(int,int,int,int) throws RasterFormatException while RI throws ArithmeticException
Date Tue, 23 Jan 2007 18:41:49 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-2781?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alexei Zakharov closed HARMONY-2781.
------------------------------------

    Resolution: Won't Fix

> [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.


Mime
View raw message