From e46654823543ea74dea29478d8dbd2470d6190a5 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 6 Mar 2018 09:52:12 +0900 Subject: [PATCH] DiffAlgorithms: Open Repository in try-with-resource Change-Id: I67cb486283213f8aa964333533c55966518baa36 Signed-off-by: David Pursehouse --- .../src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java index 5f8ebdb1a..0e1b398a7 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java @@ -160,11 +160,8 @@ class DiffAlgorithms extends TextBuiltin { else rb.findGitDir(dir); - Repository repo = rb.build(); - try { + try (Repository repo = rb.build()) { run(repo); - } finally { - repo.close(); } } }