aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorFernando Nasser <fnasser@redhat.com>2004-01-05 21:23:12 +0000
committerFernando Nasser <fnasser@gcc.gnu.org>2004-01-05 21:23:12 +0000
commit975fde59af881603e4f905989848c5a96441ca63 (patch)
treea7bf7188bf4d3cc332a904a72fb9b03ebda56906 /libjava
parentb7a9b4af036708755a251309dcf591d9bf9db9ea (diff)
downloadgcc-975fde59af881603e4f905989848c5a96441ca63.zip
gcc-975fde59af881603e4f905989848c5a96441ca63.tar.gz
gcc-975fde59af881603e4f905989848c5a96441ca63.tar.bz2
Dialog.java (constructor): Accept null title as per spec.
* java/awt/Dialog.java (constructor): Accept null title as per spec. * java/awt/FileDialog.java (constructor): Throw exception on invalid argument as per spec. From-SVN: r75444
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/java/awt/Dialog.java12
-rw-r--r--libjava/java/awt/FileDialog.java5
3 files changed, 19 insertions, 4 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index c5556a9..c3d6545 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,11 @@
2004-01-05 Fernando Nasser <fnasser@redhat.com>
+ * java/awt/Dialog.java (constructor): Accept null title as per spec.
+ * java/awt/FileDialog.java (constructor): Throw exception on invalid
+ argument as per spec.
+
+2004-01-05 Fernando Nasser <fnasser@redhat.com>
+
* java/awt/Choice.java (add): Leave posting of ItemEvents to peer.
(insert): Ditto.
(remove): Ditto. Also, Check for valid argument.
diff --git a/libjava/java/awt/Dialog.java b/libjava/java/awt/Dialog.java
index eee8361..ac2e6ed 100644
--- a/libjava/java/awt/Dialog.java
+++ b/libjava/java/awt/Dialog.java
@@ -187,7 +187,8 @@ Dialog (Frame parent, String title, boolean modal, GraphicsConfiguration gc)
{
super (parent, gc);
- this.title = title;
+ // A null title is equivalent to an empty title
+ this.title = (title != null) ? title : "";
this.modal = modal;
visible = false;
@@ -254,8 +255,9 @@ public
Dialog (Dialog parent, String title, boolean modal, GraphicsConfiguration gc)
{
super (parent, parent.getGraphicsConfiguration ());
-
- this.title = title;
+
+ // A null title is equivalent to an empty title
+ this.title = (title != null) ? title : "";
this.modal = modal;
visible = false;
@@ -289,7 +291,9 @@ getTitle()
public synchronized void
setTitle(String title)
{
- this.title = title;
+ // A null title is equivalent to an empty title
+ this.title = (title != null) ? title : "";
+
if (peer != null)
{
DialogPeer d = (DialogPeer) peer;
diff --git a/libjava/java/awt/FileDialog.java b/libjava/java/awt/FileDialog.java
index 6ff2b76..24a6210 100644
--- a/libjava/java/awt/FileDialog.java
+++ b/libjava/java/awt/FileDialog.java
@@ -147,6 +147,11 @@ public
FileDialog(Frame parent, String title, int mode)
{
super(parent, title, true);
+
+ if ((mode != LOAD) && (mode != SAVE))
+ throw new IllegalArgumentException (
+ "Mode argument must be either LOAD or SAVE");
+
setMode (mode);
}