summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2012-01-16Update JavaTimer class to guard against premature timer expirationNick Hudson
The JavaTimer class uses Thead.sleep() to wait a specified number of milliseconds. Thread.sleep() requires the caller catch InterruptedException, but in the original implementation, such an exception would result in the code assuming that the specified time had been reached. So as things stood, if you e.g. set a timer for 60 seconds, then the timer might generate its "onTick" signal before that 60 seconds had elapsed. This patch changes the code so that the method will wait until the specified time has been reached. The "milliseconds" parameters are also changed to "long", which is the type used by the rest of the java library for millisecond values. Added a bit of javadoc and a toString() method as well. Note there is still a "FIXME" in the code which I've not addressed. Test-information: Tested in debugging setup; things seem to be working as expected.
2011-10-31Fix utf-8 encoding on Remko's name throughout. Now compiles with Java 7Kevin Smith
2011-07-01Initial importKevin Smith