Here is another case that CFR may generate invalid Java code. When decompiling the loop structure shown in the example, CFR used a weird and uninitialized 'float f2', instead of 'f' in the loop guard expression.
The total case is available at error example and I hope it can be helpful.
Example
The source code:
class Test {
double dFld;
{
float f = 1.18F;
while(-- f > 0)dFld = f;
}
}
The code decompiled by CFR:
class Test {
double dFld;
Test() {
float f = 1.18f;
while (true) {
float f2;
f -= 1.0f;
if (!(f2 > 0.0f)) break;
this.dFld = f;
}
}
}
CFR version
CFR version: 0.152
Compiler
Java openJDK, version: 11.0.13
Description
Here is another case that CFR may generate invalid Java code. When decompiling the loop structure shown in the example, CFR used a weird and uninitialized 'float f2', instead of 'f' in the loop guard expression. The total case is available at error example and I hope it can be helpful.
Example
The source code:
The code decompiled by CFR: