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

Details

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

    Backports

      Description

        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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: