harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Okomin (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2877) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if location param is null
Date Tue, 26 Dec 2006 11:40:21 GMT
[classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException
if location param is null
---------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2877
                 URL: http://issues.apache.org/jira/browse/HARMONY-2877
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Ilya Okomin
            Priority: Minor


java.awt.image.Raster.createRaster(SampleModel sm, DataBuffer db, Point location) doesn't
throw RasterFormatException if location param is null while RI does.
Spec doesn't consider this case.
Run next test case to see the difference, it passes on RI and fails on Harmony:

------------- test.java ----------------
import java.awt.image.DataBufferUShort;
import java.awt.image.Raster;
import java.awt.image.RasterFormatException;
import java.awt.image.SinglePixelPackedSampleModel;

import junit.framework.TestCase;
import junit.textui.TestRunner;

public class test extends TestCase {

    public static void main(String args[]) {
        TestRunner.run(test.class);
    }

    public void testRun() {
        int[] array0 = new int[405];
        SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(0,
                127, 2, array0);
        short[] array1 = new short[758];
        DataBufferUShort localDataBufferUShort = new DataBufferUShort(array1, 223);
        try {
            Raster localRaster = Raster.createRaster(sm, localDataBufferUShort, null);
            fail("RasterFormatException expected");
        } catch (RasterFormatException expectedException) {
            // expected
        }
    }
}
------------------------------------------

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