I am working on a Jetbrains FernFlower plug and I have added minor improvements to it.
One thing that really annoys me in FernFlower is that it bases the type of the local variable based on its value in bpush / spush, etc. So far, Jode and Procyon are somehow finding a way to find the original value of the local variable.
Here is the source code.
public static void main(String[] args) throws Exception { int hello = 100; char a2 = 100; short y1o = 100; int hei = 100; System.out.println(a2+" "+y1o+", "+hei+", "+hello); }
When decompiling with FernFlower, it outputs this:
public static void main(String[] args) throws Exception { byte hello = 100; char a2 = 100; byte y1o = 100; byte hei = 100; System.out.println(a2 + " " + y1o + ", " + hei + ", " + hello); }
But when decompiling with Jode / Procyon, it outputs the original local variable types:
public static void main(String[] args) throws Exception { int hello = 100; char a2 = 'd'; short y1o = 100; byte hei = 100; System.out.println(a2 + " " + y1o + ", " + hei + ", " + hello); }
I was wondering how this is possible because I thought that during compilation, information about local variables was not stored? How to add the same features to FernFlower?
source share