From: Shawn O. Pearce Date: Fri, 6 Aug 2010 16:48:50 +0000 (-0700) Subject: Merge branch 'rename-bug' X-Git-Tag: v0.9.1~130 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F61%2F1261%2F1;p=jgit.git 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 --- 09130b8731cf17d24c4b0a77c8faf532bf22db2c diff --cc org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java index 3ae3dc422c,ad37a73721..9c1310ab81 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java @@@ -508,14 -390,14 +508,14 @@@ public class RenameDetector List dels = (List) 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).oldName; ++ 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).newName; ++ 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++; } }