On Thu, 9 May 2024 19:48:19 GMT, Johan Vos <j...@openjdk.org> wrote:

>> A listener was added but never removed.
>> This patch removes the listener when the menu it links to is cleared. Fix 
>> for https://bugs.openjdk.org/browse/JDK-8319779
>
> Johan Vos has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Add more type info

I've tested on macOS, and tests pass now, and fail without the changes from 
this PR.
I've left some comments, but once addressed, I'll re-approve.

modules/javafx.graphics/src/shims/java/com/sun/javafx/tk/quantum/GlassSystemMenuShim.java
 line 37:

> 35: 
> 36:     private GlassSystemMenu gsm;
> 37:     final ArrayList<WeakReference<Menu>> uncollectedMenus = new 
> ArrayList<>();

this can be private?

modules/javafx.graphics/src/shims/java/com/sun/javafx/tk/quantum/GlassSystemMenuShim.java
 line 54:

> 52:     protected void setMenuBindings(final Menu glassMenu, final MenuBase 
> mb) {
> 53:         super.setMenuBindings(glassMenu, mb);
> 54:         uncollectedMenus.add(new WeakReference(glassMenu));

Add `<>` to avoid raw use of `WeakReference`

tests/system/src/test/java/test/com/sun/javafx/tk/quantum/SystemMenuBarTest.java
 line 289:

> 287:     public void testJDK8309935() {
> 288:         MenuBar menuBar = new MenuBar();
> 289:         AtomicReference<Throwable> throwableRef = new AtomicReference();

Add missing `<>` to avoid raw use of `AtomicReference`

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

Marked as reviewed by jpereda (Reviewer).

PR Review: https://git.openjdk.org/jfx/pull/1283#pullrequestreview-2115396776
PR Review Comment: https://git.openjdk.org/jfx/pull/1283#discussion_r1637974242
PR Review Comment: https://git.openjdk.org/jfx/pull/1283#discussion_r1637973453
PR Review Comment: https://git.openjdk.org/jfx/pull/1283#discussion_r1637980139

Reply via email to