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: Guilhem Lavaux
Subject: Re: [cp-patches] Re: RFC: Patch for duplicate entries in serialPersistentFields
Date: Sun, 11 Dec 2005 21:58:22 +0100
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050322)

Archie Cobbs wrote:
Stuart Ballard wrote:

Jeroen pointed out to me a while back that you can use generics to throw an
unchecked exception:


There's also a way to do this without using JDK 1.5 stuff, but it's
even uglier :-)

Construct a class (dynamically) that has a default constructor
that simply throws whatever exception you want. Then invoke
Class.newInstance() on the class.


Bah ! I would rather use a native function that will throw directly InvalidClassException. The problem is that's will be anyway hidden to the general user and that he/she may be surprised getting that sort of exception.

Guilhem.




reply via email to

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