<Swing Dev> [jdk17] RFR: 8268775: Password is being converted to String in AccessibleJPasswordField

Phil Race prr at openjdk.java.net
Wed Jun 23 20:40:30 UTC 2021


On Wed, 23 Jun 2021 19:31:15 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

>> src/java.desktop/share/classes/javax/swing/JPasswordField.java line 546:
>> 
>>> 544:         public String getAfterIndex(int part, int index) {
>>> 545:             if (part == AccessibleText.CHARACTER) {
>>> 546:                 return getEchoString(super.getAfterIndex(part, index));
>> 
>> I don't see how removing the local variable changes anything. Explanation ??
>
> Here it is just a slight code cleanup. We do not need additional variable for passing value from one method to another. It serves no other purpose at all.

Let me ask it this way.
Does super.getAfterIndex(part, index) return a String with any of the password in clear text ? 
It seems to me like it might.

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

PR: https://git.openjdk.java.net/jdk17/pull/127


More information about the swing-dev mailing list