aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
index f25feee8f5..4fc9582d33 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
@@ -1683,8 +1683,9 @@ public class GC {
private void gcAlreadyRunning() {
close();
- try {
- Optional<String> s = Files.lines(pidFile).findFirst();
+ Optional<String> s;
+ try (Stream<String> lines = Files.lines(pidFile)) {
+ s = lines.findFirst();
String machine = null;
String pid = null;
if (s.isPresent()) {