On Tue, Nov 17, 2009 at 7:56 AM, Tim Ellison <t.p.elli...@gmail.com> wrote:

> The difference I see, by just staring at the code and without running
> it, is that if the 'thrown' Throwable that was caught earlier is not one
> of the tested types (IOException | RuntimeException | Error) then the
> original code throws an AssertionError, whereas sneaky will re-throw the
> raised type.
>
> Not sure why the original has AssertionError...
>

Yeah, the repeated "throw" statements in that code obscured my intentions.

"throw new AssertionError()" is idiomatic for lines of code that should
never ever be executed. In this case, IOException, RuntimeException and
Error were the only things that could have been thrown by the try blocks.

Reply via email to