Finding Differences Between Java Class File Versions

I am working with a large Java web application from a commercial provider. I received a patch from the vendor in the form of a new .class file, which should solve the problem that we encounter with the software. Previously, applying patches from this provider caused new and completely unrelated problems, so I want to understand that the changes were made even before applying it to the test instance.

I have two .class files next to each other, one that has been extracted from the current version and updated from the provider. JAD and JReversePro both decompile and parse (respectively) two versions into the same output. However .class files have different sizes, and I see differences in output od -x, so they are definitely not identical.

What other steps can I take to determine the difference between the two files?

<h / "> Conclusion:

Thanks for the great answers. Since the output is javap -calso identical for the two class files, I am going to conclude that Dever is right and the provider sent me a placebo. While I accept Davre's answer for this reason, it was Chris Marshall and John Meager who included me in javap, so thanks to all three of them.

+5
source share
4 answers

Perhaps they just compiled it with the 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 byte code is slightly different.

+6
source

If you are looking for differences in API level, a lot of javap help can help . It will output the method signatures, and they can be output to text files and compared using regular diff tools.

+6
source

diff (, DiffMerge SourceGear). , , , "" , , - .

http://www.sourcegear.com/diffmerge/

+1
source

You can use javap (in $ JDK_HOME / bin) to decompile java .class files. It will tell you (for example) the version of the class file, among other things,

+1
source

All Articles