From b10da3eac6cf67d920c5328fc775b7841f5f5bed Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 21 Jun 2018 06:49:22 +0100 Subject: [PATCH] Remove redundant final in try-with-resources --- src/main/java/net/kemitix/gitdb/impl/InitGitDBRepo.java | 4 ++-- src/main/java/net/kemitix/gitdb/impl/KeyRemover.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/kemitix/gitdb/impl/InitGitDBRepo.java b/src/main/java/net/kemitix/gitdb/impl/InitGitDBRepo.java index b2019e1..d0c18e9 100644 --- a/src/main/java/net/kemitix/gitdb/impl/InitGitDBRepo.java +++ b/src/main/java/net/kemitix/gitdb/impl/InitGitDBRepo.java @@ -56,7 +56,7 @@ class InitGitDBRepo { final InitGitDBRepo initRepo = new InitGitDBRepo(); final File validDbDir = initRepo.validDbDir(dbDir.toFile()); validDbDir.mkdirs(); - try (final Repository repository = RepositoryCache.FileKey.exact(validDbDir, FS.DETECTED).open(false)) { + try (Repository repository = RepositoryCache.FileKey.exact(validDbDir, FS.DETECTED).open(false)) { repository.create(true); initRepo.createInitialBranchOnMaster(repository); } @@ -100,7 +100,7 @@ class InitGitDBRepo { } private void verifyIsEmpty(final File dbDir) throws IOException { - try (final DirectoryStream directoryStream = Files.newDirectoryStream(dbDir.toPath())) { + try (DirectoryStream directoryStream = Files.newDirectoryStream(dbDir.toPath())) { if (directoryStream.iterator().hasNext()) { throw new DirectoryNotEmptyException(dbDir.toString()); } diff --git a/src/main/java/net/kemitix/gitdb/impl/KeyRemover.java b/src/main/java/net/kemitix/gitdb/impl/KeyRemover.java index b27cdc3..f8cd7d0 100644 --- a/src/main/java/net/kemitix/gitdb/impl/KeyRemover.java +++ b/src/main/java/net/kemitix/gitdb/impl/KeyRemover.java @@ -105,7 +105,7 @@ class KeyRemover { * @throws IOException the object could not be stored. */ private ObjectId insertTree(final TreeFormatter treeFormatter) throws IOException { - try (final ObjectInserter inserter = repository.getObjectDatabase().newInserter()) { + try (ObjectInserter inserter = repository.getObjectDatabase().newInserter()) { return inserter.insert(treeFormatter); } }