RFR: 8354646: java.awt.TextField allows to identify the spaces in a password when double clicked at the starting and end of the text [v15]

Jeremy Wood duke at openjdk.org
Mon Jun 9 20:44:57 UTC 2025


> 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 . The same solution was copied and pasted into the SynthPasswordFieldUI . But the AquaTextPasswordFieldUI does NOT extend either class with the 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. This should benefit all the PasswordFieldUI's (that I know about).
> 
> 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 src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java
  
  Co-authored-by: Alexey Ivanov <alexey.ivanov at oracle.com>

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/25443/files
  - new: https://git.openjdk.org/jdk/pull/25443/files/19af4e31..4bc3c344

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25443&range=14
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25443&range=13-14

  Stats: 3 lines in 1 file changed: 2 ins; 1 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/25443.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25443/head:pull/25443

PR: https://git.openjdk.org/jdk/pull/25443


More information about the client-libs-dev mailing list