Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: v_borchert@despammed.com (Volker Borchert) Newsgroups: comp.lang.java.programmer Subject: Re: Java 9 issues Date: 4 Oct 2017 20:14:20 GMT Organization: Private site at Eddersheim, Germany Lines: 14 Distribution: world Message-ID: References: <3932fb50-27ec-475c-9e74-45387ba59ac1@googlegroups.com> X-Trace: individual.net dvc9ihHU+Ex4bHniEPNLGQCkya/RYGGvdhxpq+RsERCBZenLGO Cancel-Lock: sha1:/Qo2HTSABZX4eLCEe52SsT0aSIc= Xref: csiph.com comp.lang.java.programmer:37557 Eric Sosman wrote: > - (Haven't tried this myself): Ditch finalize(), create a > Reference to your object, and register the Reference with > a ReferenceQueue. When the queue notifies you that the > object is no longer reachable, you can then check that > it's been properly closed. PhantomReference would be the flavor of choice. -- "I'm a doctor, not a mechanic." Dr Leonard McCoy "I'm a mechanic, not a doctor." Volker Borchert