Remove redundant final in try-with-resources

This commit is contained in:
Paul Campbell 2018-06-21 06:49:22 +01:00
parent b4e6cee636
commit b10da3eac6
2 changed files with 3 additions and 3 deletions

View file

@ -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<Path> directoryStream = Files.newDirectoryStream(dbDir.toPath())) {
try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(dbDir.toPath())) {
if (directoryStream.iterator().hasNext()) {
throw new DirectoryNotEmptyException(dbDir.toString());
}

View file

@ -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);
}
}