| commit | 55164c43b9cd7989cbf20573efa8982641944b8c | [log] [tgz] |
|---|---|---|
| author | Matthias Sohn <matthias.sohn@sap.com> | Thu Mar 23 09:04:50 2023 +0100 |
| committer | Matthias Sohn <matthias.sohn@sap.com> | Thu Mar 23 09:04:50 2023 +0100 |
| tree | 253de6aac31da6bc9691f74dc8d955c50524d998 | |
| parent | 238f1693f7eab78505d469ae6349b262aa58eade [diff] | |
| parent | 3212c8fa387995cecbb95de50508ba142f772203 [diff] |
Merge branch 'stable-5.13' into stable-6.0 * stable-5.13: GC: Close File.lines stream Change-Id: Ib473750e5a3ad3d74b0cb41f25052890f50a975c
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 de01168..fef8a35 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 @@ private void failedToLock() { 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()) {