Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4200305

createRaster(sm, null, new Point(0,0)) does not throw exception

XMLWordPrintable

    • 2d
    • kestrel
    • generic
    • generic


      When dataBuffer parameter of RasterFactory.createRaster() is null, JAI does not
      throw any exception.

      The following program can be used to illustrate this behaviour.

      import java.awt.Point;
      import java.awt.image.SampleModel;
      import java.awt.image.BandedSampleModel;
      import java.awt.image.DataBuffer;
      import javax.media.jai.RasterFactory;
      class Bug_createRaster_S_D_P_17 {
        public static void main(String args[]) {
          SampleModel sm =
            new BandedSampleModel(DataBuffer.TYPE_BYTE, 12, 34, 12,
            new int[]{0,1,2}, new int[]{0,0,0});
          RasterFactory.createRaster(sm, null, new Point(0,0));
        }
      }

      --------------------------
      daniel.rice@Eng 1999-01-04

      The JAI method simply calls Raster.createRaster. So the problem exists within
      Java2D. The non-JAI test program is as follows:

      import java.awt.Point;
      import java.awt.image.SampleModel;
      import java.awt.image.BandedSampleModel;
      import java.awt.image.DataBuffer;
      import java.awt.image.Raster;
      class Bug_createRaster_S_D_P_17 {
        public static void main(String args[]) {
          SampleModel sm =
            new BandedSampleModel(DataBuffer.TYPE_BYTE, 12, 34, 12,
            new int[]{0,1,2}, new int[]{0,0,0});
          Raster.createRaster(sm, null, new Point(0,0));
        }
      }

            jehung Jeannette Hung
            chialin Chianphon Lin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: