-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
When using this to decompile my own Java code for testing, it decompiles some things wrong.
For example when my code has a for loop like this:
for (int n = 0; n<1000000; n++)
I find that it is decompiled like this:
for (byte b = 0; b<100000; b++)
It both gets the data type wrong, and changes the variable name. And both of these issues are new. Not sure when they were introduced, but I remember there having a version that didn't have this either of these issues. And I know this is a bug for sure when it displays the wrong data type (and it only has this issue when the int is part of a for-loop, not in all contexts where an int is used). There's no way a correctly functioning decompiler would ever decompile an int-type variable as a byte-type variable. And this bug definitely did NOT exist in previous versions, or I would have noticed it and reported it much earlier.
Also it renames EVERYTHING. In my main function it is defined as:
public static void main(String[] args)
But when jd-gui decompiles it it shows it as being:
public static void main(String[] paramArrayOfString)
It didn't used to do that. That's useful (giving you hints about a variable by its name) for when you are decompiling obfuscated code like in Minecraft (and I've read that decompiling MC was the entire inspiration for making jd-gui in the first place), but when working on non-obfuscated code, it should have an option to disable the renaming of variables and function arguments. But this is something you definitely would want to turn off when debugging my own code (using the decompiler to see how Java sees my code after it's been compiled, to make sure it's the same as my actual source code, or at least equivalent to my source code). So I don't know if this is a bug, or a feature that they just forgot to add a setting that would let you enable or disable it.
But please fix these things.