Skip to content

Java 9+ invokedynamic string concatenation decompiled incorrectly: char printed as int, trailing operand dropped #86

Description

@BoxiYu

Procyon mistranslates StringConcatFactory (Java 9+) string concatenation, silently producing wrong output. The decompiled code compiles, so the defect is only visible at runtime.

Minimal reproduction (compiled with javac --release 11):

public class T {
    public static void main(String[] a) {
        char c = 'Z';
        System.out.println("c=" + c + "x");
    }
}

Procyon 0.6.0 decompiles the body to:

System.out.println("c=" + 90);

i.e. it constant-folds the char to its integer value 90 and drops the trailing + "x" operand.

  • Expected output: c=Zx
  • Actual output (after recompiling Procyon's source): c=90

CFR and Vineflower decompile the same class correctly. Found by round-trip testing (compile → decompile → recompile → compare output).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions