A finally clause ought to be another block afterwards. If it's a label then it leads, as you say, to odd semantics. It's not only the fall-through case that makes it questionable, but also the execution order when it isn't the last thing in the block. Furthermore, since a finally block is executed even when no error is thrown, one gets the question why the exception variable is in scope there and what value it would have then.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-10-06 07:56: Subject: Re: throw or return
Perhaps you could make it look like a switch block (although fall through behaviour isn't ideal, in particular not when you introduce the label "finally :", so perhaps one shouldn't use "case" for this).
try { ... some code ... } catch (Exception e) { case invalid_file_system_type: ... break; case no_permission: case not_mounted: ... break; default: ... finally: ... }
I was trying to figure out if we have any current language constructs that takes two blocks of code, and the only I could think of was if () { ... } else { ... }.
/ Niels Möller (igelkottsräddare)