Repository navigation
#3815: generated Java keeps national names legally and builds as UTF-8 - #3896
Merged
Merged
Conversation
- java_identifier / java_class_base / container_var: NFC-normalise, keep national letters (`ØKONOMI` was the class `Konomi`), replace characters Java rejects (`§`) with `_` instead of dropping them, and case-map one letter per letter (`ß` no longer becomes `Ss`). Pure-ASCII output is byte-identical (fuzzed against origin/main). - Gradle build sets options.encoding = 'UTF-8' on every JavaCompile; the Maven pom already inherits UTF-8 from spring-boot-starter-parent. - cobol_jcl_forge: SELECT/ASSIGN and PROGRAM-ID accept national letters, so a national-named file keeps the program batch and its controller compiles. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
This was referenced Sep 27, 2026
#3815 (part 2): stored paths are NFC; include / copybook resolution matches across NFC and NFD
#3917
Merged
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.
Part of #3815
What changed
java_identifier/java_class_base/container_var(cobol_to_java_common.py,cobol_to_java_names.py):.javafile as its composed form. The result is normalised again after thev/Legacyprefix, because a prefix placed before a leading combining mark composes with it.java_class_basesplit on[^A-Za-z0-9], soØKONOMIbecame the classKonomi, the same asKONOMI. It now splits on ASCII punctuation only._instead of being dropped (KUNDE§NR→kunde_nr, which cannot collide withKUNDENRorKUNDE-NR). The check uses Java's isJavaIdentifierStart/Part categories.ßstaysßrather than becomingSs, which would makeSTRASSE-ßthe same name asSTRASSE-SS. For every other character the new helpers return exactly whatstr.lower/title/capitalizereturn. A fuzz of 200k random non-expanding BMP strings found no difference.origin/mainfor all three functions, and the refraction snapshots do not move.build.gradlenow setsoptions.encoding = 'UTF-8'on everyJavaCompiletask. Spring Boot's Gradle plugin already defaults to UTF-8, and the generated project compiled without the setting. The setting removes the dependence on the plugin: a plainjavaGradle build with-Dfile.encoding=windows-1252fails onØkonomiService.javawithout it and passes with it.spring-boot-starter-parent, which setsproject.build.sourceEncoding=UTF-8, and a test asserts that parent.cobol_jcl_forge.analyze_cobol_intent: the SELECT/ASSIGN and PROGRAM-ID patterns now accept non-ASCII letters, with ASCII behaviour unchanged. Before,SELECT KUNDER-ÆØÅ ASSIGN TO FILEAwas missed, so the program was treated as transactional instead of batch. Its controller then asked for aFileaDTOthat nothing generates, and the national estate did not compile.Proof
tests/cobol_mainframe/test_java_unicode_names.py(37 tests):§orß;javac -encoding UTF-8compiles a classØkonomiServicewith national fields.tests/tools/java_target_matrix.py <estate> --scan --only default gradle plain-classes plain-recordson a national estate reports PASS for all four configs (Maven and Gradle 8.10.2, JDK 17). The estate is the unicode_gauntlet mainframe seed'scbl,jclandcsdfiles, with names renamed byunicode_gauntlet.renamer: programsØKONOMI/RÆKNING, fileKUNDER-ÆØÅ, recordKUNDREC-ÄÖÜ, fieldsKUNDNR-Ø/KUNDNAVN-ÆØÅ/WS-BELØB/WS-STRAßE, paragraph100-RÆKNE. It generatesØkonomiService.java,KundrecÄöü.java,private String kundnavnÆøå;and so on.defaultandgradlefailed withcannot find symbol FileaDTO.gradle-plain-21could not run on this box because its JDK 21 is a JRE only (no javac).pr_gates.pypasses every gate: lint, audits, secrets, xray, gauntlet, golden (222s) and suite (716s).Not done
java_url_segmentstill splits on[^A-Za-z0-9], soØKONOMImaps to/api/v1/konomi. This still compiles, but it can collide withKONOMI. A non-ASCII@RequestMappingneeds its own decision about percent-encoding.test_forgeclass names,spring_forgeline 112) instead of calling these functions.cobol_dag_architect._SELECT/_PROGRAM_IDandcobol_compiler_forge's SELECT pattern are still ASCII-only.#/@in a name are still passed through unchanged, which is illegal Java. That is left alone to keep ASCII output byte-identical.🤖 Generated with Claude Code