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

Raster.createPackedRaster does not throw exception when numBands < 1

XMLWordPrintable

    • 2d
    • 1.3
    • generic
    • generic


      Raster.createPackedRaster(int dataType, int width, int height, int numBands,
      int bitsPerBand, Point location) does not throw exception when numBands is
      less than 1.

      import java.awt.Point;
      import java.awt.image.DataBuffer;
      import java.awt.image.Raster;
      class Bug_CreatePackedRaster_i5__11_13 {
        public static void main(String args[]) {
          try {
            Raster.createPackedRaster(DataBuffer.TYPE_BYTE, 1, 2, 0, 3, new Point(1, 1));
            System.out.println("FAILED: no exception when numBands is less than 1");
          } catch (Exception e) {
            System.out.println("PASSED: got exception when bitsPerBand < 1 - " + e);
          }
        }
      }

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: