Gary Benson wrote:
> Archie Cobbs wrote:
> > Gary Benson wrote:
> > > + try
> > > + {
> > > + Class.forName("java.security.Security");
> > > + }
> > > + catch (Throwable t)
> > > + {
> > > + }
> >
> > It might be more appropriate to only catch Exception, not Throwable.
>
> So I was halfway through thinking about this when I forgot and
> committed it :(
>
> Why Exception as opposed to Throwable?
If one of our VMs has a bug (it does happen ;-)) swallowing exceptions
makes it much harder to debug (or to even notice it).
> My reasoning was that the code
> was added to possibly make more things work than do already, and that
> anything that might make less things work was to be avoided.
>
> The alternative to Throwable is to catch ClassNotFoundException, which
> is the only subclass of Exception that Class.forName throws.
Simply catching ClassNotFoundException would be best. Sorry for not
noticing that before.
Regards,
Jeroen
_______________________________________________
Classpath mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath