JDK-6366441 : Window() constructor should throw HeadlessException instead of IAE in headless mode
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0,6
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-12-22
  • Updated: 2017-05-16
  • Resolved: 2006-02-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b71Fixed
Related Reports
Duplicate :  
Description
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.

Comments
EVALUATION One check should be changed: in Window.init(GraphicsConfiguration) method we should throw HeadlessException instead of IAE in healess mode.
13-01-2006