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

ScheduledThreadPoolExecutor.remove(Runnable) should not throw an exception

XMLWordPrintable

    • b42
    • generic, sparc
    • generic, solaris_2.1

      Doug Lea writes:

      Problem: ScheduledThreadPoolExecutor.remove can throw exception when it should
      return false.

      Symptoms: Calling ScheduledThreadPoolExecutor.remove with a task type
      that was not produced by a ScheduledThreadPoolExecutor schedule method
      should simply return false. However, it may instead throw a
      ClassCastException while traversing for a non-existent task.

      Solution: Add a checked cast before trying to remove.

            martin Martin Buchholz
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: