Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Structural Diff of two java source files

Tags:

java

diff

Is there any way to find Structural diff of two java source files? I want to find structural difference of two java files, but i don't know how to start it. Is there any library in java for this purpose?

Update: Structural diff means like it does not care about white space or locations. It should compares source a syntactically. This helps us to trace actual changes, even if methods are moved to another location or appear in different order.

i found a tool that is for C# and pascal but i need it for java source file comparision. please check the given link http://www.modelmakertools.com/structured-diff-viewer/index.html

if you know any libraries for that purpose please share it. thank you

like image 757
Dilip Kumar Avatar asked Oct 06 '22 08:10

Dilip Kumar


1 Answers

Eclipse JDT has a structural compare of java sources. If you have special requirements than it might be a good idea to have a look at Eclipse EMF and especially EMF Compare. For a starting point for using Eclipse Modeling you might also want to have a look at Eclipse MoDisco. It ships with a Java 5 EMF Model and therefore also provides structural diff with EMF Compare.

like image 73
SpaceTrucker Avatar answered Oct 10 '22 03:10

SpaceTrucker