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

spec for java.awt.FontMetrics methods is silent when args are incorrect

XMLWordPrintable

    • 2d
    • b56
    • sparc
    • solaris_2.6
    • Verified

      Name: bkR10101 Date: 11/08/2001



      Spec doesn't describe the behavior of the following methods' when incorrect
      arguments are passed to them (when 'off' point out of the array, 'len'
      is bigger than (data.length - off), when the parameters are negative)

      public int charsWidth(char[] data, int off, int len)
      public int bytesWidth(byte[] data, int off, int len)

       The specification for these methods should be
       changed as it is described in the document
       "Requirements for Writing Java API Specifications":
       http://java.sun.com/j2se/javadoc/writingapispecs/index.html .

      If StringIndexOutOfBoundsException should be thrown, it has to be defined
      explicitely by the spec.

      ======================================================================
      4523539 : spec for java.awt.FontMetrics methods is silent about null args
      states

      Spec doesn't describe the following methods' behavior when null is passed
      as a parameter:

      public int charsWidth(char[] data, int off, int len)
      public int bytesWidth(byte[] data, int off, int len)
      public int stringWidth(String str)

       The specification for these methods should be
       changed as it is described in the document
       "Requirements for Writing Java API Specifications":

       http://java.sun.com/j2se/javadoc/writingapispecs/index.html

       If NullPointerException should be thrown, it has to be defined
       explicitely by the spec.

      This is so intertwined with the issues in this report that
      4523539 is closed as a dup of this and both sets of issues should be addressed here.

            prr Philip Race
            bbksunw Bbk Bbk (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: