Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8058550

Clarify that TimerTasks are not reusable

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • core-libs
    • b33
    • generic
    • generic

        To the javadoc of java.util.TimerTask please add something like:
        A TimerTask instance is not re-usable i.e.: never use it twice for Timer.schedule(...).

        Additionally you could extend the exception description of j.u.Timer.schedule(...):
        IllegalStateException - if task was already scheduled, canceled or already done, timer was canceled, or timer thread terminated.

              martin Martin Buchholz
              ulfzibis Ulf Zibis
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: