Parameters are final

This commit is contained in:
Paul Campbell 2018-07-10 22:56:14 +01:00
parent 436a3e2501
commit a9a6eeb01e
2 changed files with 6 additions and 6 deletions

View file

@ -81,29 +81,29 @@ class GitTreeReader {
}); });
} }
private NamedRevBlob namedRevBlob(TreeWalk treeWalk, RevWalk revWalk) { private NamedRevBlob namedRevBlob(final TreeWalk treeWalk, final RevWalk revWalk) {
return new NamedRevBlob( return new NamedRevBlob(
treeWalk.getNameString(), treeWalk.getNameString(),
revWalk.lookupBlob(treeWalk.getObjectId(0)), revWalk.lookupBlob(treeWalk.getObjectId(0)),
repository); repository);
} }
private Consumer<Void> setTreeFilter(TreeWalk treeWalk) { private Consumer<Void> setTreeFilter(final TreeWalk treeWalk) {
return x -> Optional.ofNullable(treeFilter).ifPresent(treeWalk::setFilter); return x -> Optional.ofNullable(treeFilter).ifPresent(treeWalk::setFilter);
} }
private Consumer<Void> disableRecursion(TreeWalk treeWalk) { private Consumer<Void> disableRecursion(final TreeWalk treeWalk) {
return x -> treeWalk.setRecursive(false); return x -> treeWalk.setRecursive(false);
} }
private Function<RevTree, Result<Void>> addTreeTo(TreeWalk treeWalk) { private Function<RevTree, Result<Void>> addTreeTo(final TreeWalk treeWalk) {
return tree -> Result.of(() -> { return tree -> Result.of(() -> {
treeWalk.addTree(tree); treeWalk.addTree(tree);
return null; return null;
}); });
} }
private Callable<RevCommit> parseBranchCommit(Ref branchRef, RevWalk revWalk) { private Callable<RevCommit> parseBranchCommit(final Ref branchRef, final RevWalk revWalk) {
return () -> revWalk.parseCommit(branchRef.getObjectId()); return () -> revWalk.parseCommit(branchRef.getObjectId());
} }

View file

@ -94,7 +94,7 @@ final class LocalGitDBImpl implements GitDB, LocalGitDB {
.map(toLocalGitDB(userName, userEmailAddress)); .map(toLocalGitDB(userName, userEmailAddress));
} }
private static Result<Git> gitOpen(Path dbDir) { private static Result<Git> gitOpen(final Path dbDir) {
try { try {
return Result.ok(Git.open(dbDir.toFile())); return Result.ok(Git.open(dbDir.toFile()));
} catch (IOException e) { } catch (IOException e) {