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

Methods java.awt.font.NumericShaper.shape(..) don't throw declared exceptions if count is zero

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • client-libs
    • None
    • 2d
    • b47
    • generic
    • generic

      NullPointerException and IndexOutOfBoundsException declared in methods

       public void shape(char[] text, int start, int count)
       public void shape(char[] text, int start, int count, int context)

      are not thrown if value of 'count' is 0.

      Here is an example:
      ------- Test.java ----------------------------------
      import java.awt.font.NumericShaper;

      public class Test {

          public static void main(String[] args) {

              final NumericShaper shaper = NumericShaper.getShaper(NumericShaper.EUROPEAN);

              // NullPointerException is not thrown
              shaper.shape(null, 123, 0);
              shaper.shape(null, 123, 0, NumericShaper.EUROPEAN);

              // IndexOutOfBoundsException is not thrown
              shaper.shape("123".toCharArray(), 500, 0);
              shaper.shape("123".toCharArray(), 500, 0, NumericShaper.EUROPEAN);
          }
      }

      ###@###.### 2005-07-19 07:12:31 GMT

            dougfelt Doug Felt (Inactive)
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: