Open xxh160 opened 1 year ago
CFR 0.153-SNAPSHOT (24c7433-dirty)
javac 11.0.20.1
CFR may exhibit type errors in the decompilation of ternary expressions.
Example code is as follows:
class T1 { public Object foo(boolean b) { Integer i1 = 1; return ((b) ? i1 : (Byte[]) new Object[] { (byte) -98 }); } }
The decompiled code is as follows:
/* * Decompiled with CFR 0.153-SNAPSHOT (24c7433-dirty). */ class T1 { T1() { } public Object foo(boolean bl) { Byte[] byteArray = Integer.valueOf(1); return bl ? byteArray : (Byte[])new Object[]{(byte)-98}; } }
Integer.valueOf(1) returns an int type instead of Byte[] type, which causes a compilation error.
Integer.valueOf(1)
int
Byte[]
CFR version
CFR 0.153-SNAPSHOT (24c7433-dirty)
Compiler
javac 11.0.20.1
Description
CFR may exhibit type errors in the decompilation of ternary expressions.
Example
Example code is as follows:
The decompiled code is as follows:
Integer.valueOf(1)
returns anint
type instead ofByte[]
type, which causes a compilation error.