JDK 20 | JDK 21 |
---|---|
20 b28Fixed | 21Fixed |
Relates :
|
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. Some developers may realize this implication of calling halt(), but it would be better to state it explicitly.
|