Skip to content

Make bean getter lookup independent of the default locale - #314

Open
curforever wants to merge 1 commit into
spullara:mainfrom
curforever:fix/locale-independent-getters
Open

curforever wants to merge 1 commit into
spullara:mainfrom
curforever:fix/locale-independent-getters

Conversation

@curforever

Copy link
Copy Markdown

Fixes #309.

Bean getter lookup currently uppercases the first property-name character using the default Locale. With Turkish or Azerbaijani defaults, ingredients becomes İngredients, so lookup attempts getİngredients() instead of the existing getIngredients() and renders a missing value.

Use Locale.ROOT for this member-name conversion. Direct method/getter/field precedence, visibility checks, inheritance/interfaces, cache behavior and the existing full-string Unicode case mapping remain unchanged. No public API or dependency changes.

Example with getIngredients() returning cheese and getSauces() returning tomato, under tr_TR:

  • Template: {{ingredients}}/{{sauces}}
  • Before: /tomato
  • After: cheese/tomato

Validation on Windows / Temurin8u504 / Maven3.9.11, with the existing Java8 POM:

  • Same 56 regression cases: 28 assertion failures before, all56 pass after. Both ReflectionObjectHandler and SimpleObjectHandler are covered across ROOT/English/Turkish/Azerbaijani, get/is properties, inherited/interface getters, lookup precedence, compiled-template reuse after Locale changes and multi-character Unicode uppercase mapping. Tests restore general/DISPLAY/FORMAT Locales after each case.
  • mvn -B -ff -ntp clean package -pl '!benchmarks': 362 passing, 8 default skipped, zero failures/errors, all8 CI reactor projects.
  • mvn -B -ff -ntp test -pl '!benchmarks': 362 passing, 8 default skipped, zero failures/errors. Repeated results are not counted as additional tests.
  • The benchmarks module is excluded exactly as in the repository's CI; its long-running JMH suite was not executed. Compiler benchmark-style unit tests were kept enabled. No speedup is claimed. Kotlin-generated getter signatures are represented by Java beans; the Kotlin compiler and other OS/JDK matrices were not run locally.

Implementation and validation were assisted by OpenAI Codex. No human code-review approval is claimed.

The first full build stalled at the old HTTP Twitter repository. The exact required dependencies are available on official Maven Central, so the final runs use a B012-local settings mirror for repository id Twitter only. No POM, dependency version, global settings or TLS validation was changed; the interrupted attempt is preserved as incomplete.

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.

In Turkish locale, fields starting with the character "i" are lost

1 participant