You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Rafael Alfaro <ra...@gmail.com> on 2013/06/22 05:31:11 UTC

CronParser bug on getNextScheduledTime to handle the once per minute case "* * * * *"

Hello,

I created the following report:
https://issues.apache.org/jira/browse/AMQ-4591

It seems that the getNextScheduledTime method is not returning at the top
of the next minute when the CronEntry is "* * * * *"

The precision must have to be in minutes, the following patch fix the issue:

Index: activemq-client/src/main/java/
org/apache/activemq/broker/scheduler/CronParser.java
===================================================================
---
activemq-client/src/main/java/org/apache/activemq/broker/scheduler/CronParser.java
(revision 1494862)
+++
activemq-client/src/main/java/org/apache/activemq/broker/scheduler/CronParser.java
(working copy)
@@ -44,7 +44,7 @@
         // starting the next event at the top of the minute.
         if (cronEntry.equals("* * * * *")) {
             result = currentTime + 60 * 1000;
-            result = result / 1000 * 1000;
+            result = result / 60000 * 60000;
             return result;
         }