Structural Diff of two java source files

£可爱£侵袭症+ 提交于 2019-12-07 05:06:31

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/14376370/structural-diff-of-two-java-source-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!