Is it possible for the same javac compiler to compile the same set of source files but produce class files of different checksums?

喜你入骨 提交于 2019-12-02 03:45:16

as you showed, the difference is in the generated constant pool, which is really a non-issue, but troubling as you would expect the same output with the same compiler and options. i would bet that the compiler is called with the java files in different order between the two situations, and the order of compilation is affecting the result.

I'm using javac compiler and I've found it produces different resulting binary .class files depending on the order of the source files passed as parameter. Between maven and ant I found differences. The order of the files were not the same.

Anyway, between the 2 compilations there were differences. I've disassembled the code and I found the javac (optimizer?) was removing the deprecated java jsr/ret assembly instructions from one of the compilations.

I don't know if this behaviour it's the result of "implicit" compilation: http://docs.oracle.com/javase/1.5.0/docs/tooldocs/solaris/javac.html#searching

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!