Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Wiki Markup
    According to the Java Language Specification \[[JLS 2005|AA. Bibliography#JLS 05]\] Section 12.6.2 "Finalizer Invocations are Not Ordered"

    Wiki Markup
    The Java programming language imposes no ordering on {{finalize}} method calls. Finalizers \[of different objects\] may be called in any order, or even concurrently.

    One consequence is that slow-running finalizers can delay execution of other finalizers in the queue. Further, the lack of guaranteed ordering can lead to substantial difficulty in maintaining desired program invariants.
  • Uncaught exceptions thrown during finalization are ignored. When an exception is thrown in a finalizer, the process itself immediately stops, and consequently fails to accomplish its sole purpose.

...