RFR: 8344332: (bf) Migrate DirectByteBuffer away from jdk.internal.ref.Cleaner [v2]
Kim Barrett
kbarrett at openjdk.org
Sun Jun 29 20:37:39 UTC 2025
On Fri, 27 Jun 2025 19:29:18 GMT, Brent Christian <bchristi at openjdk.org> wrote:
>> I intentionally (re)used the "Cleaner" name to avoid a bunch of renames that
>> would increase the size of the change and distract from the meat of it. I
>> think the name to use might be affected by how the implementation of the set
>> of cleanup objects might get merged between the new java.nio.BufferCleaner and
>> java.lang.ref.Cleaner. Perhaps the java.lang.ref.Cleaner.Cleanable interface
>> should be used throughout? I didn't want to expand this change to include
>> those kinds of questions.
>
> I would be in favor of renaming to avoid ambiguity. There is already `java.lang.ref.Cleaner` and `jdk.internal.ref.Cleaner`, and now this `Cleaner` is really the same thing as `java.lang.ref.Cleaner.Cleanable`.
> It could be done as a follow-on change, if need-be.
Note that `jdk.internal.ref.Cleaner` is no longer used after this change. PR 22165 would have
removed it. I'd like to leave some of the cleanup, including long-term choice of naming that
internal class, for later.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25289#discussion_r2173907431
More information about the nio-dev
mailing list