On Wed, 4 Jun 2025 21:09:37 GMT, Jeremy Wood <d...@openjdk.org> wrote:
>> Make sure AquaTextPasswordFieldUI can't use selectWordAction. >> >> The core problem here was we could call selectWordAction in the Aqua LAF on >> a JPasswordField. This problem was already solved in the >> BasicPasswordFieldUI and SynthPasswordFieldUI, but the >> AquaTextPasswordFieldUI does NOT extend the BasicPasswordFieldUI, so it >> wasn't inheriting this solution. >> >> So the problem is partially about multiple inheritance. >> >> My first response at solving the problem is just to move the existing >> solution to the parent BasicTextUI class and use an instanceof to make sure >> it is only applied to JPasswordFields. >> >> There may be many different philosophies/recommendations on how to resolve >> this; I'm open to suggestions. > > Jeremy Wood has updated the pull request incrementally with one additional > commit since the last revision: > > Update > test/jdk/javax/swing/plaf/basic/BasicPasswordFieldUI/PasswordSelectionWordTest.java > > Co-authored-by: Alexey Ivanov <alexey.iva...@oracle.com> test/jdk/javax/swing/plaf/basic/BasicPasswordFieldUI/PasswordSelectionWordTest.java line 52: > 50: UIManager.getInstalledLookAndFeels()) { > 51: System.out.println("Testing LAF: " + laf.getClassName()); > 52: SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf)); If setLookAndFeel finds UnsupportedLookAndFeelException then the runTest here is still executed here whereas it shouldn't continue for that L&F...guess you can use a boolean return value for setLookAndFeel. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25443#discussion_r2128771448