You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Diff Utils library is an OpenSource library for performing the comparison operations between texts: computing diffs, applying patches, generating unified diffs or parsing them, generating diff output for easy future displaying (like side-by-side view) and so on.
Main reason to build this library was the lack of easy-to-use libraries with all the usual stuff you need while working with diff files. Originally it was inspired by JRCS library and it's nice design of diff module.
**This is originally a fork of java-diff-utils from Google Code Archive.**
## Examples ##
## Examples
Look [here](https://github.com/wumpz/java-diff-utils/wiki) to find more helpful informations and examples.
Look [here](https://github.com/wumpz/java-diff-utils/wiki) to find more helpful informations and examples.
These two outputs are generated using this java-diff-utils. The source code can also be found at the *Examples* page:
**Producing a one liner including all difference information.**
This is a test ~senctence~**for diffutils**.
**Producing a side by side view of computed differences.**
|original|new|
Expand All
@@ -32,23 +32,22 @@ This is a test ~senctence~**for diffutils**.
|This is the second line.|This is the second line.|
|~And here is the finish.~||
## Main Features
## Main Features ##
* computing the difference between two texts.
* capable to hand more than plain ascci. Arrays or List of any type that implements hashCode() and equals() correctly can be subject to differencing using this library
* patch and unpatch the text with the given patch
* parsing the unified diff format
* producing human-readable differences
* inline difference construction
* Algorithms:
* Myer
* HistogramDiff using JGit Library
* computing the difference between two texts.
* capable to hand more than plain ascci. Arrays or List of any type that implements hashCode() and equals() correctly can be subject to differencing using this library
* patch and unpatch the text with the given patch
* parsing the unified diff format
* producing human-readable differences
* inline difference construction
* Algorithms:
* Myer
* HistogramDiff using JGit Library
### Algoritms ###
### Algoritms
* Myer's diff
* HistogramDiff
* HistogramDiff
But it can easily replaced by any other which is better for handing your texts. I have plan to add implementation of some in future.
Expand DownExpand Up
@@ -91,24 +90,26 @@ Recently a checkstyle process was integrated into the build process. java-diff-u
```java
public static <T> Patch<T> diff(List<T> original, List<T> revised,
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.