On Mon, 2 Jun 2025 16:57:14 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 two additional > commits since the last revision: > > - 8354646: remove redundant code in SynthPasswordFieldUI > > This is partially in response to: > https://github.com/openjdk/jdk/pull/25443#issuecomment-2929752779 > - 8354646: skip test for unexpected text field UI's > > Also I confirmed this test passes for Nimbus > > This is partially in response to: > https://github.com/openjdk/jdk/pull/25443#issuecomment-2929752779 src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java line 665: > 663: } > 664: > 665: return map; This PR could produce weird results if anyone tried applying a BasicPasswordFieldUI (or SynthPasswordFieldUI or AquaTextPasswordFieldUI ) to a JTextField that is NOT a JPasswordField. Do we care about that use case? (If we do: then we could simply copy and paste the same known solution into AquaTextPasswordFieldUI ? That would make this PR less invasive, but it would involve more copied and pasted code.) Or instead of relying on `instanceof JPasswordField` would rely on `"PasswordField".equals(getPropertyPrefix()`. If anyone has any strong feelings. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25443#discussion_r2121762115