All Projects → java-diff-utils → Java Diff Utils

java-diff-utils / Java Diff Utils

Licence: apache-2.0
Diff Utils library is an OpenSource library for performing the comparison / diff operations between texts or some kind of data: 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.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Java Diff Utils

Dllexport
.NET DllExport with .NET Core support (aka 3F/DllExport)
Stars: ✭ 571 (-14.78%)
Mutual labels:  tools
Penetration Testing Tools
A collection of more than 140+ tools, scripts, cheatsheets and other loots that I have developed over years for Red Teaming/Pentesting/IT Security audits purposes. Most of them came handy on at least one of my real-world engagements.
Stars: ✭ 614 (-8.36%)
Mutual labels:  tools
Xcdiff
A tool which helps you diff xcodeproj files.
Stars: ✭ 641 (-4.33%)
Mutual labels:  diff
Coca
Coca is a toolbox which is design for legacy system refactoring and analysis, includes call graph, concept analysis, api tree, design patterns suggest. Coca 是一个用于系统重构、系统迁移和系统分析的瑞士军刀。它可以分析代码中的测试坏味道、模块化分析、行数统计、分析调用与依赖、Git 分析以及自动化重构等。
Stars: ✭ 576 (-14.03%)
Mutual labels:  tools
Seccomp Tools
Provide powerful tools for seccomp analysis
Stars: ✭ 599 (-10.6%)
Mutual labels:  tools
Kernelpop
kernel privilege escalation enumeration and exploitation framework
Stars: ✭ 628 (-6.27%)
Mutual labels:  tools
Changedetection
Automatically track websites changes on Android in background.
Stars: ✭ 563 (-15.97%)
Mutual labels:  diff
Diffdom
A diff for DOM elements, as client-side JavaScript code. Gets all modifications, insertions and removals between two DOM fragments.
Stars: ✭ 660 (-1.49%)
Mutual labels:  diff
Diffabledatasources
💾 A library for backporting UITableView/UICollectionViewDiffableDataSource.
Stars: ✭ 601 (-10.3%)
Mutual labels:  diff
Sirix
SirixDB is a temporal, evolutionary database system, which uses an accumulate only approach. It keeps the full history of each resource. Every commit stores a space-efficient snapshot through structural sharing. It is log-structured and never overwrites data. SirixDB uses a novel page-level versioning approach called sliding snapshot.
Stars: ✭ 638 (-4.78%)
Mutual labels:  diff
Graphql Editor
📺 Visual Editor & GraphQL IDE. Draw GraphQL schemas using visual 🔷 nodes and explore GraphQL API with beautiful UI. Even 🐒 can do that!
Stars: ✭ 5,485 (+718.66%)
Mutual labels:  tools
Youku Sdk Tool Woodpecker
In-app-debug tool for iOS
Stars: ✭ 600 (-10.45%)
Mutual labels:  tools
Micro Dev
The development environment for `micro`
Stars: ✭ 630 (-5.97%)
Mutual labels:  tools
Side Project Marketing
A checklist of tactics for marketing your startup.
Stars: ✭ 5,083 (+658.66%)
Mutual labels:  tools
React Diff Viewer
A simple and beautiful text diff viewer component made with Diff and React.
Stars: ✭ 642 (-4.18%)
Mutual labels:  diff
404starlink Project
Focus on promoting the evolution of tools in different aspects of security research.专注于推动安全研究各个领域工具化.
Stars: ✭ 569 (-15.07%)
Mutual labels:  tools
Nanomorph
🚅 - Hyper fast diffing algorithm for real DOM nodes
Stars: ✭ 621 (-7.31%)
Mutual labels:  diff
Allsketchs
Processing sketches, in which I have worked in the last years; images, videos, prototypes, experiments, tools, works, concepts... Everything is unfinished, some may not work, When I had no ideas, I would open one to see what it was...
Stars: ✭ 666 (-0.6%)
Mutual labels:  tools
Awesome Dotfiles
A curated list of dotfiles resources.
Stars: ✭ 6,295 (+839.55%)
Mutual labels:  tools
Pharo
Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
Stars: ✭ 631 (-5.82%)
Mutual labels:  tools

java-diff-utils

Status

Build Status

Build Status using Github Actions

Codacy Badge

Maven Central

Intro

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.

API

Javadocs of the actual release version: JavaDocs java-diff-utils

Examples

Look here 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 senctencefor diffutils.

Producing a side by side view of computed differences.

original new
This is a test senctence. This is a test for diffutils.
This is the second line. This is the second line.
And here is the finish.

Main Features

  • computing the difference between two texts.
  • capable to hand more than plain ascii. 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

Algorithms

  • Myer's diff
  • 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.

Source Code conventions

Recently a checkstyle process was integrated into the build process. java-diff-utils follows the sun java format convention. There are no TABs allowed. Use spaces.

public static <T> Patch<T> diff(List<T> original, List<T> revised,
    BiPredicate<T, T> equalizer) throws DiffException {
    if (equalizer != null) {
        return DiffUtils.diff(original, revised,
        new MyersDiff<>(equalizer));
    }
    return DiffUtils.diff(original, revised, new MyersDiff<>());
}

This is a valid piece of source code:

  • blocks without braces are not allowed
  • after control statements (if, while, for) a whitespace is expected
  • the opening brace should be in the same line as the control statement

To Install

Just add the code below to your maven dependencies:

<dependency>
    <groupId>io.github.java-diff-utils</groupId>
    <artifactId>java-diff-utils</artifactId>
    <version>4.9</version>
</dependency>

or using gradle:

// https://mvnrepository.com/artifact/io.github.java-diff-utils/java-diff-utils
implementation "io.github.java-diff-utils:java-diff-utils:4.5"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].