Menu ▾ ▴

#64 Wrapper doesn't cope properly with exceptions

v3.1.2
open
nobody
API (14)
5
2012-12-11
2004-10-12
Anonymous
No

From the jdk - java.lang.Thread.

When a thread is stop it will -
* The thread represented by this thread is forced to
stop whatever
* it is doing abnormally and to throw a newly
created
* <code>ThreadDeath</code> object as an
exception.
* <p>
* It is permitted to stop a thread that has not yet
been started.
* If the thread is eventually started, it immediately
terminates.
* <p>
* An application should not normally try to catch
* <code>ThreadDeath</code> unless it must do
some extraordinary
* cleanup operation (note that the throwing of
* <code>ThreadDeath</code> causes
<code>finally</code> clauses of
* <code>try</code> statements to be executed
before the thread
* officially dies). If a <code>catch</code> clause
catches a
* <code>ThreadDeath</code> object, it is important
to rethrow the
* object so that the thread actually dies.
* <p>
* The top-level error handler that reacts to
otherwise uncaught
* exceptions does not print out a message or
otherwise notify the
* application if the uncaught exception is an
instance of
* <code>ThreadDeath</code>.

So -

a) you can't catch Throwable and not rethrow
ThreadDeath if you got it.

b) WrapperManager.run() [and maybe other places]
don't cope with unchecked exceptions happening (infact
any throwable). It should at least log the problem.

Discussion


Log in to post a comment.