I suggest a multi-step process:
Apply the previously suggested Jardiff or similar to see if there are any API differences. If possible, select a tool that has an option to report on private methods, etc. In practice, any significant change to the Java implementation may change some methods and classes, even if the public API has not changed.
If you have API compliance, compile several randomly selected files with the specified compiler, decompile the result and the source class files, and compare the results. If they match, apply the same process to the larger and larger bodies of code until you find a mismatch or check everything.
Differences in decompiled code are more likely to give you clues about the nature of the differences and are easier to filter for minor differences than the actual class files.
If you get a discrepancy, analyze it. This may be due to something you don't care about. If so, try building a script that will remove this form of difference and resume the compilation and comparison process. If you get widespread inconsistencies, experiment with compiler options such as optimizations. If the compiler settings eliminate the differences, continue the bulk comparison. The purpose of this phase is to find a combination of compiler options and decompiled code filters that lead to a match in the sample files and use them for mass library comparisons.
If you cannot get a close enough match in the decompiled code, you probably don't have the correct source code. However, if you have an API match, it might be worth building your system and running your tests using the compilation result. If your tests run at least with the version you created from the source code, continue to work with it.
Patricia Shanahan
source share