review due items action, re-checking eligibility at Sun Nov 18 15:47:47 GMT 2007 recheckEligibility(MainFrame.java:724)
eligibility set to false at Sun Nov 18 15:47:47 GMT 2007 recheckEligibility(MainFrame.java:730)
...
timer-induced eligibility check at Mon Nov 19 03:10:05 GMT 2007 actionPerformed(EligibleItemMonitor.java:117)
review due items action, re-checking eligibility at Mon Nov 19 03:10:05 GMT 2007 recheckEligibility(MainFrame.java:724)
eligibility set to false at Mon Nov 19 03:10:05 GMT 2007 recheckEligibility(MainFrame.java:730))
So the timer is either being set incorrectly or is going off prematurely. Can write a test to rule out the first very quickly - just grab GC as a Date, add calculated initialDelay and print the result. Other options: record desired fire time as a Date in closure, and when fired check current time is past Date, and if not then schedule again. Another way would be to try java.util.Timer - which takes a Date, not hand-calculated milliseconds - and wrap firing action in invokeLater() to put it on the EHT. Tradeoff.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Watching the same process for a while longer, early on the 20th I de-minimized the window and (perhaps coincidentally) the timer fired straight away:
timer-induced eligibility check at Tue Nov 20 03:48:56 GMT 2007 (at actionPerformed(EligibleItemMonitor.java:117))
review due items action, re-checking eligibility at Tue Nov 20 03:48:56 GMT 2007 (at recheckEligibility(MainFrame.java:724))
eligibility set to true at Tue Nov 20 03:48:56 GMT 2007 (at recheckEligibility(MainFrame.java:730))
Shortly before the same time early on the 21st I de-minimized again. No timer fired until exactly a day after the previous one:
timer-induced eligibility check at Wed Nov 21 03:48:56 GMT 2007 (at actionPerformed(EligibleItemMonitor.java:117))
review due items action, re-checking eligibility at Wed Nov 21 03:48:56 GMT 2007 (at recheckEligibility(MainFrame.java:724))
eligibility set to true at Wed Nov 21 03:48:56 GMT 2007 (at recheckEligibility(MainFrame.java:730))
Additional useful test: calculate the true number of milliseconds waited versus the actual.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=1866462
Originator: YES
A bit of added debug generates:
review due items action, re-checking eligibility at Sun Nov 18 15:47:47 GMT 2007 recheckEligibility(MainFrame.java:724)
eligibility set to false at Sun Nov 18 15:47:47 GMT 2007 recheckEligibility(MainFrame.java:730)
...
timer-induced eligibility check at Mon Nov 19 03:10:05 GMT 2007 actionPerformed(EligibleItemMonitor.java:117)
review due items action, re-checking eligibility at Mon Nov 19 03:10:05 GMT 2007 recheckEligibility(MainFrame.java:724)
eligibility set to false at Mon Nov 19 03:10:05 GMT 2007 recheckEligibility(MainFrame.java:730))
So the timer is either being set incorrectly or is going off prematurely. Can write a test to rule out the first very quickly - just grab GC as a Date, add calculated initialDelay and print the result. Other options: record desired fire time as a Date in closure, and when fired check current time is past Date, and if not then schedule again. Another way would be to try java.util.Timer - which takes a Date, not hand-calculated milliseconds - and wrap firing action in invokeLater() to put it on the EHT. Tradeoff.
Logged In: YES
user_id=1866462
Originator: YES
Watching the same process for a while longer, early on the 20th I de-minimized the window and (perhaps coincidentally) the timer fired straight away:
timer-induced eligibility check at Tue Nov 20 03:48:56 GMT 2007 (at actionPerformed(EligibleItemMonitor.java:117))
review due items action, re-checking eligibility at Tue Nov 20 03:48:56 GMT 2007 (at recheckEligibility(MainFrame.java:724))
eligibility set to true at Tue Nov 20 03:48:56 GMT 2007 (at recheckEligibility(MainFrame.java:730))
Shortly before the same time early on the 21st I de-minimized again. No timer fired until exactly a day after the previous one:
timer-induced eligibility check at Wed Nov 21 03:48:56 GMT 2007 (at actionPerformed(EligibleItemMonitor.java:117))
review due items action, re-checking eligibility at Wed Nov 21 03:48:56 GMT 2007 (at recheckEligibility(MainFrame.java:724))
eligibility set to true at Wed Nov 21 03:48:56 GMT 2007 (at recheckEligibility(MainFrame.java:730))
Additional useful test: calculate the true number of milliseconds waited versus the actual.