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.
>>
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
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
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.
>>
> 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