Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-2774

[classlib][awt] Compatibility: java.awt.image.Raster.createInterleavedRaster(int dataType,int w,int h,int bands,Point location) throws RasterFormatException but RI throws NegativeArraySizeException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • None

    Description

      Harmony throws specified RasterFormatException for createInterleavedRaster(int dataType,int w,int h,int bands,Point location) but RI throws unspecified
      NegativeArraySizeException. I'd suggest to treat this as a non-bug difference from RI.
      ------------------------------------------------------------------------------
      import junit.framework.TestCase;

      import java.awt.*;
      import java.awt.image.*;

      public class Test extends TestCase {
      public void testcase() {
      try

      { Raster.createInterleavedRaster(0,6,-3,1, new Point()); fail("Exception expected"); }

      catch (NegativeArraySizeException expectedException)

      { System.out.println(expectedException +" was thrown"); }

      catch (RasterFormatException expectedException)

      { fail(expectedException +" was thrown"); }

      }
      }
      ------------------------------------------------------------------------------
      Harmony:
      junit.framework.AssertionFailedError: java.awt.image.RasterFormatException: w or h is less than or equal to zero was thrown
      at java.awt.image.RasterTest.testcase(RasterTest.java:46)
      at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)

      RI:
      java.lang.NegativeArraySizeException: allocLargeArray was thrown

      Attachments

        Activity

          People

            zakha Alexei Zakharov
            oleg.v.khaschansky@gmail.com Oleg Khaschansky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: