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-2757) [classlib][awt] java.awt.image.RasterFormatException.createBandedRaster(int dataType,int w,int h,int scanlineStride,int[] bankIndices,int[] bandOffsets,Point location) throws RasterFormatException while RI throws IllegalArgumentException
Date Fri, 15 Dec 2006 16:36:22 GMT
[classlib][awt] java.awt.image.RasterFormatException.createBandedRaster(int dataType,int w,int
h,int scanlineStride,int[] bankIndices,int[] bandOffsets,Point location) throws RasterFormatException
while RI throws IllegalArgumentException
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2757
                 URL: http://issues.apache.org/jira/browse/HARMONY-2757
             Project: Harmony
          Issue Type: Bug
          Components: Non-bug differences from RI
            Reporter: Oleg Khaschansky
            Priority: Minor


The following Raster methods should throw RasterFormatException if w or h is less than or
equal to zero according to the API spec:
createBandedRaster(int dataType,int w,int h,int scanlineStride,int[] bankIndices,int[] bandOffsets,Point
location)
createPackedRaster(int dataType,int w,int h,int bands,int bitsPerBand,Point location)
createInterleavedRaster(DataBuffer dataBuffer, int w, int h, int scanlineStride, int pixelStride,
int[] bandOffsets, Point location)
createInterleavedRaster(int,int,int,int,int,int[],Point)

They follow the specification on Harmony, but RI implementation throw unspecified IllegalArgumentException
in this case.

The following testcase demonstrates this behavior (passes on RI but fails on Harmony):

package java.awt.image;

import junit.framework.TestCase;

import java.awt.*;

public class RasterTest extends TestCase {
    public void testcase0() {
        try {
            Raster.createBandedRaster(1, -10, 10, 10, new int[] {0}, new int[] {0}, new Point());
            fail("Exception expected");
        } catch (RasterFormatException expectedException) {
            fail(expectedException +" was thrown");
        } catch (IllegalArgumentException expectedException) {
            System.out.println(expectedException +" was thrown");
        }
    }
}

I think Harmony should folow specification in this case and suggest to treat it as a non-bug
difference.

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