mx4j/src/core/javax/management/timer Timer.java,1.15,1.16

[email protected]
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/core/javax/management/timer
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11897/src/core/javax/management/timer

Modified Files:
	Timer.java 
Log Message:
Fixed bug in case of old date notifications: the task was not scheduled for execution

Index: Timer.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/timer/Timer.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Timer.java	23 Feb 2004 09:40:29 -0000	1.15
--- Timer.java	11 Mar 2004 09:59:27 -0000	1.16
***************
*** 15,19 ****
  import java.util.Map;
  import java.util.Vector;
- 
  import javax.management.InstanceNotFoundException;
  import javax.management.MBeanRegistration;
--- 15,18 ----
***************
*** 173,177 ****
        {
           TimerTask task = getTask(id);
!          updateTask(task);
           if (!task.isFinished())
           {
--- 172,176 ----
        {
           TimerTask task = getTask(id);
!          updateTask(task, now);
           if (!task.isFinished())
           {
***************
*** 218,222 ****
        ArrayList list = new ArrayList();
        boolean sendPast = getSendPastNotifications();
! 
        synchronized (this)
        {
--- 217,221 ----
        ArrayList list = new ArrayList();
        boolean sendPast = getSendPastNotifications();
!       long now = System.currentTimeMillis();
        synchronized (this)
        {
***************
*** 230,234 ****
              if (!sendPast)
              {
!                updateTask(task);
                 if (task.isFinished()) continue;
              }
--- 229,233 ----
              if (!sendPast)
              {
!                updateTask(task, now);
                 if (task.isFinished()) continue;
              }
***************
*** 239,245 ****
     }
  
!    private void updateTask(TimerTask task)
     {
-       long now = System.currentTimeMillis();
        long time = task.getNextExecutionTime();
  
--- 238,243 ----
     }
  
!    private void updateTask(TimerTask task, long now)
     {
        long time = task.getNextExecutionTime();
  



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.