TextHashFunctions: Fix warnings about variable hiding
The local variables/arguments named 'db' were hiding the member variable of the same name in the superclass TextBuiltin. Change-Id: Ic49dcb7cc2a1b3fb46ad78450042c8c8fb464a80 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
This commit is contained in:
parent
a82f5c7425
commit
84ae3f4991
|
@ -286,25 +286,25 @@ protected void run() throws Exception {
|
||||||
else
|
else
|
||||||
rb.findGitDir(dir);
|
rb.findGitDir(dir);
|
||||||
|
|
||||||
Repository db = rb.build();
|
Repository repo = rb.build();
|
||||||
try {
|
try {
|
||||||
run(db);
|
run(repo);
|
||||||
} finally {
|
} finally {
|
||||||
db.close();
|
repo.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void run(Repository db) throws Exception {
|
private void run(Repository repo) throws Exception {
|
||||||
List<Function> all = init();
|
List<Function> all = init();
|
||||||
|
|
||||||
long fileCnt = 0;
|
long fileCnt = 0;
|
||||||
long lineCnt = 0;
|
long lineCnt = 0;
|
||||||
try (ObjectReader or = db.newObjectReader();
|
try (ObjectReader or = repo.newObjectReader();
|
||||||
RevWalk rw = new RevWalk(or);
|
RevWalk rw = new RevWalk(or);
|
||||||
TreeWalk tw = new TreeWalk(or)) {
|
TreeWalk tw = new TreeWalk(or)) {
|
||||||
final MutableObjectId id = new MutableObjectId();
|
final MutableObjectId id = new MutableObjectId();
|
||||||
tw.reset(rw.parseTree(db.resolve(Constants.HEAD)));
|
tw.reset(rw.parseTree(repo.resolve(Constants.HEAD)));
|
||||||
tw.setRecursive(true);
|
tw.setRecursive(true);
|
||||||
|
|
||||||
while (tw.next()) {
|
while (tw.next()) {
|
||||||
|
@ -341,7 +341,7 @@ private void run(Repository db) throws Exception {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
File directory = db.getDirectory();
|
File directory = repo.getDirectory();
|
||||||
if (directory != null) {
|
if (directory != null) {
|
||||||
String name = directory.getName();
|
String name = directory.getName();
|
||||||
File parent = directory.getParentFile();
|
File parent = directory.getParentFile();
|
||||||
|
|
Loading…
Reference in New Issue