On Fri, 21 Aug 2026 16:30:54 GMT, Andy Goryachev <[email protected]> wrote:
>> Kevin Rushforth has updated the pull request incrementally with one >> additional commit since the last revision: >> >> document that WeakReferenceWrapper might be modified or eliminated in the >> future > > modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/WeakReferenceWrapper.java > line 64: > >> 62: private static final Method hasIdentityMethod; >> 63: private final T obj; >> 64: private final WeakReference<T> ref; > > We could, in theory, save one pointer and just use > > `private Object ref;` > > which is either a `WeakReference` or the object itself, and use `(instanceof > WeakReference r)` in `get()`. > > This code is ok since we won't have many instances of this wrapper anyway. I had initially considered that approach, but ended up going with two fields. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2250#discussion_r3832316406
