0

We need an accurate diff utility for Java and Javascript files, written in Java. It should be invokable from within an Eclipse (version 3.2 or 3.3) application. Preferably we need the Java source code for this utility also.

The utility should be able to compare two files (old and new, say) and determine the following accurately:

  • Number of LOC added to the new file
  • Number of LOC deleted from the old file
  • Number of LOC changed in the old file
  • Number of change deltas, i.e., contiguous blocks of code added/changed/deleted.
Rex
  • 801
  • 1
  • 17
  • 26
  • You might want to rephrase that to something like "does anyone know of a free Java diff tool that can do the following ...". As it stands, it looks like a request for us to make one for you in which case you should probably head on over to RentACoder :-) – paxdiablo Jun 05 '09 at 04:55
  • Isn't there one already built in or use one of the many plug-ins that do it? Google Search? – epascarello Jun 05 '09 at 05:04

3 Answers3

2

Eclipse has a very good diff/compare plugin installed by default. Have you looked into using and/or extending that (it's opensource)? I would not think that adding some statistics reporting to the existing plug-in would be all that difficult, though sometimes plug-in development (even just simple extension) can be deceiving.

Good luck.

cjstehno
  • 13,468
  • 4
  • 44
  • 56
1

See Diffj.

Matthew Flaschen
  • 278,309
  • 50
  • 514
  • 539
0

I needed a Java diff implementation and found this: http://javacook.darwinsys.com/javasrc/textproc/Diff.java which I adapted.

thoni56
  • 3,145
  • 3
  • 31
  • 49