|
|
|
|
|
by layer8
1279 days ago
|
|
This is not an “exception pattern”. It’s just how the language works, and is a consequence of the concept of “abrupt completion”. It means that you can unconditionally (i.e. independent from whether there is an exception or not) divert the control flow using finally. It’s not much different from how when an exception is thrown from the finally block, the prior exception gets lost. From the language spec [0]: If the finally block completes abruptly for reason S, then the try statement completes abruptly for reason S (and the throw of value V is discarded and forgotten). [0] https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.htm... |
|