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

Doc probs in java.awt.image.DataBufferUShort

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
      2d
    • CPU:
      generic
    • OS:
      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

              • Assignee:
                Unassigned
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: