You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Petrenko (JIRA)" <ji...@apache.org> on 2007/03/17 10:15:09 UTC

[jira] Closed: (HARMONY-2877) [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if location param is null

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

Alexey Petrenko closed HARMONY-2877.
------------------------------------

    Resolution: Fixed

Fixed as part of HARMONY-2884.

> [classlib][awt] Compatibility: java.awt.image.Raster.createRaster() doesn't throw RasterFormatException if location param is null
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2877
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2877
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>         Assigned To: Alexey Petrenko
>            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.
-
You can reply to this email to add a comment to the issue online.