问题描述
我正在使用来自商业供应商的大型Java Web应用程序。我已经从供应商那里收到了一个新的.class文件形式的补丁,该补丁应该可以解决我们在软件方面遇到的问题。过去,应用来自该供应商的补丁导致出现了新的,完全不相关的问题,因此我想了解所做的更改,甚至不将其应用于测试实例。
JAD 和分别将两个版本反编译并反汇编为相同的输出。但是,.class文件的大小不同,我发现
od -x
的输出有所不同,因此它们肯定是不相同的。 我还可以采取什么其他步骤来确定两个文件之间的差异?
结论:
感谢您的好评。由于两个类文件的 javap -c
输出也相同,因此,我要得出结论,Davr的权利是正确的,供应商向我发送了安慰剂。由于这个原因,我接受Davr的回答时,是Chris Marshall和John Meagher才使我使用javap,所以感谢你们三个。
有可能他们只是使用新版本的Java编译器或使用不同的优化设置等对其进行了编译,因此功能相同,代码相同,但是输出字节码稍有不同。
I am working with a large Java web application from a commercial vendor. I've received a patch from the vendor in the form of a new .class file that is supposed to resolve an issue we're having with the software. In the past, applying patches from this vendor have caused new and completely unrelated problems to arise, so I want to understand the change being made even before applying it to a test instance.
I've got the two .class files side by side, the one extracted from the currently running version and the updated one from the vendor. JAD and JReversePro both decompile and disassemble (respectively) the two versions to the same output. However, the .class files are different sizes and I see differences in the output of od -x
, so they're definitely not identical.
What other steps could I take to determine the difference between the two files?
Conclusion:
Thanks for the great responses. Since javap -c
output is also identical for the two class files, I am going to conclude that Davr's right and the vendor sent me a placebo. While I'm accepting Davr's answer for that reason, it was Chris Marshall and John Meagher who turned me on to javap, so thanks to all three of you.
It's possible that they just compiled it with a new version of the java compiler, or with different optimization settings etc, so that the functionality is the same, and the code is the same, but the output bytecode is slightly different.
这篇关于查找Java类文件版本之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!