I think java should be fairly friendly to decompilation, that is, the .class files themselves have quite a lot of data that still resembles the original source fairly well.
Would it be possible to construct the original source from a decompiled .class file, that would be completely equivalent, or are there any java constructs that get transformed during the process?
For example, I could see syntactic sugar like enhanced for loop causing problems.
Would I be able to repeat the process several times and still arrive at where I started from?
The simple answer is that yes, information is lost.
Comments, in particular, are always lost. Whether original variable names are lost depends on the compiler options when the code was compiled. Code compiled with the debug options (-g) will be more readable when decompiled.
When you decompile, you get source code that is functionally equivalent, but not exactly the same as the source that when in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With