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

Window() constructor should throw HeadlessException instead of IAE in headless mode

XMLWordPrintable

    • b71
    • generic
    • generic

      Currently, java.awt.Window(GraphicsConfiguration gc) costructor throws IllegalArgumentException in headless mode. That causes all subclasses (java.awt.Frame, java.awt.Dialog, javax.swing.JWindow, and others) to throw IAE also. It seems strange to throw this exception, as a separate exception HeadlessException exists for this purpose.

      This is an incompatible change as neither IAE nor HeadlessException are subclasses of each other. However, both of them are runtime (unchecked) exceptions, and impact of this change is very low.

            art Artem Ananiev (Inactive)
            art Artem Ananiev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: