JDK-8258373 : Update the text handling in the JPasswordField
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7,8,11,15,16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-12-15
  • Updated: 2022-11-21
  • Resolved: 2020-12-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 15 JDK 16 JDK 17 JDK 7 JDK 8
11.0.11-oracleFixed 13.0.9Fixed 15.0.5Fixed 16 b30Fixed 17Fixed 7u301Fixed 8u271Fixed
Related Reports
Relates :  
Relates :  
Description
 - Intentionally the JTextComponent.setText/getText property was marked as bound=false. It was implementing by marking the JTextComponent.setText() in a special way.
 - But the getText() was overidden in the JPasswordField the java.beans.Introspector started to use information from the this JPasswordField.getText() method instead of information from JTextComponent.setText(). So the "text" property became "bound".

To fix it in a compatible way we may need to override the JTextComponent.setText()  as well and mark it to be "bound=false"

We also have to improve internal data cleanup in the JPasswordField by setText() method.

Comments
Adding jdk8u-needs-pr. This fix needs to be rebased on to the current GitHub 8u-dev repository - https://github.com/openjdk/jdk8u-dev - and reviewed there before being approved and integrated.
14-04-2022

Fix request (13u): no adjustments for the patch, tests of jdk/javax/swing pass OK.
29-07-2021

Fix request (15u): should be ported here, too. The patch applies without adjustments. Tested with test/jdk/javax/swing suite.
29-07-2021

Fix Request Should get backported for parity with 11.0.11-oracle. Applies cleanly.
15-01-2021

Changeset: 7afb01dc Author: Sergey Bylokhov <serb@openjdk.org> Date: 2020-12-18 06:26:16 +0000 URL: https://git.openjdk.java.net/jdk16/commit/7afb01dc
18-12-2020