Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8b1e374

Browse filesBrowse files
authored
Merge pull request dnaumenko#38 from java-diff-utils/fix/license
Update license header to Apache-1.1
2 parents 683d192 + 0a4a346 commit 8b1e374
Copy full SHA for 8b1e374

34 files changed

+1631
-313
lines changed

‎README.md

Copy file name to clipboard
+26-13Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,60 @@
1+
# Diff Utils
2+
13
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.
24

35
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.
46

5-
# Main Features
7+
## Main Features
68

79
* computing the difference between two texts.
810
* 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
911
* patch and unpatch the text with the given patch
1012
* parsing the unified diff format
1113
* producing human-readable differences
1214

13-
# Algorithms
15+
## Algorithms
1416

1517
This library implements Myer's diff algorithm. 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.
1618

17-
# Changelog
19+
## Changelog
1820

19-
## Version 1.2
21+
### Version 1.2
2022
* JDK 1.5 compatibility
2123
* Ant build script
2224
* Generate output in unified diff format (thanks for Bill James)
2325

24-
# To Install
26+
## To Install
2527

2628
Just add the code below to your maven dependencies:
2729

28-
<dependency>
29-
<groupId>com.googlecode.java-diff-utils</groupId>
30-
<artifactId>diffutils</artifactId>
31-
<version>1.3.0</version>
32-
</dependency>
30+
```xml
31+
<dependency>
32+
<groupId>com.googlecode.java-diff-utils</groupId>
33+
<artifactId>diffutils</artifactId>
34+
<version>1.3.0</version>
35+
</dependency>
36+
```
3337

3438
And for Ivy:
3539

36-
<dependency org="com.googlecode.java-diff-utils" name="diffutils" rev="1.3.0"/>
40+
```xml
41+
<dependency org="com.googlecode.java-diff-utils" name="diffutils" rev="1.3.0"/>
42+
```
3743

38-
# Coming eventually
44+
## Coming eventually
3945

4046
* support for inline diffs in output
4147
* helpers for showing side-by-side, line-by-line diffs or text with inter-line and intra-line change highlights
4248
* customization of diff algorithm for better experience while computing diffs between strings (ignoring blank lines or spaces, etc)
4349
* generating output in other formats (not only unified). E.g. CVS.
4450

45-
# Tutorials
51+
## Tutorials
4652

4753
http://www.adictosaltrabajo.com/tutoriales/tutoriales.php?pagina=CompararFicherosJavaDiffUtils (in Spanish). Thanks Miguel
54+
55+
## License
56+
57+
This work is licensed under The Apache Software License, Version 1.1.
58+
Reason: The code contains work of HP, which contributed it under Apache-1.1.
59+
[[Example code](https://github.com/apache/wicket/blob/master/wicket-util/src/main/java/org/apache/wicket/util/diff/Delta.java)).
60+
It was easier to change the license to Apache-1.1 than to contact HP Legal for a code created in 2003 at HP Bristol.

‎build.xml

Copy file name to clipboardExpand all lines: build.xml
+53Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,58 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3+
<!--
4+
~ SPDX-License-Identifier: Apache-1.1
5+
~
6+
~ ====================================================================
7+
~ The Apache Software License, Version 1.1
8+
~
9+
~ Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com)
10+
~ All rights reserved.
11+
~
12+
~ Redistribution and use in source and binary forms, with or without
13+
~ modification, are permitted provided that the following conditions
14+
~ are met:
15+
~
16+
~ 1. Redistributions of source code must retain the above copyright
17+
~ notice, this list of conditions and the following disclaimer.
18+
~
19+
~ 2. Redistributions in binary form must reproduce the above copyright
20+
~ notice, this list of conditions and the following disclaimer in
21+
~ the documentation and/or other materials provided with the
22+
~ distribution.
23+
~
24+
~ 3. The end-user documentation included with the redistribution, if
25+
~ any, must include the following acknowledgement:
26+
~ "This product includes software developed by the
27+
~ Apache Software Foundation (http://www.apache.org/)."
28+
~ Alternately, this acknowledgement may appear in the software itself,
29+
~ if and wherever such third-party acknowledgements normally appear.
30+
~
31+
~ 4. The names "The Jakarta Project", "Commons", and "Apache Software
32+
~ Foundation" must not be used to endorse or promote products derived
33+
~ from this software without prior written permission. For written
34+
~ permission, please contact apache@apache.org.
35+
~
36+
~ 5. Products derived from this software may not be called "Apache"
37+
~ nor may "Apache" appear in their names without prior written
38+
~ permission of the Apache Software Foundation.
39+
~
40+
~ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
41+
~ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
42+
~ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
43+
~ DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
44+
~ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45+
~ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46+
~ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
47+
~ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
48+
~ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
49+
~ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
50+
~ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51+
~ SUCH DAMAGE.
52+
~ ====================================================================
53+
~
54+
-->
55+
356
<project name="java-diff-utils" default="jar" basedir=".">
457
<property name="version" value="1.3.0-SNAPSHOT"/>
558
<property name="src.dir" value="src/main/java" />

‎pom.xml

Copy file name to clipboardExpand all lines: pom.xml
+55-2Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,56 @@
1+
<!--
2+
~ SPDX-License-Identifier: Apache-1.1
3+
~
4+
~ ====================================================================
5+
~ The Apache Software License, Version 1.1
6+
~
7+
~ Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com)
8+
~ All rights reserved.
9+
~
10+
~ Redistribution and use in source and binary forms, with or without
11+
~ modification, are permitted provided that the following conditions
12+
~ are met:
13+
~
14+
~ 1. Redistributions of source code must retain the above copyright
15+
~ notice, this list of conditions and the following disclaimer.
16+
~
17+
~ 2. Redistributions in binary form must reproduce the above copyright
18+
~ notice, this list of conditions and the following disclaimer in
19+
~ the documentation and/or other materials provided with the
20+
~ distribution.
21+
~
22+
~ 3. The end-user documentation included with the redistribution, if
23+
~ any, must include the following acknowledgement:
24+
~ "This product includes software developed by the
25+
~ Apache Software Foundation (http://www.apache.org/)."
26+
~ Alternately, this acknowledgement may appear in the software itself,
27+
~ if and wherever such third-party acknowledgements normally appear.
28+
~
29+
~ 4. The names "The Jakarta Project", "Commons", and "Apache Software
30+
~ Foundation" must not be used to endorse or promote products derived
31+
~ from this software without prior written permission. For written
32+
~ permission, please contact apache@apache.org.
33+
~
34+
~ 5. Products derived from this software may not be called "Apache"
35+
~ nor may "Apache" appear in their names without prior written
36+
~ permission of the Apache Software Foundation.
37+
~
38+
~ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
39+
~ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
40+
~ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41+
~ DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
42+
~ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43+
~ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44+
~ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
45+
~ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
46+
~ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47+
~ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
48+
~ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49+
~ SUCH DAMAGE.
50+
~ ====================================================================
51+
~
52+
-->
53+
154
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
255
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
356
<modelVersion>4.0.0</modelVersion>
@@ -22,8 +75,8 @@
2275
</scm>
2376
<licenses>
2477
<license>
25-
<name>The Apache Software License, Version 2.0</name>
26-
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
78+
<name>The Apache Software License, Version 1.1</name>
79+
<url>http://www.apache.org/licenses/LICENSE-1.1/url>
2780
<distribution>repo</distribution>
2881
<comments>A business-friendly OSS license</comments>
2982
</license>

‎src/main/java/difflib/ChangeDelta.java

Copy file name to clipboardExpand all lines: src/main/java/difflib/ChangeDelta.java
+56-13Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,60 @@
11
/*
2-
Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com)
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
2+
* SPDX-License-Identifier: Apache-1.1
3+
*
4+
* ====================================================================
5+
* The Apache Software License, Version 1.1
6+
*
7+
* Copyright (c) 1999-2003 The Apache Software Foundation.
8+
* Copyright (c) 1996-2006 Juancarlo Añez
9+
* Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com)
10+
* All rights reserved.
11+
*
12+
* Redistribution and use in source and binary forms, with or without
13+
* modification, are permitted provided that the following conditions
14+
* are met:
15+
*
16+
* 1. Redistributions of source code must retain the above copyright
17+
* notice, this list of conditions and the following disclaimer.
18+
*
19+
* 2. Redistributions in binary form must reproduce the above copyright
20+
* notice, this list of conditions and the following disclaimer in
21+
* the documentation and/or other materials provided with the
22+
* distribution.
23+
*
24+
* 3. The end-user documentation included with the redistribution, if
25+
* any, must include the following acknowledgement:
26+
* "This product includes software developed by the
27+
* Apache Software Foundation (http://www.apache.org/)."
28+
* Alternately, this acknowledgement may appear in the software itself,
29+
* if and wherever such third-party acknowledgements normally appear.
30+
*
31+
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
32+
* Foundation" must not be used to endorse or promote products derived
33+
* from this software without prior written permission. For written
34+
* permission, please contact apache@apache.org.
35+
*
36+
* 5. Products derived from this software may not be called "Apache"
37+
* nor may "Apache" appear in their names without prior written
38+
* permission of the Apache Software Foundation.
39+
*
40+
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
41+
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
42+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
43+
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
44+
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
47+
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
48+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
49+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
50+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51+
* SUCH DAMAGE.
52+
* ====================================================================
53+
*
54+
* This software consists of voluntary contributions made by many
55+
* individuals on behalf of the Apache Software Foundation. For more
56+
* information on the Apache Software Foundation, please see
57+
* <http://www.apache.org/>.
1558
*/
1659
package difflib;
1760

‎src/main/java/difflib/Chunk.java

Copy file name to clipboardExpand all lines: src/main/java/difflib/Chunk.java
+56-13Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,60 @@
11
/*
2-
Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com)
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
2+
* SPDX-License-Identifier: Apache-1.1
3+
*
4+
* ====================================================================
5+
* The Apache Software License, Version 1.1
6+
*
7+
* Copyright (c) 1999-2003 The Apache Software Foundation.
8+
* Copyright (c) 1996-2006 Juancarlo Añez
9+
* Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com)
10+
* All rights reserved.
11+
*
12+
* Redistribution and use in source and binary forms, with or without
13+
* modification, are permitted provided that the following conditions
14+
* are met:
15+
*
16+
* 1. Redistributions of source code must retain the above copyright
17+
* notice, this list of conditions and the following disclaimer.
18+
*
19+
* 2. Redistributions in binary form must reproduce the above copyright
20+
* notice, this list of conditions and the following disclaimer in
21+
* the documentation and/or other materials provided with the
22+
* distribution.
23+
*
24+
* 3. The end-user documentation included with the redistribution, if
25+
* any, must include the following acknowledgement:
26+
* "This product includes software developed by the
27+
* Apache Software Foundation (http://www.apache.org/)."
28+
* Alternately, this acknowledgement may appear in the software itself,
29+
* if and wherever such third-party acknowledgements normally appear.
30+
*
31+
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
32+
* Foundation" must not be used to endorse or promote products derived
33+
* from this software without prior written permission. For written
34+
* permission, please contact apache@apache.org.
35+
*
36+
* 5. Products derived from this software may not be called "Apache"
37+
* nor may "Apache" appear in their names without prior written
38+
* permission of the Apache Software Foundation.
39+
*
40+
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
41+
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
42+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
43+
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
44+
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
47+
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
48+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
49+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
50+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51+
* SUCH DAMAGE.
52+
* ====================================================================
53+
*
54+
* This software consists of voluntary contributions made by many
55+
* individuals on behalf of the Apache Software Foundation. For more
56+
* information on the Apache Software Foundation, please see
57+
* <http://www.apache.org/>.
1558
*/
1659
package difflib;
1760

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.