Details
-
Bug
-
Resolution: Unresolved
-
P4
-
6
-
generic
-
generic
Description
Some of the FileDialog constructors claim that they will throw an IllegalArgumentException when the 'parent' value is null. This is true till JDK 5.0. Since JDK 6, we now support parent-less dialogs and none of these constructors will throw an exception if parent value is null. Hence the API specification is mis-leading and not reflecting the new feature.
Refer to the following constructors in java.awt.FileDialog in the API docs (http://download.java.net/jdk6/docs/api/) -
public FileDialog(Dialog parent)
public FileDialog(Dialog parent, String title)
public FileDialog(Dialog parent, String title, int mode)
All these have a 'throws' clause as follows -
Throws:
IllegalArgumentException - if parent is null; this exception is always thrown when GraphicsEnvironment.isHeadless returns true
In reality, no such exception will be thrown if parent is null on JDK 6.
Refer to the following constructors in java.awt.FileDialog in the API docs (http://download.java.net/jdk6/docs/api/) -
public FileDialog(Dialog parent)
public FileDialog(Dialog parent, String title)
public FileDialog(Dialog parent, String title, int mode)
All these have a 'throws' clause as follows -
Throws:
IllegalArgumentException - if parent is null; this exception is always thrown when GraphicsEnvironment.isHeadless returns true
In reality, no such exception will be thrown if parent is null on JDK 6.