Re: RFR: 8276700: Improve java.lang.ref.Cleaner javadocs [v2]

2021-11-10 Thread Hendrik Schreiber
On Wed, 10 Nov 2021 09:41:44 GMT, Alan Bateman wrote: >> Hendrik Schreiber has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update src/java.base/share/classes/java/lang/ref/Cleaner.java >> >> Making the comment even clearer. >>

Re: RFR: 8276700: Improve java.lang.ref.Cleaner javadocs [v2]

2021-11-10 Thread Alan Bateman
On Wed, 10 Nov 2021 09:30:07 GMT, Hendrik Schreiber wrote: >> Trivial improvement. >> >> Explicitly show how to create a `Cleaner` instance using `Cleaner.create()`. >> Repeat (again) in the code example that the `State` `Runnable `should be >> implemented as static class and not reference

Re: RFR: 8276700: Improve java.lang.ref.Cleaner javadocs [v2]

2021-11-10 Thread Hendrik Schreiber
On Tue, 9 Nov 2021 11:14:37 GMT, Anthony Vanelverdinghe wrote: >> Let me add, why I have raised this issue. >> >> I was going to migrate some older code which uses the `finalize()` method to >> the `Cleaner` mechanism. New it it, there seemed to be two pitfalls: >> >> 1. Understanding the

Re: RFR: 8276700: Improve java.lang.ref.Cleaner javadocs [v2]

2021-11-10 Thread Hendrik Schreiber
On Mon, 8 Nov 2021 23:21:49 GMT, Brent Christian wrote: >> This is what I suggested and makes it clear that *must hold no reference to >> the instance being cleaned*. Maybe you didn't notice it's still there? >> >> >> *// State class captures information necessary for cleanup. >>

Re: RFR: 8276700: Improve java.lang.ref.Cleaner javadocs [v2]

2021-11-10 Thread Hendrik Schreiber
> Trivial improvement. > > Explicitly show how to create a `Cleaner` instance using `Cleaner.create()`. > Repeat (again) in the code example that the `State` `Runnable `should be > implemented as static class and not reference the instance to be cleaned, to > make the point even more clear to