[ mx4j-Bugs-870532 ] Active timer task modifies notification trigger time

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <[email protected]>
Bugs item #870532, was opened at 2004-01-04 22:23
Message generated for change (Comment added) made by biorn_steedom
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=870532&group_id=47745

Category: JMX implementation
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Stephen Bate (sbate)
>Assigned to: Simone Bordet (biorn_steedom)
Summary: Active timer task modifies notification trigger time

Initial Comment:
Version: 2.0 beta 1

In addNotification() on line 172 of Timer.java there is a section of code that looks like...

      if (isActive())
      {
         // Check for the validity of the notification times, as the Timer is active

         // One-shot notification in the past, assume it's now
         date = new Date(now);

         // Periodic limited, the last notification is in the past
         if (period > 0 && occurrences > 0)
         {
            long lastTime = date.getTime() + (occurrences - 1) * period;
            if (lastTime < now) throw new IllegalArgumentException("Last date for periodic notification is before current date");
         }
      }

Although the comments mention it, there appears to be no actual validation of the notification time. When I use an active timer, the notification time is being set to 'now' although the trigger time is in the future. This causes the timer to trigger immediately instead of waiting until the requested trigger time.

----------------------------------------------------------------------

>Comment By: Simone Bordet (biorn_steedom)
Date: 2004-02-06 00:01

Message:
Logged In: YES 
user_id=128193

Fixed in CVS, and a test added to the suit; will be part of
the next release.
Thanks for submitting !

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=870532&group_id=47745


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
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.