leibnitz27 / cfr

This is the public repository for the CFR Java decompiler
https://www.benf.org/other/cfr
MIT License
2.06k stars 263 forks source link

Decompiler #356

Open zxzzhange opened 7 months ago

zxzzhange commented 7 months ago

CFR version

CFR 0.151

Compiler

source :

public class Test {

public enum TestEnums {
    A,
    B,
    C
}

public void test(TestEnums testEnum) {
    switch (testEnum) {
        case A:
            System.out.println("is A");
            break;
        case B:
            System.out.println("is B");
            break;
        case C:
            System.out.println("is D");
            break;
        default:
            System.out.println("is default");
            break;
    }
}

}

decompiler result:

public class Test { public void test(TestEnums testEnums) { switch (1.$SwitchMap$com$seeyon$analysis$driver$Test$TestEnums[testEnums.ordinal()]) { case 1: { System.out.println("is A"); break; } case 2: { System.out.println("is B"); break; } case 3: { System.out.println("is D"); break; } default: { System.out.println("is default"); } } } }

Description

$SwitchMap This compilation is not accurate

Example

leibnitz27 commented 7 months ago

This has been a pretty standard test for some time - are you using eclipse by any chance?

Please post bytecode

Thanks

On Fri, 26 Apr 2024, 08:47 zxzzhange, @.***> wrote:

CFR version

CFR 0.151 Compiler

source :

public class Test {

public enum TestEnums { A, B, C }

public void test(TestEnums testEnum) { switch (testEnum) { case A: System.out.println("is A"); break; case B: System.out.println("is B"); break; case C: System.out.println("is D"); break; default: System.out.println("is default"); break; } }

}

decompiler result:

public class Test { public void test(TestEnums testEnums) { switch (1.$SwitchMap$com$seeyon$analysis$driver$Test$TestEnums[testEnums.ordinal()]) { case 1: { System.out.println("is A"); break; } case 2: { System.out.println("is B"); break; } case 3: { System.out.println("is D"); break; } default: { System.out.println("is default"); } } } } Description

$SwitchMap This compilation is not accurate Example

— Reply to this email directly, view it on GitHub https://github.com/leibnitz27/cfr/issues/356, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFXCEDHQWHO4WX5QGMQCBTY7IBB3AVCNFSM6AAAAABG2JFN4CVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3DKMJXGI4DSOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>