{
Logger logger = getLogger();
synchronized (this)
{
TimerTask t = (TimerTask)tasks.get(id);
if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Retrieving task with id " + id + ": " + t);
if (t != null && t.isFinished())
{
if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Task with id " + id + " is expired, removing it");
tasks.remove(id);
t = null;