classpath-patches
[Top][All Lists]
Advanced

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

Re: [cp-patches] Re: RFC: Patch for duplicate entries in serialPersisten


From: Robert Schuster
Subject: Re: [cp-patches] Re: RFC: Patch for duplicate entries in serialPersistentFields
Date: Mon, 12 Dec 2005 12:20:49 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.12) Gecko/20051208

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


reply via email to

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