[ 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 15:23
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=870532&group_id=47745

Category: JMX implementation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Stephen Bate (sbate)
Assigned to: Nobody/Anonymous (nobody)
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.

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

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


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&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.