[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] Fixing the incorrect work of javax.swing.Timer.getIniti
From: |
Michael Koch |
Subject: |
Re: [cp-patches] Fixing the incorrect work of javax.swing.Timer.getInitialDelay() |
Date: |
Thu, 24 Feb 2005 13:20:24 +0100 |
User-agent: |
mutt-ng 1.5.8i (Debian) |
On Thu, Feb 24, 2005 at 12:28:55PM +0100, Meskauskas Audrius wrote:
> 1. The Mauve test indicates the wrong work of
> javax.swing.Timer.getInitialDelay() immediately after calling the
> constructor. Regardless of that was passed to
> the constructor, getInitialDelay() always returns 0.
>
> 2. Additional test have shown that, indeed, under specific circumstances (the
> initial delay is not explicitly set) the Timer might fire the first event
> immediately after calling the start() method.
>
> >From the code is seen that the initial delay field is not initialised in
> constructor, leaving it with the default value 0.
>
> Both problems can be fixed by setting this field to the constructor parameter
> value.
Looks good,please commit.
Just 2 little nitpicks.
Please update the copright year and add 2005 when doing changes to a
file.
>Index: javax/swing/Timer.java
>===================================================================
>RCS file: /cvsroot/classpath/classpath/javax/swing/Timer.java,v
>retrieving revision 1.16
>diff -u -r1.16 Timer.java
>--- javax/swing/Timer.java 24 Feb 2005 11:01:38 -0000 1.16
>+++ javax/swing/Timer.java 24 Feb 2005 11:15:24 -0000
>@@ -184,12 +184,14 @@
> /**
> * Creates a new Timer object.
> *
>- * @param d DOCUMENT ME!
>- * @param listener DOCUMENT ME!
>+ * @param d the default value for both initial and between event delay, in
>+ * milliseconds.
>+ * @param listener the first action listener, can be <code>null/code>.
> */
> public Timer(int d, ActionListener listener)
> {
> delay = d;
>+ initialDelay = d;
Please indent this with 4 spaces.
>
> if (listener != null)
> addActionListener(listener);