SoftCleanable and WeakCleanable

Mandy Chung mandy.chung at
Sat Aug 15 18:29:54 UTC 2020

It's a fine idea to remove these 2 classes and resurrect them when it 
finds a need for it.  I will file a JBS issue.


On 8/15/20 2:34 AM, Peter Levart wrote:
> Hi,
> You are right. For public Cleanable API, only the PhantomCleanable is 
> used currently. It is subclassed by CleanerImpl.PhantomCleanableRef to 
> implement the public API and also a couple of specialized internal 
> implementations. When the public Cleanable API was created, it was 
> thought that there might be internal needs for Weak and Soft variants 
> too. So these classes are still waiting for such use. Perhaps they 
> could be retired and resurrected from VCS history when need arises.
> Regards, Peter
> On 8/15/20 9:00 AM, Florian Weimer wrote:
>> * Florian Weimer:
>>> * Alan Bateman:
>>>> On 01/08/2020 10:23, Florian Weimer wrote:
>>>>> Are jdk.internal.ref.SoftCleanable and jdk.internal.ref.WeakCleanable
>>>>> actually used?
>>>>> CleanerTest rests them, but I don't see any other mentions of these
>>>>> classes.
>>>> Do you mean used outside of the cleaner implementation? Maybe you are
>>>> looking to change them to non-public?
>>> It's not clear to me how the cleaner implementation itself uses them.
>>> java.lang.ref.Cleaner only needs PhantomCleanableRef.
>> Any further comments on this topic?  Thanks.

More information about the core-libs-dev mailing list