diff options
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java index 5871b4aeea..5de7bac112 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java @@ -20,9 +20,9 @@ import java.util.Arrays; import java.util.BitSet; import java.util.List; +import org.eclipse.jgit.api.errors.CanceledException; import org.eclipse.jgit.diff.DiffEntry.ChangeType; import org.eclipse.jgit.diff.SimilarityIndex.TableFullException; -import org.eclipse.jgit.errors.CancelledException; import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.lib.FileMode; import org.eclipse.jgit.lib.NullProgressMonitor; @@ -115,7 +115,7 @@ class SimilarityRenameDetector { skipBinaryFiles = value; } - void compute(ProgressMonitor pm) throws IOException, CancelledException { + void compute(ProgressMonitor pm) throws IOException, CanceledException { if (pm == null) pm = NullProgressMonitor.INSTANCE; @@ -130,9 +130,7 @@ class SimilarityRenameDetector { // for (--mNext; mNext >= 0; mNext--) { if (pm.isCancelled()) { - // TODO(ms): use org.eclipse.jgit.api.errors.CanceledException - // in next major version - throw new CancelledException(JGitText.get().renameCancelled); + throw new CanceledException(JGitText.get().renameCancelled); } long ent = matrix[mNext]; int sIdx = srcFile(ent); @@ -202,7 +200,7 @@ class SimilarityRenameDetector { } private int buildMatrix(ProgressMonitor pm) - throws IOException, CancelledException { + throws IOException, CanceledException { // Allocate for the worst-case scenario where every pair has a // score that we need to consider. We might not need that many. // @@ -228,10 +226,7 @@ class SimilarityRenameDetector { for (int dstIdx = 0; dstIdx < dsts.size(); dstIdx++) { if (pm.isCancelled()) { - // TODO(ms): use - // org.eclipse.jgit.api.errors.CanceledException in next - // major version - throw new CancelledException( + throw new CanceledException( JGitText.get().renameCancelled); } @@ -412,6 +407,7 @@ class SimilarityRenameDetector { | encodeFile(dstIdx); } + @SuppressWarnings("IntLongMath") private static long encodeFile(int idx) { // We invert the index so that the first file in the list sorts // later in the table. This permits us to break ties favoring @@ -420,6 +416,7 @@ class SimilarityRenameDetector { return INDEX_MASK - idx; } + @SuppressWarnings("IntLongMath") private static int decodeFile(int v) { return INDEX_MASK - v; } |