classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SecurityManager troubles


From: Gary Benson
Subject: Re: SecurityManager troubles
Date: Mon, 16 Jan 2006 10:20:34 +0000

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?  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.

Cheers,
Gary




reply via email to

[Prev in Thread] Current Thread [Next in Thread]