On Thu, 17 Nov 2022 19:25:42 GMT, Brent Christian <bchri...@openjdk.org> wrote:
> [JDK-8290036](https://bugs.openjdk.org/browse/JDK-8290036) documented the > shutdown sequence, noting that calling Runtime.halt() skips the shutdown > sequence and immediately terminates the VM. Thus, "threads' current methods > do not complete normally or abruptly; no finally clause of any method is > executed". > > One ramification of this is that resources within try-with-resource blocks > will not be released. It would be good to state this explicitly. src/java.base/share/classes/java/lang/Runtime.java line 95: > 93: * threads' current methods do not complete normally or abruptly. > 94: * {@linkplain Thread.UncaughtExceptionHandler Uncaught exception > handlers} are not run, > 95: * no {@code finally} clause of any method is executed, and > try-with-resource `try-with-resource` or `try-with-resources`? src/java.base/share/classes/java/lang/Runtime.java line 283: > 281: * any cleanup actions intended to be performed by shutdown hooks, > 282: * {@linkplain Thread.UncaughtExceptionHandler uncaught exception > handlers}, > 283: * finally blocks, or try-with-resource blocks. This can lead to > data corruption. Same comment as above. ------------- PR: https://git.openjdk.org/jdk/pull/11218