Skip to content

COACTVWC port: Long.parseLong on a text field COBOL MOVEs into a numeric one throws on non-digit data #4491

Closed

Description

@squid-protocol

Found by the generated inputs of #3804 (carddemo-acctview-generated).

What. The hand-written COACTVWC port (tests/equivalence/carddemo-acctview/port/service/CoactvwcService.java, readAcct) does

ca.setCdemoCardNum(Long.parseLong(x.getXrefCardNum().trim()));

for MOVE XREF-CARD-NUM TO CDEMO-CARD-NUM (9200-GETCARDXREF-BYACCT: a PIC X(16) into a PIC 9(16)). COBOL does not validate an alphanumeric-to-numeric MOVE: it takes the digit part of each byte and carries on. The port throws NumberFormatException on any card number that is not all digits (letters, or blanks: "" after trim()).

Reproduce. Generate the cross-reference card number from its layout alone (no "digits": true rule): the first generated run of carddemo-acctview-generated failed on the Java side with NumberFormatException: For input string: "5HTJBYWDYRE8DRM0" at CoactvwcService.readAcct(CoactvwcService.java:228), while the COBOL side ran the scenario to the end.

Scope. Real CardDemo data holds 16-digit card numbers, so the shipped data never reaches this; the merged generated case steers XREF-CARD-NUM to digits ("digits": true) and says so. Other ports that parseLong / new BigDecimal a text field the COBOL MOVEs into a numeric one likely do the same: worth a grep, and a det-translator check of how an X-to-9 MOVE is emitted.

Done when: the port (and any other found) gives the COBOL's result for non-digit text in such a MOVE, and carddemo-acctview-generated proves with the digits rule removed.

Part of epic #3803; found by #3804.

Activity

  1. added
    bug
    legacy-modernization
    on Oct 5, 2026
  2. added 2 commits that reference this issue on Oct 6, 2026
  3. added
    scope:core
    era:2
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugera:2legacy-modernizationscope:core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions