Hey Gurus,
if I compile my code, the byte code size seems to depend on the source code. So if I add more whitespaces for readability, the resulting byte code will become bigger. It is also possible to fully decompile the java byte code and get back the fully formatted java source code with all whitespaces, comments and variable names. This doesn’t seem necessary to me. The only reason, why this could be needed, is, that in case an exception is thrown, the line numbers might be derived from the embedded source code.
Apart from the byte code size, which is pretty serious and important in some cases another issue is, that anyone can see my source code when using a freely available decompiler. Well, this might be illegal, but still possible. And if I don’t write open source software from time to time, I would like to better protect my code.
So my question is, is there a compiler flag to remove all unnecessary whitespaces and comments and to anonymize variable names, so that decompiled code is less useful? And can I set this compiler flag in Eclipse?
Thanks in advance,
Marvin