Repository navigation
CobolRecords / CobolEdit are generated only with a VSAM store, but every port ticket requires them #4039
Description
The defect
SkeletonForges.sources() (cobol_to_java_skeleton_forges.py) writes the CobolRecords and CobolEdit runtimes only when RepositoryForge planned at least one VSAM store: records_source() and edit_source() return None when self.stores is empty. Both classes are generated into entity/vsam/.
But the porting rules in every ticket (cobol_to_java_port_tickets.py) tell the porter to go only through these classes:
CobolRecordszoned / packed / binary and their put methods, for numeric fields held in bytes;CobolRecords.numval(text, decimalPoint)for reading numbers from text (Java runtime accepts non-ASCII digits as numbers (Arabic-Indic, Devanagari, full-width) where COBOL NUMERIC/NUMVAL would not #3831), and in the DECIMAL-POINT IS COMMA rule (Globe: DECIMAL-POINT IS COMMA Silently Corrupts Numeric Scale #3984);CobolRecords.sortKey(key, codePage)for key order (Key order: EBCDIC vs the target database's collation -- generated repositories browse and sort differently, MySQL collides case-variant keys #3822);CobolRecords.width/CobolRecords.fitfor multi-byte widths (Globe: EBCDIC SO/SI Bytes (DBCS) Break Java String Offsets #3985, PR Fix #3985: keep whole DBCS characters when a text field is too wide #4038);CobolEdit.format(pic, value, decimalComma, currency)for numeric-edited fields (DECIMAL-POINT IS COMMA invisible to the converter: schema forge mis-sizes, no fact, no edited-PICTURE helper #3827 / CobolEdit.format drops high-order digits of a floating-insertion PICTURE: $$$,$$9.99 of 1234.50 -> $$$,$$4.50 #3933).
A project with no VSAM file (a CICS-only or DB2-only estate, or batch over sequential datasets) gets rules naming classes it doesn't have. The porter then either writes the forbidden hand-made parser, or references a class that doesn't compile. port_runner._RUNTIME_HELPERS also lists entity/vsam/CobolRecords.java and CobolEdit.java, and silently omits them when they're missing.
Proposed fix
Generate both runtimes into every project, as #4036 did for util/CobolCompare:
- Emit them regardless of VSAM stores. Preferably move them to
util/, whereCobolCompareandEbcdicDecoderUtilalready live, since they aren't VSAM-specific. - If they move, update the entity codecs' imports,
port_runner._RUNTIME_HELPERS, and the rule texts that name the package. CobolRecordsbakes in the code page's zoned sign characters (__POSITIVE__/__NEGATIVE__fromdata.code_page); that stays the same.- Refresh the refraction snapshots (excerpts and all 6 full corpora). Today none of them generates these classes, so each gains two files and their guardrail-baseline entries.
Test
- A project generated from an estate with no VSAM file contains
CobolRecordsandCobolEdit, and compiles (java-compile.yml). - The existing VSAM entity tests still find the codec calls.
Activity