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

ColorSpace.getInstance(int): IAE is not specified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • 5.0
    • client-libs
    • None
    • 2d
    • b07
    • generic
    • generic

      Method getInstance(int) for java.awt.color.ICC_ColorSpace class throws IllegalArgumentException when passed a negative value for a input parameter. Such behavior is not specified either in the member spec or in the package/class description.

      ---------
      import java.awt.color.ICC_ColorSpace;

      public class Test1 {
          public static void main(String[] args) {
              try {
                  // test case ...
                  ICC_ColorSpace cs2 = (ICC_ColorSpace)ICC_ColorSpace.getInstance(-5);
                  boolean result = (cs2.isCS_sRGB());
                  System.out.println("res: " + result);
              }
              catch(IllegalArgumentException e1) {
                  System.out.println("result (iae) true");
              }
          }
      }

      ###@###.### 2004-12-21 13:28:38 GMT

            serb Sergey Bylokhov
            ydanilev Yury Danilevich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: