diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-08-06 09:48:50 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-08-06 09:48:50 -0700 |
commit | 09130b8731cf17d24c4b0a77c8faf532bf22db2c (patch) | |
tree | dcfd3a6b3e14d94210069fbce75fbad64e70b809 /org.eclipse.jgit | |
parent | 8e9cc826e9275ce0e7ab51cc933923eb3b5f16ae (diff) | |
parent | e2f5716c940c5da22cbb3b0b08cb4ee7f2970580 (diff) | |
download | jgit-09130b8731cf17d24c4b0a77c8faf532bf22db2c.tar.gz jgit-09130b8731cf17d24c4b0a77c8faf532bf22db2c.zip |
Merge branch 'rename-bug'
* rename-bug:
Fix ArrayIndexOutOfBounds on non-square exact rename matrix
Conflicts:
org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java
Change-Id: Ie0b8dd3e1ec174f79ba39dc4706bb0694cc8be29
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java index 3ae3dc422c..9c1310ab81 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java @@ -508,14 +508,14 @@ public class RenameDetector { List<DiffEntry> dels = (List<DiffEntry>) o; long[] matrix = new long[dels.size() * adds.size()]; int mNext = 0; - for (int addIdx = 0; addIdx < adds.size(); addIdx++) { - String addedName = adds.get(addIdx).newPath; + for (int delIdx = 0; delIdx < dels.size(); delIdx++) { + String deletedName = dels.get(delIdx).oldPath; - for (int delIdx = 0; delIdx < dels.size(); delIdx++) { - String deletedName = dels.get(delIdx).oldPath; + for (int addIdx = 0; addIdx < adds.size(); addIdx++) { + String addedName = adds.get(addIdx).newPath; int score = SimilarityRenameDetector.nameScore(addedName, deletedName); - matrix[mNext] = SimilarityRenameDetector.encode(score, addIdx, delIdx); + matrix[mNext] = SimilarityRenameDetector.encode(score, delIdx, addIdx); mNext++; } } |