Generate a collection of changed lines between two revisions of a file using Java

Posted by mchr on Stack Overflow See other posts from Stack Overflow or by mchr
Published on 2010-05-05T22:52:34Z Indexed on 2010/05/05 22:58 UTC
Read the original article Hit count: 301

Filed under:
|
|
|

I am writing an eclipse plugin which needs to be able to determine which lines of a file have changed compared to a different version of the same file.

Is there an existing class or library which I can use for this task?

The closest I have found is org.eclipse.compare.internal.merge.DocumentMerger. This can be used to find the information I need but is in an internal package so is not suitable for me to use. I could copy/paste the source of this class and adapt it to my requirements. However, I am hoping there is an existing library to handle textual comparisons.

© Stack Overflow or respective owner

Related posts about java

Related posts about eclipse