aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-03-23 09:07:33 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2023-03-23 09:07:33 +0100
commit67fcf76b4b353eb71d80d4217b43e34a1ff45f30 (patch)
tree8ac6e7a42af4dcc74e62ff2cab1d46a44b298e64 /org.eclipse.jgit
parentc6b979444b671f013f630241f84fba7983b540b6 (diff)
parentcd2dc85f316ebdd6f6e318fd3b6d6c62095ca243 (diff)
downloadjgit-67fcf76b4b353eb71d80d4217b43e34a1ff45f30.tar.gz
jgit-67fcf76b4b353eb71d80d4217b43e34a1ff45f30.zip
Merge branch 'stable-6.4' into stable-6.5
* stable-6.4: GC: Close File.lines stream Change-Id: I7e3a4b3671e779fd62062c4e10d224f432e39b54
Diffstat (limited to 'org.eclipse.jgit')
-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 a350561cc5..be359bbeaa 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
@@ -1792,8 +1792,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()) {