From a9a6eeb01e6900f2dc05c2139fe078edc054a454 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 10 Jul 2018 22:56:14 +0100 Subject: [PATCH] Parameters are final --- .../java/net/kemitix/gitdb/impl/GitTreeReader.java | 10 +++++----- .../java/net/kemitix/gitdb/impl/LocalGitDBImpl.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/kemitix/gitdb/impl/GitTreeReader.java b/src/main/java/net/kemitix/gitdb/impl/GitTreeReader.java index 76c82f7..a51dd21 100644 --- a/src/main/java/net/kemitix/gitdb/impl/GitTreeReader.java +++ b/src/main/java/net/kemitix/gitdb/impl/GitTreeReader.java @@ -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( treeWalk.getNameString(), revWalk.lookupBlob(treeWalk.getObjectId(0)), repository); } - private Consumer setTreeFilter(TreeWalk treeWalk) { + private Consumer setTreeFilter(final TreeWalk treeWalk) { return x -> Optional.ofNullable(treeFilter).ifPresent(treeWalk::setFilter); } - private Consumer disableRecursion(TreeWalk treeWalk) { + private Consumer disableRecursion(final TreeWalk treeWalk) { return x -> treeWalk.setRecursive(false); } - private Function> addTreeTo(TreeWalk treeWalk) { + private Function> addTreeTo(final TreeWalk treeWalk) { return tree -> Result.of(() -> { treeWalk.addTree(tree); return null; }); } - private Callable parseBranchCommit(Ref branchRef, RevWalk revWalk) { + private Callable parseBranchCommit(final Ref branchRef, final RevWalk revWalk) { return () -> revWalk.parseCommit(branchRef.getObjectId()); } diff --git a/src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java b/src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java index 140bd5f..fba081d 100644 --- a/src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java +++ b/src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java @@ -94,7 +94,7 @@ final class LocalGitDBImpl implements GitDB, LocalGitDB { .map(toLocalGitDB(userName, userEmailAddress)); } - private static Result gitOpen(Path dbDir) { + private static Result gitOpen(final Path dbDir) { try { return Result.ok(Git.open(dbDir.toFile())); } catch (IOException e) {