mx4j/src/core/mx4j/timer TimeQueue.java,1.1,1.2

Simone Bordet <[email protected]> Mon, 30 Aug 2004 13:56:38 +0000
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/core/mx4j/timer
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3912/src/core/mx4j/timer

Modified Files:
	TimeQueue.java 
Log Message:
Fixed bug in case of fixed rate: if next execution time is not initialized, set it to the current time

Index: TimeQueue.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/mx4j/timer/TimeQueue.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TimeQueue.java	26 Aug 2003 12:46:33 -0000	1.1
--- TimeQueue.java	30 Aug 2004 13:56:36 -0000	1.2
***************
*** 19,26 ****
   * execution time is set or it is marked as finished (if it is not forever periodic).
   *
-  * @see mx4j.timer.TimeTask
-  *
   * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @version $Revision$
   */
  public class TimeQueue
--- 19,25 ----
   * execution time is set or it is marked as finished (if it is not forever periodic).
   *
   * @author <a href="mailto:[email protected]">Simone Bordet</a>
   * @version $Revision$
+  * @see mx4j.timer.TimeTask
   */
  public class TimeQueue
***************
*** 41,44 ****
--- 40,44 ----
      * Starts this TimeQueue. <br>
      * Tasks are executed only after the queue has been started.
+     *
      * @see #stop
      */
***************
*** 62,65 ****
--- 62,66 ----
      * are not removed; restarting the queue has the effect of executing the tasks remained
      * if their time has come.
+     *
      * @see #start
      */
***************
*** 89,92 ****
--- 90,94 ----
     /**
      * Schedules the given task for execution.
+     *
      * @see #unschedule
      */
***************
*** 104,107 ****
--- 106,110 ----
     /**
      * Removes the given task from this TimeQueue
+     *
      * @see #schedule
      */
***************
*** 151,154 ****
--- 154,158 ----
                 long now = System.currentTimeMillis();
                 long executionTime = task.getNextExecutionTime();
+                if (executionTime == 0L) executionTime = now;
                 long timeToWait = executionTime - now;
                 boolean runTask = timeToWait <= 0;



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click