[jdk11u-dev] RFR: 8296878: Document Filter attached to JPasswordField and setText("") is not cleared instead inserted characters replaced with unicode null characters

Sergey Bylokhov serb at openjdk.org
Fri Dec 2 00:05:41 UTC 2022


On Thu, 1 Dec 2022 22:02:50 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> Hi all,
> This pull request contains a backport of commit [87f00f4a](https://github.com/openjdk/jdk/commit/87f00f4a1bfb392be0684edcdfa0254caec4ca03) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository.
> The commit being backported was authored by Sergey Bylokhov on 30 Nov 2022 and was reviewed by Phil Race and Alexey Ivanov.
> Thanks!

src/java.desktop/share/classes/javax/swing/JPasswordField.java line 290:

> 288:         DocumentFilter filter = null;
> 289:         if (doc instanceof AbstractDocument) {
> 290:             filter = ((AbstractDocument) doc).getDocumentFilter();

The change is not clean because I have to remove pattern matching in this `instanceof `block.

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

PR: https://git.openjdk.org/jdk11u-dev/pull/1563


More information about the jdk-updates-dev mailing list