Code review request for 6857789: (reflect) Create common superclass of reflective exceptions

Rémi Forax forax at
Fri Jul 10 21:19:21 UTC 2009

Joseph D. Darcy a écrit :
> Rémi Forax wrote:
>> This request seems dangerous,
>> InvocationTargetException should not be retrofitted because
>> usually its catch block is different from the others.
>> As is, this patch will introduce more burden than it tries to revolve.
> If needed InvocationTargetException can continue to have a separate 
> catch block; if you happen to put a catch for  
> ReflectiveOperationException ahead of InvocationTargetException, the 
> compiler will emit an error.

Yes, you can.
The problem here is that in most cases you *must* write a specific code 
to handle InvocationTargetException.

So retrofitting InvocationTargetException is in my opinion a regression 
it will lead to codes with more bugs
I don't see this as an improvement.

> -Joe


More information about the core-libs-dev mailing list