Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8295857

Clarify that cleanup code can be skipped when the JVM terminates (e.g. when calling halt())

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • core-libs
    • b19
    • 20
    • b28

        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.

              bchristi Brent Christian
              bchristi Brent Christian
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: