On Fri, 16 Oct 2020 14:08:53 GMT, Florian Kirmaier <fkirma...@openjdk.org> 
wrote:

>> modules/javafx.base/src/test/java/test/util/memory/JMemoryBuddy.java line 84:
>> 
>>> 82:
>>> 83:     /**
>>> 84:      * Checks whether the content of the WeakReference can be collected.
>> 
>> -> Checks whether the content of the WeakReference **is** collected.
>
> That's not true. At the moment of method-call, the variable might not be 
> collected.
> It doesen't check whether it's collected, it checks whether it is 
> "collectable".

Agreed that "can be collected" is technically more accurate (meaning that 
"collectable" is a reasonable choice for the
name). Once an object is weakly reachable all `WeakReference`s are cleared and 
the object can be finalized. The actual
finalization might happen later.

-------------

PR: https://git.openjdk.java.net/jfx/pull/204

Reply via email to