aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2016-02-15 17:29:20 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2016-02-15 17:29:20 +0900
commit3a437dd655dd4620070c71774feccf908590784b (patch)
tree61541be1d3ddac731d89d3546fb072c01acdd154 /org.eclipse.jgit.pgm
parentc9e61c7b391d153884e9c8eafe3403fb93bfe8d7 (diff)
downloadjgit-3a437dd655dd4620070c71774feccf908590784b.tar.gz
jgit-3a437dd655dd4620070c71774feccf908590784b.zip
DiffAlgorithms: Fix warnings about variable hiding
Local variables/parameters named 'db' and 'cmp' were hiding class member variables of the same name. Change-Id: I98b770587aaf73744a93e6a3ee33d131a9fa91e9 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
index c96f2c1ba4..05d094f0de 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
@@ -155,16 +155,16 @@ class DiffAlgorithms extends TextBuiltin {
else
rb.findGitDir(dir);
- Repository db = rb.build();
+ Repository repo = rb.build();
try {
- run(db);
+ run(repo);
} finally {
- db.close();
+ repo.close();
}
}
}
- private void run(Repository db) throws Exception {
+ private void run(Repository repo) throws Exception {
List<Test> all = init();
long files = 0;
@@ -173,14 +173,14 @@ class DiffAlgorithms extends TextBuiltin {
int maxN = 0;
AbbreviatedObjectId startId;
- try (ObjectReader or = db.newObjectReader();
+ try (ObjectReader or = repo.newObjectReader();
RevWalk rw = new RevWalk(or)) {
final MutableObjectId id = new MutableObjectId();
TreeWalk tw = new TreeWalk(or);
tw.setFilter(TreeFilter.ANY_DIFF);
tw.setRecursive(true);
- ObjectId start = db.resolve(Constants.HEAD);
+ ObjectId start = repo.resolve(Constants.HEAD);
startId = or.abbreviate(start);
rw.markStart(rw.parseCommit(start));
for (;;) {
@@ -235,14 +235,15 @@ class DiffAlgorithms extends TextBuiltin {
Collections.sort(all, new Comparator<Test>() {
public int compare(Test a, Test b) {
- int cmp = Long.signum(a.runningTimeNanos - b.runningTimeNanos);
- if (cmp == 0)
- cmp = a.algorithm.name.compareTo(b.algorithm.name);
- return cmp;
+ int result = Long.signum(a.runningTimeNanos - b.runningTimeNanos);
+ if (result == 0) {
+ result = a.algorithm.name.compareTo(b.algorithm.name);
+ }
+ return result;
}
});
- File directory = db.getDirectory();
+ File directory = repo.getDirectory();
if (directory != null) {
String name = directory.getName();
File parent = directory.getParentFile();