Merge branch 'master' into gwt25

This commit is contained in:
Axel Uhl committed 2013-01-08 15:18:41 +01:00
commit 6a30a93e0d
390 files changed
+50711 -39737

No files matched your search

@@ -34,7 +34,7 @@ import java.util.List;
public class Chunk<T> {
private final int position;
private List<T> lines;
private final List<T> lines;
/**
* Creates a chunk and saves a copy of affected lines
@@ -88,10 +88,6 @@ public class Chunk<T> {
return position;
}
public void setLines(List<T> lines) {
this.lines = lines;
}
/**
* @return the affected lines
*/
@@ -43,6 +43,10 @@ public class Patch<T> {
return result;
}
public boolean isEmpty() {
return deltas.isEmpty();
}
/**
* Apply this patch to the given target in-place, updating the <code>target</code> list
* @return the patched text
@@ -123,7 +123,7 @@ public class MyersDiff<T> implements DiffAlgorithm<T> {
}
/**
* Computes the minimum diffpath that expresses de differences
* Computes the minimum diffpath that expresses the differences
* between the original and revised sequences, according
* to Gene Myers differencing algorithm.
*
@@ -155,7 +155,6 @@ public class MyersDiff<T> implements DiffAlgorithm<T> {
final int kplus = kmiddle + 1;
final int kminus = kmiddle - 1;
PathNode prev = null;
int i;
if ((k == -d) || (k != d && diagonal[kminus].i < diagonal[kplus].i)) {
i = diagonal[kplus].i;
@@ -164,13 +163,9 @@ public class MyersDiff<T> implements DiffAlgorithm<T> {
i = diagonal[kminus].i + 1;
prev = diagonal[kminus];
}
diagonal[kminus] = null; // no longer used
int j = i - k;
PathNode node = new DiffNode(i, j, prev);
// orig and rev are zero-based
// but the algorithm is one-based
// that's why there's no +1 when indexing the sequences
@@ -178,17 +173,15 @@ public class MyersDiff<T> implements DiffAlgorithm<T> {
i++;
j++;
}
if (i > node.i)
if (i > node.i) {
node = new Snake(i, j, node);
}
diagonal[kmiddle] = node;
if (i >= N && j >= M) {
return diagonal[kmiddle];
}
}
diagonal[middle + d - 1] = null;
}
// According to Myers, this cannot happen
throw new DifferentiationFailedException("could not find a diff path");