Hi.

Stuart Ballard wrote:
> I dunno, this seems pretty clean if it works:
> 
> public class Throw {
>   private static Throwable t;
>   public Throw() throws Throwable {throw t;}
>   public static synchronized void uncheckedThrow(Throwable t) {
>     Throw.t = t;
>     try {
>       Throw.class.newInstance();
>     } catch (InstantiationException e) {
>     } catch (IllegalAccessException e) {
>     }
>   }
> }
> 
> Throw.uncheckedThrow(new InvalidClassException("..."));
> 
> A perfectly portable illegal-exception-thrower :)
Funny!
But it works.

cya
Robert

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to