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

Doc probs in java.awt.image.DataBufferUShort

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • 1.4.0
    • client-libs
    • 2d
    • generic
    • generic

    Description



      Name: naC79102 Date: 12/15/2000


      Few constructors in java.awt.image.DataBufferUShort state that the
      number of elements in a datarray must be large enough to hold
      size number of elements. However this condition is not
      actually checked by the API and an exception is not thrown if the size
      is
      larger than the dataArray.
                      The constructors that show this bug are
      DataBufferUShortTest(short[] dataArray,

      int size) and DataBufferUShortTest(short[][] dataArray, int size).

       Sample code follows....
       package javasoft.sqe.tests.api.java.awt.java2d.image.DataBufferUShort;

       import java.awt.image.DataBufferUShort;
       import java.awt.image.DataBuffer;

       public class test {
       public test() {

        try{
              new DataBufferUShort(new short[] {2,3,4,5},10);
              }catch(Exception ee)
              { System.out.println("exception raised");}


        try{
              new DataBufferUShort(new short[][] {{2,3},{3,4}},5);
             }catch(Exception ee)
              { System.out.println("exception raised");}

      }
       public static void main(String[] args) {
              new test();
                                                            }
      }

      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: