RFR: 8276700: Improve java.lang.ref.Cleaner javadocs [v2]
Alan Bateman
alanb at openjdk.java.net
Wed Nov 10 09:46:39 UTC 2021
On Wed, 10 Nov 2021 09:30:07 GMT, Hendrik Schreiber <hschreiber at openjdk.org> 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 the instance to be cleaned, to make the point even more clear to those people who never read the javadoc *prose*.
>>
>> I have signed the OCA a while back as [hschreiber](https://openjdk.java.net/census#hschreiber).
>
> 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.
>
> Co-authored-by: Mandy Chung <mandy.chung at oracle.com>
src/java.base/share/classes/java/lang/ref/Cleaner.java line 93:
> 91: *
> 92: * // Static state class, capturing information necessary for
> 93: * // State class captures information necessary for cleanup.
I think it would be simpler to just drop L92, meaning start with "State class captures ..." rather than having "state class" and "State class" in the same sentence.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6076
More information about the core-libs-dev
mailing list