det translator: --style structured writes invalid Java for a digit-first COBOL name (ZECS001 50702-MESSAGE)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 63/100
調査の方向性
Start in gitgalaxy/tools/cobol_to_java/det/gen.py around line 161, where the structured path calls camel(it.name) without the digit prefix that the dispatch path applies. Compare the two paths, then check the other camel() callers, including the paragraph one near line 911. Reproduce with the digit-first 50702-MESSAGE example through det.program.translate in structured style. Done when the structured output for that name is a legal Java identifier and a new test that parses or compiles it passes.
索引モデルが issue の本文から書いたものです。
説明
What happens. With style="structured", the det translator writes invalid Java for a COBOL data item whose name starts with a digit.
Reproduced on main f842015da with det.program.translate:
01 50702-MESSAGE.
02 50702-KEY PIC X(08) VALUE 'xxxxxxxx'.
dispatch keeps its s_50702_MESSAGE names and is clean. structured, typed or not, declares a Java field whose name starts with a digit, which does not compile. Real case: zECS ZECS001.cbl:288 (01 50702-MESSAGE) gives private final Field 50702Message.
Cause. gitgalaxy/tools/cobol_to_java/det/gen.py:161 (base = camel(it.name) ..., in the structured path) uses camel() as is. Its docstring says "callers prefix a digit", and this caller does not.
Who it reaches. tests/tools/det_port.py defaults to --style dispatch, so committed det ports and proofs are not affected. gitgalaxy/tools/cobol_to_java/port_runner.py:653 defaults to structured, so a user's det run through port_runner does reach it. COBOL allows digit-first names, so any estate can hit this.
Found by the cobolrt API contract work: tests/tools/cobolrt_api.py --check --generated exits 1 on a structured work directory. That scan is manual today (#7356).
Fix. Prefix the name at this caller the way the dispatch path does, then check every other camel() caller for the same gap. Add a test that translates a digit-first name in structured style and parses or compiles the result.
Note. This edits gitgalaxy/tools/cobol_to_java/** (GENERATOR), so evidence records using gen.py go stale until the next refresh.
Class / Sibling gaps
Class: a generated Java identifier built from a COBOL name without checking that it is a legal Java identifier. Check the other camel() callers (gen.py:911 for paragraphs) and reserved words as well as a leading digit.
- 主要言語
- Python
- スター
- 57
- フォーク
- 11
- 平均マージ
- 1時間 26分
- マージ済み PR(30日)
- 974
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
squid-protocol/gitgalaxy のほかの issue
-
claim:melek scope:core
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
squid-protocol/gitgalaxy#7475 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement priority: medium scope:infra
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
squid-protocol/gitgalaxy#7455 ·
メンテナーはふだん 1 日以内に返信
-
priority: medium refactor scope:infra
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
squid-protocol/gitgalaxy#7444 ·
メンテナーはふだん 1 日以内に返信
-
claim:melek legacy-modernization priority: high scope:core testing
難易度 4/5 3〜5日 初心者へのやさしさ 12/100
squid-protocol/gitgalaxy#7434 · コメント 14 件 ·
メンテナーはふだん 1 日以内に返信
-
scope:core
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
squid-protocol/gitgalaxy#7366 ·
メンテナーはふだん 1 日以内に返信
squid-protocol/gitgalaxy の issue をすべて見る
似ている issue
-
question
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
conda-forge/vc-feedstock#132 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
limitlessprojects/Go-Hybrid#3342 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
UKGovernmentBEIS/inspect_ai#6268 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
LSSTDESC/rail_sompz#42 ·
-
All tests fail with 'EXITED with status 3' on pytest 9.2.0 (TestReport._id is not marshallable)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
pytest-dev/pytest-forked#113 ·