Skip to content

[TEXT-245] Trim custom format names without a style - #799

Open
hutiefang76 wants to merge 1 commit into
apache:masterfrom
hutiefang76:frank/fix-text245-format-whitespace-20261203
Open

hutiefang76 wants to merge 1 commit into
apache:masterfrom
hutiefang76:frank/fix-text245-format-whitespace-20261203

Conversation

@hutiefang76

@hutiefang76 hutiefang76 commented Dec 3, 2026 •

Copy link
Copy Markdown

Jira: https://issues.apache.org/jira/browse/TEXT-245

ExtendedMessageFormat documents whitespace trimming for custom format names, but {0,upper } falls through to MessageFormat and throws when no style follows the name. Trim that name before registry lookup; styled arguments keep their existing parsing. The release note credits the original reporter.

Add nine cases covering whitespace, pattern round trips, factory name/arguments/locale, case-sensitive rejection and the built-in number-format fallback. Five invocations reproduce the original error; all 32 focused tests pass with the fix.

The default Maven build passed on JDK 17 with Java 8 release: 2,052 tests, zero failures/errors, one skipped. RAT, binary compatibility, Checkstyle, PMD, SpotBugs and Javadoc checks passed. The same 32 focused tests also passed on a local Java 8 runtime with zero skips.

  • Read the contribution guidelines.
  • Read the ASF Generative Tooling Guidance.
  • AI assistance: DeepSeek deepseek-v4-pro prepared the code, tests and first-pass review; OpenAI Codex coordinated fixture corrections, verification and this PR text.
  • Run a successful default Maven build.
  • Add behavioral regression tests.
  • Describe the problem, approach and validation.
  • Use a meaningful commit message with Assisted-By trailers.

Honor the documented whitespace contract when a custom format has
no style. Keep the existing styled format arguments unchanged.

Cover whitespace, factory inputs, pattern round trips, case-sensitive
lookup, and the standard number-format fallback.

Assisted-By: DeepSeek deepseek-v4-pro
Assisted-By: OpenAI Codex
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.

1 participant