Open TheKodeToad opened 1 year ago
The decompiler names were simply missing for some decompilers. I added them in fd5ef2de5624061cd59cb0e1b98b31ae92971d4a
But I wasn't able to reproduce your problem with CFR/FernFlower. Neither when I set CFR as default decompiler nor when I manually select a class to be decompiled by CFR it was always CFR decompiler used.
As FernFlower already had it's name in the DECOMPILATION REPORT I would assume that the used decompiler was really CFR and not FernFlower.
For me it is definitely FernFlower being used, as #88 was also an issue and the output identical.
Which ECD and Eclipse version do you use?
ECD 3.2.2 on Eclipse IDE for Java Developers 2022-06. This seems to be the latest stable version.
In some cases there are some comments in this format
// $FF: Mission failed
Could you please test the latest version ECD 3.3.0?
It still has the same issue.
Just to make sure please to the following:
Open Class With
-> CFR
Yep, same thing is happening
Can you please describe in detail what "same thing happens" means?
What actual decompiled code do you get? Would it be possible that you upload the Jar file or the class file(s) you try to decompile or a sample Eclipse project/workspace?
In this case I was testing with Gradle's API, and I got the same decompiled code with both CFR and FernFlower!
I finally found the code that causes fallback to FernFlower: https://github.com/ecd-plugin/ecd/blob/master/org.sf.feeling.decompiler/src/org/sf/feeling/decompiler/editor/BaseDecompilerSourceMapper.java#L160-L168
Looks like this happens if the selected decompiler has not returned any decompiled code.
The reason for this behavior is that CFR has no option to provide code where the line numbers match the original line numbers (thus the code is useful for debugging).
Therefore ECD does not make use of CFR in debugger mode (debugging perspective?). But it seems that the debugger detection doesn't work as expected in some Eclipse versions. If you try to use CFR in debugging mode, then it will fall back to a different decompiler like FernFlower.
See also this discussion on CFR: https://github.com/leibnitz27/cfr/issues/73
This is quite weird, and also quite annoying since CFR is one of the better decompilers. The decompilation report also has no decompiler present, like it's some kind of fallback.