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/