From 614e861f818c2e19eb4a2f06fe0bec948df5671d Mon Sep 17 00:00:00 2001 From: catbref Date: Wed, 28 Feb 2018 12:16:21 +0000 Subject: [PATCH 1/6] Fix for issue #20 correcting empty-context add-only patches Empty-context add-only patches were applied in the wrong place, typically one line early. This commit uses the code submitted in the issue but tidied up and corrected for current master snapshot. --- src/main/java/difflib/DiffUtils.java | 48 +++++++------- .../EmptyContextUnifiedDiffTest.java | 65 +++++++++++++++++++ src/test/resources/mocks/uc_insert_patch.txt | 4 ++ .../resources/mocks/uc_insert_revised.txt | 5 ++ src/test/resources/mocks/uc_original.txt | 4 ++ 5 files changed, 102 insertions(+), 24 deletions(-) create mode 100644 src/test/java/diffutils/EmptyContextUnifiedDiffTest.java create mode 100644 src/test/resources/mocks/uc_insert_patch.txt create mode 100644 src/test/resources/mocks/uc_insert_revised.txt create mode 100644 src/test/resources/mocks/uc_original.txt diff --git a/src/main/java/difflib/DiffUtils.java b/src/main/java/difflib/DiffUtils.java index 62247b3..42e9027 100644 --- a/src/main/java/difflib/DiffUtils.java +++ b/src/main/java/difflib/DiffUtils.java @@ -159,25 +159,8 @@ public static Patch parseUnifiedDiff(List diff) { Matcher m = unifiedDiffChunkRe.matcher(line); if (m.find()) { // Process the lines in the previous chunk - if (rawChunk.size() != 0) { - List oldChunkLines = new ArrayList(); - List newChunkLines = new ArrayList(); - - for (String[] raw_line : rawChunk) { - tag = raw_line[0]; - rest = raw_line[1]; - if (tag.equals(" ") || tag.equals("-")) { - oldChunkLines.add(rest); - } - if (tag.equals(" ") || tag.equals("+")) { - newChunkLines.add(rest); - } - } - patch.addDelta(new ChangeDelta(new Chunk( - old_ln - 1, oldChunkLines), new Chunk( - new_ln - 1, newChunkLines))); - rawChunk.clear(); - } + processRawChunk(rawChunk, patch, old_ln, new_ln); + // Parse the @@ header old_ln = m.group(1) == null ? 1 : Integer.parseInt(m.group(1)); new_ln = m.group(3) == null ? 1 : Integer.parseInt(m.group(3)); @@ -202,6 +185,15 @@ public static Patch parseUnifiedDiff(List diff) { } // Process the lines in the last chunk + processRawChunk(rawChunk, patch, old_ln, new_ln); + + return patch; + } + + public static void processRawChunk(List rawChunk, Patch patch, int old_ln, int new_ln) { + String tag; + String rest; + if (rawChunk.size() != 0) { List oldChunkLines = new ArrayList(); List newChunkLines = new ArrayList(); @@ -217,13 +209,21 @@ public static Patch parseUnifiedDiff(List diff) { } } - patch.addDelta(new ChangeDelta(new Chunk( - old_ln - 1, oldChunkLines), new Chunk(new_ln - 1, - newChunkLines))); + if (oldChunkLines.isEmpty()) { + patch.addDelta(new InsertDelta(new Chunk( + old_ln, oldChunkLines), new Chunk(new_ln - 1, + newChunkLines))); + } else if (newChunkLines.isEmpty()) { + patch.addDelta(new InsertDelta(new Chunk( + old_ln - 1, oldChunkLines), new Chunk(new_ln, + newChunkLines))); + } else { + patch.addDelta(new ChangeDelta(new Chunk( + old_ln - 1, oldChunkLines), new Chunk( + new_ln - 1, newChunkLines))); + } rawChunk.clear(); } - - return patch; } /** diff --git a/src/test/java/diffutils/EmptyContextUnifiedDiffTest.java b/src/test/java/diffutils/EmptyContextUnifiedDiffTest.java new file mode 100644 index 0000000..7f50287 --- /dev/null +++ b/src/test/java/diffutils/EmptyContextUnifiedDiffTest.java @@ -0,0 +1,65 @@ +package diffutils; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; + +import difflib.DiffUtils; +import difflib.Patch; +import difflib.PatchFailedException; + +import junit.framework.TestCase; + +public class EmptyContextUnifiedDiffTest extends TestCase { + + public List fileToLines(String filename) { + List lines = new LinkedList(); + String line = ""; + try { + BufferedReader in = new BufferedReader(new FileReader(filename)); + while ((line = in.readLine()) != null) { + lines.add(line); + } + } catch (IOException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + return lines; + } + + public void testUnifiedContextInsert() { + testUnifiedContextXXX(TestConstants.MOCK_FOLDER + "uc_insert_patch.txt", TestConstants.MOCK_FOLDER + + "uc_insert_revised.txt"); + } + + public void testUnifiedContextXXX(String patch_file, String revised_file) { + List origLines = fileToLines(TestConstants.MOCK_FOLDER + "uc_original.txt"); + List revLines = fileToLines(revised_file); + List unifiedDiff = fileToLines(patch_file); + List patchedLines = null; + Patch patch = DiffUtils.parseUnifiedDiff(unifiedDiff); + + try { + patchedLines = (List) patch.applyTo(origLines); + } catch (PatchFailedException e) { + fail(e.getMessage()); + } + + verifyLinesEqual(patchedLines, revLines); + } + + public void verifyLinesEqual(List patchedLines, List revLines) { + assertTrue(revLines.size() == patchedLines.size()); + for (int i = 0; i < revLines.size(); i++) { + String l1 = revLines.get(i); + String l2 = patchedLines.get(i); + if (!l1.equals(l2)) { + fail("Line " + (i + 1) + " of the patched file did not match the revised original"); + } + } + } + +} diff --git a/src/test/resources/mocks/uc_insert_patch.txt b/src/test/resources/mocks/uc_insert_patch.txt new file mode 100644 index 0000000..60e309a --- /dev/null +++ b/src/test/resources/mocks/uc_insert_patch.txt @@ -0,0 +1,4 @@ +--- uc_original.txt 2011-06-14 16:21:56.578627000 +0300 ++++ uc_insert_revised.txt 2011-06-14 16:20:37.654820000 +0300 +@@ -2,0 +3 @@ ++not diff --git a/src/test/resources/mocks/uc_insert_revised.txt b/src/test/resources/mocks/uc_insert_revised.txt new file mode 100644 index 0000000..ce3ca7b --- /dev/null +++ b/src/test/resources/mocks/uc_insert_revised.txt @@ -0,0 +1,5 @@ +This +is +not +a +test diff --git a/src/test/resources/mocks/uc_original.txt b/src/test/resources/mocks/uc_original.txt new file mode 100644 index 0000000..c2a2bdd --- /dev/null +++ b/src/test/resources/mocks/uc_original.txt @@ -0,0 +1,4 @@ +This +is +a +test From 1d6d7c601699fe40f5ecf8175fa34ae88212dc16 Mon Sep 17 00:00:00 2001 From: catbref Date: Wed, 28 Feb 2018 13:08:12 +0000 Subject: [PATCH 2/6] Correct mistaken use of InsertDelta instead of DeleteDelta Bad copy&paste caused use of InsertDelta instead of DeleteDelta when applying fix for issue #20. Also improved test to cover empty-context patches that delete lines to cover this case. --- src/main/java/difflib/DiffUtils.java | 2 +- src/test/resources/mocks/uc_insert_patch.txt | 2 ++ src/test/resources/mocks/uc_original.txt | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/difflib/DiffUtils.java b/src/main/java/difflib/DiffUtils.java index 42e9027..7338936 100644 --- a/src/main/java/difflib/DiffUtils.java +++ b/src/main/java/difflib/DiffUtils.java @@ -214,7 +214,7 @@ public static void processRawChunk(List rawChunk, Patch patch, int old old_ln, oldChunkLines), new Chunk(new_ln - 1, newChunkLines))); } else if (newChunkLines.isEmpty()) { - patch.addDelta(new InsertDelta(new Chunk( + patch.addDelta(new DeleteDelta(new Chunk( old_ln - 1, oldChunkLines), new Chunk(new_ln, newChunkLines))); } else { diff --git a/src/test/resources/mocks/uc_insert_patch.txt b/src/test/resources/mocks/uc_insert_patch.txt index 60e309a..1249035 100644 --- a/src/test/resources/mocks/uc_insert_patch.txt +++ b/src/test/resources/mocks/uc_insert_patch.txt @@ -2,3 +2,5 @@ +++ uc_insert_revised.txt 2011-06-14 16:20:37.654820000 +0300 @@ -2,0 +3 @@ +not +@@ -5 +5,0 @@ +-file diff --git a/src/test/resources/mocks/uc_original.txt b/src/test/resources/mocks/uc_original.txt index c2a2bdd..24346cc 100644 --- a/src/test/resources/mocks/uc_original.txt +++ b/src/test/resources/mocks/uc_original.txt @@ -2,3 +2,4 @@ This is a test +file From 8df661f60bfa9576fd9ad900c34bb64c7a0f64e3 Mon Sep 17 00:00:00 2001 From: catbref Date: Wed, 28 Feb 2018 14:56:00 +0000 Subject: [PATCH 3/6] Further to issue #20: corresponding fix to generateUnifiedDiff() DiffUtils.generateUnifiedDiff() produced off-by-one positions for hunks with empty context/content. EmptyContextUnifiedDiffTest.java has been improved to test for this. (Some test resource files renamed in light of more general use). --- src/main/java/difflib/DiffUtils.java | 8 ++ .../EmptyContextUnifiedDiffTest.java | 89 ++++++++++++------- ...txt => unified_empty_context_original.txt} | 0 ...ch.txt => unified_empty_context_patch.txt} | 0 ....txt => unified_empty_context_revised.txt} | 0 5 files changed, 65 insertions(+), 32 deletions(-) rename src/test/resources/mocks/{uc_original.txt => unified_empty_context_original.txt} (100%) rename src/test/resources/mocks/{uc_insert_patch.txt => unified_empty_context_patch.txt} (100%) rename src/test/resources/mocks/{uc_insert_revised.txt => unified_empty_context_revised.txt} (100%) diff --git a/src/main/java/difflib/DiffUtils.java b/src/main/java/difflib/DiffUtils.java index 7338936..02dc0bb 100644 --- a/src/main/java/difflib/DiffUtils.java +++ b/src/main/java/difflib/DiffUtils.java @@ -384,6 +384,14 @@ private static List processDeltas(List origLines, revTotal++; } + // In case of empty chunk and context + if (origTotal == 0 && origStart > 1) + --origStart; + + // In case of empty chunk and context + if (revTotal == 0 && revStart > 1) + --revStart; + // Create and insert the block header, conforming to the Unified Diff // standard StringBuffer header = new StringBuffer(); diff --git a/src/test/java/diffutils/EmptyContextUnifiedDiffTest.java b/src/test/java/diffutils/EmptyContextUnifiedDiffTest.java index 7f50287..580b4b8 100644 --- a/src/test/java/diffutils/EmptyContextUnifiedDiffTest.java +++ b/src/test/java/diffutils/EmptyContextUnifiedDiffTest.java @@ -1,7 +1,6 @@ package diffutils; import java.io.BufferedReader; -import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.LinkedList; @@ -18,48 +17,74 @@ public class EmptyContextUnifiedDiffTest extends TestCase { public List fileToLines(String filename) { List lines = new LinkedList(); String line = ""; + BufferedReader in = null; try { - BufferedReader in = new BufferedReader(new FileReader(filename)); + in = new BufferedReader(new FileReader(filename)); while ((line = in.readLine()) != null) { lines.add(line); } } catch (IOException e) { e.printStackTrace(); fail(e.getMessage()); + } finally { + if (in != null) { + try { + in.close(); + } catch (IOException e) { + // ignore ... any errors should already have been + // reported via an IOException from the final flush. + } + } } return lines; } - public void testUnifiedContextInsert() { - testUnifiedContextXXX(TestConstants.MOCK_FOLDER + "uc_insert_patch.txt", TestConstants.MOCK_FOLDER - + "uc_insert_revised.txt"); + public void testEmptyUnifiedContextPatch() { + List origLines = fileToLines(TestConstants.MOCK_FOLDER + "unified_empty_context_original.txt"); + List revLines = fileToLines(TestConstants.MOCK_FOLDER + "unified_empty_context_revised.txt"); + List unifiedDiff = fileToLines(TestConstants.MOCK_FOLDER + "unified_empty_context_patch.txt"); + + List patchedLines = null; + Patch patch = DiffUtils.parseUnifiedDiff(unifiedDiff); + + try { + patchedLines = (List) patch.applyTo(origLines); + } catch (PatchFailedException e) { + fail(e.getMessage()); + } + + verifyLinesEqual(patchedLines, revLines); + } + + public void testEmptyUnifiedContextDiff() { + List origLines = fileToLines(TestConstants.MOCK_FOLDER + "unified_empty_context_original.txt"); + List revLines = fileToLines(TestConstants.MOCK_FOLDER + "unified_empty_context_revised.txt"); + + List patchedLines = null; + + // Generate a 0-context diff then reapply + Patch generatedPatch = DiffUtils.diff(origLines, revLines); + List generatedDiff = DiffUtils.generateUnifiedDiff("original", "revised", origLines, generatedPatch, 0); + Patch newPatch = DiffUtils.parseUnifiedDiff(generatedDiff); + + try { + patchedLines = (List) newPatch.applyTo(origLines); + } catch (PatchFailedException e) { + fail(e.getMessage()); + } + + verifyLinesEqual(patchedLines, revLines); + } + + public void verifyLinesEqual(List patchedLines, List revLines) { + assertTrue(revLines.size() == patchedLines.size()); + for (int i = 0; i < revLines.size(); i++) { + String l1 = revLines.get(i); + String l2 = patchedLines.get(i); + if (!l1.equals(l2)) { + fail("Line " + (i + 1) + " of the patched file did not match the revised original"); + } + } } - public void testUnifiedContextXXX(String patch_file, String revised_file) { - List origLines = fileToLines(TestConstants.MOCK_FOLDER + "uc_original.txt"); - List revLines = fileToLines(revised_file); - List unifiedDiff = fileToLines(patch_file); - List patchedLines = null; - Patch patch = DiffUtils.parseUnifiedDiff(unifiedDiff); - - try { - patchedLines = (List) patch.applyTo(origLines); - } catch (PatchFailedException e) { - fail(e.getMessage()); - } - - verifyLinesEqual(patchedLines, revLines); - } - - public void verifyLinesEqual(List patchedLines, List revLines) { - assertTrue(revLines.size() == patchedLines.size()); - for (int i = 0; i < revLines.size(); i++) { - String l1 = revLines.get(i); - String l2 = patchedLines.get(i); - if (!l1.equals(l2)) { - fail("Line " + (i + 1) + " of the patched file did not match the revised original"); - } - } - } - } diff --git a/src/test/resources/mocks/uc_original.txt b/src/test/resources/mocks/unified_empty_context_original.txt similarity index 100% rename from src/test/resources/mocks/uc_original.txt rename to src/test/resources/mocks/unified_empty_context_original.txt diff --git a/src/test/resources/mocks/uc_insert_patch.txt b/src/test/resources/mocks/unified_empty_context_patch.txt similarity index 100% rename from src/test/resources/mocks/uc_insert_patch.txt rename to src/test/resources/mocks/unified_empty_context_patch.txt diff --git a/src/test/resources/mocks/uc_insert_revised.txt b/src/test/resources/mocks/unified_empty_context_revised.txt similarity index 100% rename from src/test/resources/mocks/uc_insert_revised.txt rename to src/test/resources/mocks/unified_empty_context_revised.txt From e2d4b0a03205a7e1769d2992c1267031549bb0aa Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sun, 24 Jun 2018 13:19:06 +0200 Subject: [PATCH 4/6] Update license header to Apache-1.1 - Also modernize README.md - DiffNode.java original source: https://github.com/apache/wicket/blob/master/wicket-util/src/main/java/org/apache/wicket/util/diff/myers/DiffNode.java --- README.md | 39 ++++--- build.xml | 53 +++++++++ pom.xml | 57 ++++++++- src/main/java/difflib/ChangeDelta.java | 68 ++++++++--- src/main/java/difflib/Chunk.java | 68 ++++++++--- src/main/java/difflib/DeleteDelta.java | 68 ++++++++--- src/main/java/difflib/Delta.java | 68 ++++++++--- src/main/java/difflib/DeltaComparator.java | 58 +++++++++ src/main/java/difflib/DiffAlgorithm.java | 68 ++++++++--- src/main/java/difflib/DiffException.java | 68 ++++++++--- src/main/java/difflib/DiffRow.java | 68 ++++++++--- src/main/java/difflib/DiffRowGenerator.java | 68 ++++++++--- src/main/java/difflib/DiffUtils.java | 68 ++++++++--- src/main/java/difflib/InsertDelta.java | 68 ++++++++--- src/main/java/difflib/Patch.java | 68 ++++++++--- .../java/difflib/PatchFailedException.java | 68 ++++++++--- src/main/java/difflib/StringUtills.java | 68 ++++++++--- .../java/difflib/myers/DiffException.java | 5 +- src/main/java/difflib/myers/DiffNode.java | 67 +++++++++-- .../myers/DifferentiationFailedException.java | 5 +- src/main/java/difflib/myers/Equalizer.java | 58 +++++++++ src/main/java/difflib/myers/MyersDiff.java | 9 +- src/main/java/difflib/myers/PathNode.java | 5 +- src/main/java/difflib/myers/Snake.java | 5 +- src/main/java/difflib/myers/package.html | 110 +++++++++--------- src/main/java/difflib/package.html | 110 +++++++++--------- .../java/diffutils/DiffRowGeneratorTest.java | 58 +++++++++ src/test/java/diffutils/DiffTest.java | 58 +++++++++ .../diffutils/GenerateUnifiedDiffTest.java | 58 +++++++++ src/test/java/diffutils/PatchTest.java | 58 +++++++++ src/test/java/diffutils/TestConstants.java | 58 +++++++++ .../java/diffutils/examples/ApplyPatch.java | 58 +++++++++ .../diffutils/examples/ComputeDifference.java | 58 +++++++++ src/test/java/diffutils/examples/Example.java | 58 +++++++++ 34 files changed, 1616 insertions(+), 313 deletions(-) diff --git a/README.md b/README.md index ef18772..9a897da 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ +# Diff Utils + 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. -# Main Features +## 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 @@ -10,38 +12,49 @@ Main reason to build this library was the lack of easy-to-use libraries with all * parsing the unified diff format * producing human-readable differences -# Algorithms +## Algorithms 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. -# Changelog +## Changelog -## Version 1.2 +### Version 1.2 * JDK 1.5 compatibility * Ant build script * Generate output in unified diff format (thanks for Bill James) -# To Install +## To Install Just add the code below to your maven dependencies: - - com.googlecode.java-diff-utils - diffutils - 1.3.0 - +```xml + + com.googlecode.java-diff-utils + diffutils + 1.3.0 + +``` And for Ivy: - +```xml + +``` -# Coming eventually +## Coming eventually * support for inline diffs in output * helpers for showing side-by-side, line-by-line diffs or text with inter-line and intra-line change highlights * customization of diff algorithm for better experience while computing diffs between strings (ignoring blank lines or spaces, etc) * generating output in other formats (not only unified). E.g. CVS. -# Tutorials +## Tutorials http://www.adictosaltrabajo.com/tutoriales/tutoriales.php?pagina=CompararFicherosJavaDiffUtils (in Spanish). Thanks Miguel + +## License + +This work is licensed under The Apache Software License, Version 1.1. +Reason: The code contains work of HP, which contributed it under Apache-1.1. +[[Example code](https://github.com/apache/wicket/blob/master/wicket-util/src/main/java/org/apache/wicket/util/diff/Delta.java)). +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. diff --git a/build.xml b/build.xml index 621d364..7c0e74e 100644 --- a/build.xml +++ b/build.xml @@ -1,5 +1,58 @@ + + diff --git a/pom.xml b/pom.xml index 7f2a74d..544dcc6 100644 --- a/pom.xml +++ b/pom.xml @@ -1,3 +1,56 @@ + + 4.0.0 @@ -22,8 +75,8 @@ - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt + The Apache Software License, Version 1.1 + http://www.apache.org/licenses/LICENSE-1.1/url> repo A business-friendly OSS license diff --git a/src/main/java/difflib/ChangeDelta.java b/src/main/java/difflib/ChangeDelta.java index 759bc54..c1e66a8 100644 --- a/src/main/java/difflib/ChangeDelta.java +++ b/src/main/java/difflib/ChangeDelta.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/Chunk.java b/src/main/java/difflib/Chunk.java index bbc332c..bcc7ee9 100644 --- a/src/main/java/difflib/Chunk.java +++ b/src/main/java/difflib/Chunk.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/DeleteDelta.java b/src/main/java/difflib/DeleteDelta.java index 44dcecc..4995fd6 100644 --- a/src/main/java/difflib/DeleteDelta.java +++ b/src/main/java/difflib/DeleteDelta.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/Delta.java b/src/main/java/difflib/Delta.java index 2a0a8d1..7d6afb7 100644 --- a/src/main/java/difflib/Delta.java +++ b/src/main/java/difflib/Delta.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/DeltaComparator.java b/src/main/java/difflib/DeltaComparator.java index 98b7ab3..2eba963 100644 --- a/src/main/java/difflib/DeltaComparator.java +++ b/src/main/java/difflib/DeltaComparator.java @@ -1,3 +1,61 @@ +/* + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + package difflib; import java.io.Serializable; diff --git a/src/main/java/difflib/DiffAlgorithm.java b/src/main/java/difflib/DiffAlgorithm.java index 21ccd16..87a86e6 100644 --- a/src/main/java/difflib/DiffAlgorithm.java +++ b/src/main/java/difflib/DiffAlgorithm.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/DiffException.java b/src/main/java/difflib/DiffException.java index 6ad3dd4..8db2181 100644 --- a/src/main/java/difflib/DiffException.java +++ b/src/main/java/difflib/DiffException.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/DiffRow.java b/src/main/java/difflib/DiffRow.java index 6f8234b..322d993 100644 --- a/src/main/java/difflib/DiffRow.java +++ b/src/main/java/difflib/DiffRow.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/DiffRowGenerator.java b/src/main/java/difflib/DiffRowGenerator.java index d6ffb6b..44a6b38 100644 --- a/src/main/java/difflib/DiffRowGenerator.java +++ b/src/main/java/difflib/DiffRowGenerator.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/DiffUtils.java b/src/main/java/difflib/DiffUtils.java index 62247b3..5795435 100644 --- a/src/main/java/difflib/DiffUtils.java +++ b/src/main/java/difflib/DiffUtils.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/InsertDelta.java b/src/main/java/difflib/InsertDelta.java index 23914a9..f2ff17c 100644 --- a/src/main/java/difflib/InsertDelta.java +++ b/src/main/java/difflib/InsertDelta.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/Patch.java b/src/main/java/difflib/Patch.java index b93a5f1..cc34752 100644 --- a/src/main/java/difflib/Patch.java +++ b/src/main/java/difflib/Patch.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/PatchFailedException.java b/src/main/java/difflib/PatchFailedException.java index 5fb77d2..daaa38d 100644 --- a/src/main/java/difflib/PatchFailedException.java +++ b/src/main/java/difflib/PatchFailedException.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/StringUtills.java b/src/main/java/difflib/StringUtills.java index 6917036..00a67d8 100644 --- a/src/main/java/difflib/StringUtills.java +++ b/src/main/java/difflib/StringUtills.java @@ -1,17 +1,59 @@ /* - Copyright 2010 Dmitry Naumenko (dm.naumenko@gmail.com) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ package difflib; diff --git a/src/main/java/difflib/myers/DiffException.java b/src/main/java/difflib/myers/DiffException.java index d3802ff..f3ae46f 100644 --- a/src/main/java/difflib/myers/DiffException.java +++ b/src/main/java/difflib/myers/DiffException.java @@ -1,9 +1,11 @@ /* - * ==================================================================== + * SPDX-License-Identifier: Apache-1.1 * + * ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,7 +54,6 @@ * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . - * */ package difflib.myers; diff --git a/src/main/java/difflib/myers/DiffNode.java b/src/main/java/difflib/myers/DiffNode.java index 477689a..5f7d456 100644 --- a/src/main/java/difflib/myers/DiffNode.java +++ b/src/main/java/difflib/myers/DiffNode.java @@ -1,14 +1,63 @@ -package difflib.myers; - -/** - *

Title:

- *

Description:

- *

Copyright: Copyright (c) 2002

- *

Company:

- * @author not attributable - * @version 1.0 +/* + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . */ +package difflib.myers; + /** * A diffnode in a diffpath. *

diff --git a/src/main/java/difflib/myers/DifferentiationFailedException.java b/src/main/java/difflib/myers/DifferentiationFailedException.java index c25c081..7c17d3b 100644 --- a/src/main/java/difflib/myers/DifferentiationFailedException.java +++ b/src/main/java/difflib/myers/DifferentiationFailedException.java @@ -1,9 +1,11 @@ /* - * ==================================================================== + * SPDX-License-Identifier: Apache-1.1 * + * ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,7 +54,6 @@ * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . - * */ package difflib.myers; diff --git a/src/main/java/difflib/myers/Equalizer.java b/src/main/java/difflib/myers/Equalizer.java index 215e9ad..9d25192 100644 --- a/src/main/java/difflib/myers/Equalizer.java +++ b/src/main/java/difflib/myers/Equalizer.java @@ -1,3 +1,61 @@ +/* + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + package difflib.myers; /** diff --git a/src/main/java/difflib/myers/MyersDiff.java b/src/main/java/difflib/myers/MyersDiff.java index db0ece5..01a6498 100644 --- a/src/main/java/difflib/myers/MyersDiff.java +++ b/src/main/java/difflib/myers/MyersDiff.java @@ -1,10 +1,12 @@ /* - * ==================================================================== + * SPDX-License-Identifier: Apache-1.1 * + * ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 1999-2003 The Apache Software Foundation. All rights - * reserved. + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -52,7 +54,6 @@ * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . - * */ package difflib.myers; diff --git a/src/main/java/difflib/myers/PathNode.java b/src/main/java/difflib/myers/PathNode.java index 4ead5f2..6eee740 100644 --- a/src/main/java/difflib/myers/PathNode.java +++ b/src/main/java/difflib/myers/PathNode.java @@ -1,9 +1,11 @@ /* - * ==================================================================== + * SPDX-License-Identifier: Apache-1.1 * + * ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,7 +54,6 @@ * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . - * */ package difflib.myers; diff --git a/src/main/java/difflib/myers/Snake.java b/src/main/java/difflib/myers/Snake.java index ebdc2ce..0c9ff85 100644 --- a/src/main/java/difflib/myers/Snake.java +++ b/src/main/java/difflib/myers/Snake.java @@ -1,9 +1,11 @@ /* - * ==================================================================== + * SPDX-License-Identifier: Apache-1.1 * + * ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,7 +54,6 @@ * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . - * */ package difflib.myers; diff --git a/src/main/java/difflib/myers/package.html b/src/main/java/difflib/myers/package.html index ca8f0d0..9d42b14 100644 --- a/src/main/java/difflib/myers/package.html +++ b/src/main/java/difflib/myers/package.html @@ -1,59 +1,61 @@ + ~ SPDX-License-Identifier: Apache-1.1 + ~ + ~ ==================================================================== + ~ The Apache Software License, Version 1.1 + ~ + ~ Copyright (c) 2002 The Apache Software Foundation. + ~ Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + ~ All rights reserved. + ~ + ~ Redistribution and use in source and binary forms, with or without + ~ modification, are permitted provided that the following conditions + ~ are met: + ~ + ~ 1. Redistributions of source code must retain the above copyright + ~ notice, this list of conditions and the following disclaimer. + ~ + ~ 2. Redistributions in binary form must reproduce the above copyright + ~ notice, this list of conditions and the following disclaimer in + ~ the documentation and/or other materials provided with the + ~ distribution. + ~ + ~ 3. The end-user documentation included with the redistribution, if + ~ any, must include the following acknowledgement: + ~ "This product includes software developed by the + ~ Apache Software Foundation (http://www.apache.org/)." + ~ Alternately, this acknowledgement may appear in the software itself, + ~ if and wherever such third-party acknowledgements normally appear. + ~ + ~ 4. The names "The Jakarta Project", "Commons", and "Apache Software + ~ Foundation" must not be used to endorse or promote products derived + ~ from this software without prior written permission. For written + ~ permission, please contact apache@apache.org. + ~ + ~ 5. Products derived from this software may not be called "Apache" + ~ nor may "Apache" appear in their names without prior written + ~ permission of the Apache Software Foundation. + ~ + ~ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + ~ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + ~ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + ~ DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + ~ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + ~ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + ~ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + ~ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ~ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + ~ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + ~ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + ~ SUCH DAMAGE. + ~ ==================================================================== + ~ + ~ This software consists of voluntary contributions made by many + ~ individuals on behalf of the Apache Software Foundation. For more + ~ information on the Apache Software Foundation, please see + ~ . + --> + ~ SPDX-License-Identifier: Apache-1.1 + ~ + ~ ==================================================================== + ~ The Apache Software License, Version 1.1 + ~ + ~ Copyright (c) 2002 The Apache Software Foundation. + ~ Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + ~ All rights reserved. + ~ + ~ Redistribution and use in source and binary forms, with or without + ~ modification, are permitted provided that the following conditions + ~ are met: + ~ + ~ 1. Redistributions of source code must retain the above copyright + ~ notice, this list of conditions and the following disclaimer. + ~ + ~ 2. Redistributions in binary form must reproduce the above copyright + ~ notice, this list of conditions and the following disclaimer in + ~ the documentation and/or other materials provided with the + ~ distribution. + ~ + ~ 3. The end-user documentation included with the redistribution, if + ~ any, must include the following acknowledgement: + ~ "This product includes software developed by the + ~ Apache Software Foundation (http://www.apache.org/)." + ~ Alternately, this acknowledgement may appear in the software itself, + ~ if and wherever such third-party acknowledgements normally appear. + ~ + ~ 4. The names "The Jakarta Project", "Commons", and "Apache Software + ~ Foundation" must not be used to endorse or promote products derived + ~ from this software without prior written permission. For written + ~ permission, please contact apache@apache.org. + ~ + ~ 5. Products derived from this software may not be called "Apache" + ~ nor may "Apache" appear in their names without prior written + ~ permission of the Apache Software Foundation. + ~ + ~ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + ~ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + ~ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + ~ DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + ~ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + ~ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + ~ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + ~ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ~ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + ~ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + ~ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + ~ SUCH DAMAGE. + ~ ==================================================================== + ~ + ~ This software consists of voluntary contributions made by many + ~ individuals on behalf of the Apache Software Foundation. For more + ~ information on the Apache Software Foundation, please see + ~ . + --> . + */ + package diffutils; import java.util.Arrays; diff --git a/src/test/java/diffutils/DiffTest.java b/src/test/java/diffutils/DiffTest.java index 6d1ef31..22d12cd 100644 --- a/src/test/java/diffutils/DiffTest.java +++ b/src/test/java/diffutils/DiffTest.java @@ -1,3 +1,61 @@ +/* + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + package diffutils; import difflib.*; diff --git a/src/test/java/diffutils/GenerateUnifiedDiffTest.java b/src/test/java/diffutils/GenerateUnifiedDiffTest.java index 64432db..5894fca 100644 --- a/src/test/java/diffutils/GenerateUnifiedDiffTest.java +++ b/src/test/java/diffutils/GenerateUnifiedDiffTest.java @@ -1,3 +1,61 @@ +/* + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + package diffutils; import java.io.BufferedReader; diff --git a/src/test/java/diffutils/PatchTest.java b/src/test/java/diffutils/PatchTest.java index b6b4d74..5a7c944 100644 --- a/src/test/java/diffutils/PatchTest.java +++ b/src/test/java/diffutils/PatchTest.java @@ -1,3 +1,61 @@ +/* + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + package diffutils; import difflib.DiffUtils; diff --git a/src/test/java/diffutils/TestConstants.java b/src/test/java/diffutils/TestConstants.java index 5803394..5cdc1bf 100644 --- a/src/test/java/diffutils/TestConstants.java +++ b/src/test/java/diffutils/TestConstants.java @@ -1,3 +1,61 @@ +/* + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + package diffutils; import java.io.File; diff --git a/src/test/java/diffutils/examples/ApplyPatch.java b/src/test/java/diffutils/examples/ApplyPatch.java index 7ec1b45..8e70fe6 100644 --- a/src/test/java/diffutils/examples/ApplyPatch.java +++ b/src/test/java/diffutils/examples/ApplyPatch.java @@ -1,3 +1,61 @@ +/* + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + package diffutils.examples; import java.util.List; diff --git a/src/test/java/diffutils/examples/ComputeDifference.java b/src/test/java/diffutils/examples/ComputeDifference.java index a1a3eb1..cf927c9 100644 --- a/src/test/java/diffutils/examples/ComputeDifference.java +++ b/src/test/java/diffutils/examples/ComputeDifference.java @@ -1,3 +1,61 @@ +/* + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + package diffutils.examples; import java.util.List; diff --git a/src/test/java/diffutils/examples/Example.java b/src/test/java/diffutils/examples/Example.java index 28526cb..5e18ad7 100644 --- a/src/test/java/diffutils/examples/Example.java +++ b/src/test/java/diffutils/examples/Example.java @@ -1,3 +1,61 @@ +/* + * SPDX-License-Identifier: Apache-1.1 + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgement may appear in the software itself, + * if and wherever such third-party acknowledgements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + package diffutils.examples; import java.io.BufferedReader; From 0a4a346af9e382536bb6444d382b41d6673a58d0 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Mon, 25 Jun 2018 06:52:27 +0200 Subject: [PATCH 5/6] =?UTF-8?q?Add=20Juancarlo=20A=C3=B1ez=20(based=20on?= =?UTF-8?q?=20JRCS=20sources)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/difflib/ChangeDelta.java | 1 + src/main/java/difflib/Chunk.java | 1 + src/main/java/difflib/DeleteDelta.java | 1 + src/main/java/difflib/Delta.java | 1 + src/main/java/difflib/DiffAlgorithm.java | 1 + src/main/java/difflib/DiffException.java | 1 + src/main/java/difflib/PatchFailedException.java | 1 + src/main/java/difflib/myers/DiffException.java | 1 + src/main/java/difflib/myers/DiffNode.java | 1 + src/main/java/difflib/myers/DifferentiationFailedException.java | 1 + src/main/java/difflib/myers/MyersDiff.java | 1 + src/main/java/difflib/myers/PathNode.java | 1 + src/main/java/difflib/myers/Snake.java | 1 + src/main/java/difflib/myers/package.html | 1 + src/main/java/difflib/package.html | 1 + 15 files changed, 15 insertions(+) diff --git a/src/main/java/difflib/ChangeDelta.java b/src/main/java/difflib/ChangeDelta.java index c1e66a8..2385023 100644 --- a/src/main/java/difflib/ChangeDelta.java +++ b/src/main/java/difflib/ChangeDelta.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/Chunk.java b/src/main/java/difflib/Chunk.java index bcc7ee9..fe3ce55 100644 --- a/src/main/java/difflib/Chunk.java +++ b/src/main/java/difflib/Chunk.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/DeleteDelta.java b/src/main/java/difflib/DeleteDelta.java index 4995fd6..04fa8c0 100644 --- a/src/main/java/difflib/DeleteDelta.java +++ b/src/main/java/difflib/DeleteDelta.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/Delta.java b/src/main/java/difflib/Delta.java index 7d6afb7..923801e 100644 --- a/src/main/java/difflib/Delta.java +++ b/src/main/java/difflib/Delta.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/DiffAlgorithm.java b/src/main/java/difflib/DiffAlgorithm.java index 87a86e6..5e5f74f 100644 --- a/src/main/java/difflib/DiffAlgorithm.java +++ b/src/main/java/difflib/DiffAlgorithm.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/DiffException.java b/src/main/java/difflib/DiffException.java index 8db2181..9b333bd 100644 --- a/src/main/java/difflib/DiffException.java +++ b/src/main/java/difflib/DiffException.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/PatchFailedException.java b/src/main/java/difflib/PatchFailedException.java index daaa38d..bf0eac8 100644 --- a/src/main/java/difflib/PatchFailedException.java +++ b/src/main/java/difflib/PatchFailedException.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/myers/DiffException.java b/src/main/java/difflib/myers/DiffException.java index f3ae46f..ad8142c 100644 --- a/src/main/java/difflib/myers/DiffException.java +++ b/src/main/java/difflib/myers/DiffException.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/myers/DiffNode.java b/src/main/java/difflib/myers/DiffNode.java index 5f7d456..cd4c327 100644 --- a/src/main/java/difflib/myers/DiffNode.java +++ b/src/main/java/difflib/myers/DiffNode.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/myers/DifferentiationFailedException.java b/src/main/java/difflib/myers/DifferentiationFailedException.java index 7c17d3b..e47c8d1 100644 --- a/src/main/java/difflib/myers/DifferentiationFailedException.java +++ b/src/main/java/difflib/myers/DifferentiationFailedException.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/myers/MyersDiff.java b/src/main/java/difflib/myers/MyersDiff.java index 01a6498..1357339 100644 --- a/src/main/java/difflib/myers/MyersDiff.java +++ b/src/main/java/difflib/myers/MyersDiff.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/myers/PathNode.java b/src/main/java/difflib/myers/PathNode.java index 6eee740..6ffcfc0 100644 --- a/src/main/java/difflib/myers/PathNode.java +++ b/src/main/java/difflib/myers/PathNode.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/myers/Snake.java b/src/main/java/difflib/myers/Snake.java index 0c9ff85..0e895fb 100644 --- a/src/main/java/difflib/myers/Snake.java +++ b/src/main/java/difflib/myers/Snake.java @@ -5,6 +5,7 @@ * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. + * Copyright (c) 1996-2006 Juancarlo Añez * Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) * All rights reserved. * diff --git a/src/main/java/difflib/myers/package.html b/src/main/java/difflib/myers/package.html index 9d42b14..3608290 100644 --- a/src/main/java/difflib/myers/package.html +++ b/src/main/java/difflib/myers/package.html @@ -6,6 +6,7 @@ ~ The Apache Software License, Version 1.1 ~ ~ Copyright (c) 2002 The Apache Software Foundation. + ~ Copyright (c) 1996-2006 Juancarlo Añez ~ Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) ~ All rights reserved. ~ diff --git a/src/main/java/difflib/package.html b/src/main/java/difflib/package.html index 18c154f..e83243c 100644 --- a/src/main/java/difflib/package.html +++ b/src/main/java/difflib/package.html @@ -6,6 +6,7 @@ ~ The Apache Software License, Version 1.1 ~ ~ Copyright (c) 2002 The Apache Software Foundation. + ~ Copyright (c) 1996-2006 Juancarlo Añez ~ Copyright (c) 2010 Dmitry Naumenko (dm.naumenko@gmail.com) ~ All rights reserved. ~ From 1743825bfe7442b3ded466b5cafa955aaa2e2722 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Tue, 26 Jun 2018 18:46:11 +0200 Subject: [PATCH 6/6] Fix XML in pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 544dcc6..e1750e5 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ The Apache Software License, Version 1.1 - http://www.apache.org/licenses/LICENSE-1.1/url> + http://www.apache.org/licenses/LICENSE-1.1 repo A business-friendly OSS license