Browse Source

Use try-with-resource to close BlameGenerator

Change-Id: Id4cb9a236dddfc674b55e9e7037329a885455288
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tags/v4.0.0.201505050340-m2
Matthias Sohn 9 years ago
parent
commit
e03b6c5cf8
1 changed files with 1 additions and 4 deletions
  1. 1
    4
      org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java

+ 1
- 4
org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java View File

@@ -200,8 +200,7 @@ public class BlameCommand extends GitCommand<BlameResult> {
*/
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<BlameResult> {
return gen.computeBlameResult();
} catch (IOException e) {
throw new JGitInternalException(e.getMessage(), e);
} finally {
gen.release();
}
}


Loading…
Cancel
Save