From e03b6c5cf86c7bcaef8ec40cd9e07193709aad8a Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Thu, 2 Apr 2015 01:15:59 +0200 Subject: [PATCH] Use try-with-resource to close BlameGenerator Change-Id: Id4cb9a236dddfc674b55e9e7037329a885455288 Signed-off-by: Matthias Sohn --- org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java index f7ce835d51..a83814eb46 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java @@ -200,8 +200,7 @@ public class BlameCommand extends GitCommand { */ public BlameResult call() throws GitAPIException { checkCallable(); - BlameGenerator gen = new BlameGenerator(repo, path); - try { + try (BlameGenerator gen = new BlameGenerator(repo, path)) { if (diffAlgorithm != null) gen.setDiffAlgorithm(diffAlgorithm); if (textComparator != null) @@ -231,8 +230,6 @@ public class BlameCommand extends GitCommand { return gen.computeBlameResult(); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); - } finally { - gen.release(); } } -- 2.39.5