On Fri, 4 Sep 2026 06:27:48 GMT, Prasanta Sadhukhan <[email protected]> wrote:
> Test fails citing > > > java.lang.Exception: popup class is: > javax.swing.PopupFactory$HeavyWeightPopup, expected: > javax.swing.PopupFactory$LightWeightPopup > at bug6800513.testFrame(bug6800513.java:78) > at bug6800513.main(bug6800513.java:146) > at > java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) > at java.base/java.lang.reflect.Method.invoke(Method.java:583) > at > com.sun.javatest.regtest.agent.MainMethodHelper.executeModernMainClass(MainMethodHelper.java:56) > at > com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:140) > at java.base/java.lang.Thread.run(Thread.java:1527) > JavaTest Message: Test threw exception: java.lang.Exception: popup class is: > javax.swing.PopupFactory$HeavyWeightPopup, expected: > javax.swing.PopupFactory$LightWeightPopup > > > > On macOS, Aqua installs `com.apple.laf.ScreenPopupFactory` as Swing’s shared > PopupFactory. While Aqua is active, its getPopup(...) explicitly [calls the > internal “get heavy-weight popup > [accessor]"](https://github.com/openjdk/jdk/blob/f0952f6ce6cc43db4326eda0e397711d36c31fc6/src/java.desktop/macosx/classes/com/apple/laf/ScreenPopupFactory.java#L58-L60) > > It does this so that menu popups can have native [Aqua-specific translucency, > shadow, > rounded-corner](https://github.com/openjdk/jdk/blob/f0952f6ce6cc43db4326eda0e397711d36c31fc6/src/java.desktop/macosx/classes/com/apple/laf/ScreenPopupFactory.java#L40). > Therefore it intentionally ignores > JPopupMenu.setDefaultLightWeightPopupEnabled(true). > > Also the spec supports that L&F can choose to always choose heavy weight > popups > https://docs.oracle.com/en/java/javase/25/docs/api/java.desktop/javax/swing/JPopupMenu.html#setLightWeightPopupEnabled(boolean) > >> Some look and feels might always use heavyweight popups, no matter what the >> value of this property. > > so fix is made to ignore the subtest for Aqua L&F > > > > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). This pull request has now been integrated. Changeset: 7f068889 Author: Prasanta Sadhukhan <[email protected]> URL: https://git.openjdk.org/jdk/commit/7f068889b2d65a5ae2e10124da0f79eb20067521 Stats: 5 lines in 2 files changed: 2 ins; 1 del; 2 mod 7184956: [macosx] JPopupMenu.setDefaultLightPopupEnable(true) doesn't work correctly Reviewed-by: kizune, azvegint ------------- PR: https://git.openjdk.org/jdk/pull/32696
