DO NOT REPLY [Bug 15844] New: - CronTimeTrigger breaks on December 31st
[email protected] 7 Jan 2003 16:00:53 -0000
| Newsgroups | gmane.comp.jakarta.avalon.apps.devel |
|---|---|
| Message-ID | <[email protected]> |
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15844>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15844
CronTimeTrigger breaks on December 31st
Summary: CronTimeTrigger breaks on December 31st
Product: Avalon
Version: unspecified
Platform: All
URL: http://marc.theaimsgroup.com/?l=avalon-
users&m=104149881821423&w=2
OS/Version: All
Status: NEW
Severity: Major
Priority: Other
Component: Cornerstone
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Copied from the above URL:
the following test method (to be added to CronTimeTriggerTestCase) fails:
public void testDaysEndOfYear()
{
final CronTimeTrigger trigger = new CronTimeTrigger( 51,
5, -1, -1, -1, true );
final Calendar now = Calendar.getInstance();
now.set( Calendar.SECOND, 0 );
now.set( Calendar.MINUTE, 2 );
now.set( Calendar.HOUR_OF_DAY, 11 );
now.set( Calendar.DAY_OF_MONTH, 31 );
now.set( Calendar.MONTH, Calendar.DECEMBER );
long time = now.getTime().getTime();
long next = trigger.getTimeAfter( time );
assertTrue(next > time );
}
Problem is, that on Dec 31 the getTimeAfter method returns a value in the
past
=> consequence in our scenario: trigger is executed again and again leading
to OutOfMemory-Error for the running app ;-((
Problem (in our opinion):
Use of GregorianCalender.roll which leaves the year unchanged