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

后端 未结 2 604
滥情空心
滥情空心 2021-01-22 17:22

I was attempting to compare the results of this: (in ant)

                       

        
2条回答
  •  长情又很酷
    2021-01-22 17:52

    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

提交回复
热议问题