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

FutureTask.{set,setException} not called by run()

    XMLWordPrintable

Details

    • b07
    • generic
    • generic
    • Verified

    Description

      Submitter of 6459119 writes:

      In addition to this, I tried to do some proxying-magic with the actual provided instance of RunnableScheduledFuture. However, also here I found problems: The above-mentioned internal implementation of RunnableScheduledFuture extends FutureTask. This class uses an internal class called Sync which extends AbstractQueuedSynchronizer. The actual run() method invokes sync.innerRun(), which thus encapsulates any raised Exceptions (so that they can be set in the Future, obviously - but this makes this intervention-point useless too). But, yes, there is also a method setException(Throwable t), whose javadoc states "This method is invoked internally by the run method upon failure of the computation.". There is however no calls in any code to this method: when the contained task raises Exception whithin the innerRun() method, _inner_SetException() is invoked _directly_ (which most probably should have been a invocation to setException() instead, since this default does sync.innerSetException()). Further, there is also a "done()" method, which is invoked both on good and bad runs. But, again, there is no public ways to get to the Exception that was set with setException (or rather innerSetException).

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: