AbstractStreamHandler.waitUntilDone() (line 33) is synchronized and calls wait() in a while (!isDone()) loop. But setDone() (line 47) only sets the done flag — it never calls notifyAll(). If a subclass calls setDone() without also calling notifyAll(), any thread blocked in waitUntilDone() waits forever.
StreamPumper works around this by calling notifyAll() in its own finally block (line 98), but the base class should be correct.
Fix: make setDone() synchronized and add this.notifyAll().
AbstractStreamHandler.waitUntilDone()(line 33) issynchronizedand callswait()in awhile (!isDone())loop. ButsetDone()(line 47) only sets thedoneflag — it never callsnotifyAll(). If a subclass callssetDone()without also callingnotifyAll(), any thread blocked inwaitUntilDone()waits forever.StreamPumperworks around this by callingnotifyAll()in its ownfinallyblock (line 98), but the base class should be correct.Fix: make
setDone()synchronized and addthis.notifyAll().