Skip to main content
FORGEJO ERA / ISSUE #604

Empty and padded string constants are lost by the disassembly parser

closedOpened by MelanX on

Original description​

By MelanX · October 23, 2026

Crate: tools/minecraft-options

Commit: 2b2af1e4f8166d02e4732d19e040a53745d97a51

Behavior

COMMENT_RE strips surrounding whitespace, so javap's ldc #n // String for an empty string becomes the comment String, and M_STRING (^String (.*)$) needs the trailing space. Insn.string() returns None. Empty, whitespace-only, and padded constants are invisible or truncated ("a " reads as a).

field_initial_values therefore skips this.f = "". In 26.2, lastServer has default: None and soundDevice has default None with confidence unknown, although the constructor stores the empty string (ldc #9 // String then putfield). Every JAR from 1.12.2 to 26.x contains such lines, and positional string logic is shifted by invisible empty strings.

Expected behavior

The parser preserves the exact string constant, including the empty string, so a known empty default is recorded as known.

Impact

Currently a missing default (conservative). A non-empty default with leading or trailing space would be recorded without it at high confidence.

Locations

  • tools/minecraft-options/analyze_options.py COMMENT_RE/M_STRING (237-243), Insn.string (262), parse_members (296-299), field_initial_values (1623-1626)

Validation and limitations

Counted across 1.12.2, 1.16.5, 1.18.2, 1.21.1, and 26.3: every empty // String line is unmatched.