491477 messages in 933 lists

John Wilson schrieb:
[...]
> I do, however, think that  we could improve our Exception handling whit 
> respect to Java interfacing. If a groovy method throws a checked 
> exception but does not have a throws clause then a Java method which 
> calls it cannot catch the exception.

a reason to declare that Exception in the throws clause

> The Groovy compiler can tell that a 
> checked exception is thrown and could, in principle, put the throws 
> clause into the generated bytecode.

sure yes... when I move the exception throwing code into another method, 
then what? I don't think we should do that... too much magic and for 
APIwriters it is a bad thing to have these Exceptions in there without 
their knowledge. And if I write a method m1 that calls a method m2 that 
throws a checked exception e1 and if I call this method m1, then how do 
I catch e1? When I think about IOEceptions, then I think it is not 
reasonable to automatically put anything into the method signature, that 
is not decided by the programer.

bye blackdrag


-- 
Jochen "blackdrag" Theodorou
Groovy Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/
Message Thread
Improvement in handling exception Daniel.Sun (realbluesun@hotmail...)
08 Feb 2007
Re: [groovy-jsr] Improvement in handling exception John Wilson (tug@wilson.co...)
08 Feb 2007
Re: [groovy-jsr] Improvement in handling exception Paul King (paulk@asert.com...)
08 Feb 2007
Re: [groovy-jsr] Improvement in handling exception Russel Winder (russel@russel.org...)
08 Feb 2007
Re: [groovy-jsr] Improvement in handling exception Jochen Theodorou (blackdrag@gmx...)
08 Feb 2007
Re: [groovy-jsr] Improvement in handling exception Daniel.Sun (realbluesun@hotmail...)
08 Feb 2007
Re: [groovy-jsr] Improvement in handling exception John Wilson (tug@wilson.co...)
08 Feb 2007
Re: [groovy-jsr] Improvement in handling exception Russel Winder (russel@russel.org...)
08 Feb 2007
Re: [groovy-jsr] Improvement in handling exception Daniel.Sun (realbluesun@hotmail...)
08 Feb 2007
Copyright 2006-2008 The Codehaus Foundation
Powered by Codehaus March (Version: 0.1-HEAD)