Why is there no isCancelled
method for a java.util.Timer object?
I would like to schedule a task if the Timer has not been cancelled, and run it directly (on the same thread) if it has been cancelled.
Is the only option to catch the IllegalStateException
that might occur if the Timer already has been cancelled? (It feels wrong to catch an IllegalStateException
).