Repository navigation
#3823: generated Java formats and case-maps with Locale.ROOT - #3841
Merged
Merged
Conversation
The default JVM locale changes what generated code prints: String.format("%04d") gives
Arabic-Indic or Devanagari digits under ar/hi, and "i".toUpperCase() is "İ" under tr --
so a GDG generation name, a CICS dispatch switch or a JCL COND test could differ by
the server's locale.
- batch forge (GDG name, JclConditions), call forge (dispatch switch), screen forge
(CSS colour): Locale.ROOT everywhere, with the import
- the carddemo-intcalc reference port: the same
- a porting rule tells ported code to do the same
- test: a generated estate has no String.format without Locale.ROOT (checked per
call) and no no-argument toUpperCase / toLowerCase
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3823 (epic #3819).
Why
Generated Java used the JVM's default locale:
String.format("%04d", …)prints Arabic-Indic or Devanagari digits under anarorhilocale;"i".toUpperCase()gives"İ"undertr.So a GDG generation name (
G0001V00), a CICS dispatch switch or a JCLCONDtest could behave differently depending on the server's locale.What
DatasetResolver's GDG name andJclConditionsuseLocale.ROOT.switchusestoUpperCase(Locale.ROOT).toLowerCase(Locale.ROOT).carddemo-intcalc(Cbact04cService) gets the same change.PORTING_RULESentry, so LLM-ported code does the same.tests/cobol_mainframe/test_locale_root.pygenerates an estate (JCL, BMS, a CICS program with a dynamic CALL). It checks everyString.formatcall forLocale.ROOT, rejects any no-argument case mapping, and requires that at least one format was generated.Verified
tests/cobol_mainframe/, 695 passed and 27 skipped.First drafted by a sandboxed Gemini fleet agent. I reviewed it and tightened the test from a per-file check to a per-call check.
🤖 Generated with Claude Code
https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g