[jboss-dev] throws Throwable

Carlo de Wolf cdewolf at redhat.com
Tue May 5 04:02:54 EDT 2009


What's the use case for having a public method: doSomething(Object 
someArgs...) throws Throwable ?

Most of the time the user of such a facility will do:
catch(Throwable t)
{
   throw new RuntimeException(t);
}

This leads to interesting situations whenever an ThreadDeath or 
VirtualMachineError (/OOM) is thrown.
(Note that ThreadDeath should never occur, but that's another story.)

I think it's just laziness on the part of the facilitator to not 
properly handle exceptions and that this construct should be abolished.

Carlo



More information about the jboss-development mailing list