harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Khaschansky (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2781) [classlib][awt] Compatibility: java.awt.image.MultiPixelPackedSampleModel(int,int,int,int) throws RasterFormatException while RI throws ArithmeticException
Date Mon, 18 Dec 2006 15:58:24 GMT
[classlib][awt] Compatibility: java.awt.image.MultiPixelPackedSampleModel(int,int,int,int)
throws RasterFormatException while RI throws ArithmeticException
-----------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2781
                 URL: http://issues.apache.org/jira/browse/HARMONY-2781
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Oleg Khaschansky
            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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message