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

TrayIcon constructor throws NPE instead of documented IAE

XMLWordPrintable

    • b66
    • x86
    • windows
    • Verified

      Constructor java.awt.TrayIcon(Image) says

      "@throws IllegalArgumentException if <code>image</code> is <code>null</code>"

      but it uses method TrayIcon.setImage(Image) that throws (specified) NPE.

      Tests expect IAE to be thrown from TrayIcon constructors for null image, receive (unexpected) NPE and fail.

      JCK 7 b06
      JDK 7 b36
      Platforms:
       - failed on Windows 2003
       - passed on Solaris Sparc

      The following JCK tests fail due to this problem:

      api/java_awt/TrayIcon/index.html#Ctors[testNullImageResultsInIAE2007]
      api/java_awt/TrayIcon/index.html#Ctors[testNullImageResultsInIAE2004]
      api/java_awt/TrayIcon/index.html#Ctors[testNullImageResultsInIAE2002]
      Reproducible on Solaris as well.

            dcherepanov Dmitry Cherepanov
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: