Skip to content

Close #1512: password TextField visibility regression guard#5121

Merged
shai-almog merged 1 commit into
masterfrom
investigate-1512-password-textfield-focus
May 30, 2026
Merged

Close #1512: password TextField visibility regression guard#5121
shai-almog merged 1 commit into
masterfrom
investigate-1512-password-textfield-focus

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Summary

Closes #1512 as already fixed, with the test as the lock-in.

The 2015 reporter wrote that a TextField with the PASSWORD constraint showed its text correctly while focused but the text "became invisible" once focus moved to another field. I could not reproduce that symptom with the current DefaultLookAndFeel render path: getTextFieldString() builds the bullet-replaced display string identically for the focused and unfocused paths, and the underlying text is preserved across focus loss. The bug was apparently fixed implicitly during a later TextField rewrite and the issue was never closed.

What the test guards against

The new PasswordTextFieldVisibilityTest:

  1. Builds a Form with a password TextField and a second "Other" TextField.
  2. Sets "secret123" on the password field while it is focused.
  3. Reflectively calls DefaultLookAndFeel.getTextFieldString(TextArea) to capture the focused display string and asserts:
    • the length matches the underlying text
    • every character is a non-space bullet (so a future regression that returns all spaces would fail)
  4. Moves focus to the other field and asserts:
    • password.getText() still returns "secret123" (the underlying data isn't cleared)
    • the unfocused display string is byte-identical to the focused one (the original 2015 symptom would fail this)

If the 2015 bug ever returns -- whether by clearing the displayed string, replacing it with spaces, dropping characters, or routing through a focus-conditional branch that returns empty -- this test fails loudly.

Test plan

  • Test passes on current master (proving the bug is no longer present).
  • ASCII-only sources verified.
  • CI verification.

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

…ss (#1512)

The 2015 reporter said a TextField with the PASSWORD constraint
showed its text correctly while focused, but the text "became
invisible" once focus moved to another field.

That symptom is no longer reproducible with the current
DefaultLookAndFeel render path: getTextFieldString() turns the raw
text into the bullet-replaced display string both for the focused and
unfocused render paths, and the underlying text is preserved across
focus loss. So the bug was apparently fixed implicitly during a later
TextField rewrite without the issue being explicitly closed.

Add a regression test that:
- Builds a Form with a password TextField and an "other" TextField.
- Sets some text on the password field while it is focused.
- Reflectively calls getTextFieldString() to capture the focused
  display string and verifies every character is replaced with a
  non-space bullet glyph.
- Moves focus to the other field, asserts password.getText() still
  returns the underlying text, and asserts the unfocused display
  string is byte-identical to the focused one. The 2015 bug, if it
  ever returns, would either drop characters from this string or
  return an all-spaces string -- either is caught here.

Closes #1512 (as "already fixed, locked in by test").

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shai-almog shai-almog force-pushed the investigate-1512-password-textfield-focus branch from 75c013c to fd41b6d Compare May 30, 2026 17:32
@shai-almog shai-almog merged commit 18fbaec into master May 30, 2026
10 checks passed
@shai-almog shai-almog deleted the investigate-1512-password-textfield-focus branch May 30, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TextField Text becomes invisible when focus is lost.

1 participant