X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=libjava%2Fclasspath%2Fjavax%2Fswing%2FTimer.java;h=acd226249479e8bc231f209383c226e6138e5bd0;hp=231b71d73bb8d323e21a4bd634dd6d27799ee2d9;hb=ffde862e033a0825e1e9972a89c0f1f80b261a8e;hpb=b415ff10527e977c3758234fd930e2c027bfa17d
diff --git a/libjava/classpath/javax/swing/Timer.java b/libjava/classpath/javax/swing/Timer.java
index 231b71d73bb..acd22624947 100644
--- a/libjava/classpath/javax/swing/Timer.java
+++ b/libjava/classpath/javax/swing/Timer.java
@@ -1,5 +1,5 @@
/* Timer.java --
- Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -264,9 +264,13 @@ public class Timer
* firing the first event.
*
* @param d The time gap between the subsequent events, in milliseconds
+ *
+ * @throws IllegalArgumentException if d
is less than zero.
*/
public void setDelay(int d)
{
+ if (d < 0)
+ throw new IllegalArgumentException("Invalid delay: " + d);
delay = d;
}
@@ -287,9 +291,13 @@ public class Timer
* subsequent events.
*
* @param i the initial delay, in milliseconds
+ *
+ * @throws IllegalArgumentException if i
is less than zero.
*/
public void setInitialDelay(int i)
{
+ if (i < 0)
+ throw new IllegalArgumentException("Invalid initial delay: " + i);
initialDelay = i;
}