* [PATCH JGIT 4/5] Method fails to close stream
@ 2009-03-19 9:16 Yann Simon
0 siblings, 0 replies; only message in thread
From: Yann Simon @ 2009-03-19 9:16 UTC (permalink / raw)
To: Robin Rosenberg, Shawn O. Pearce; +Cc: git
The stream was only closed in case of an error.
Use a finally block instead to ensure that the
stream is closed.
Signed-off-by: Yann Simon <yann.simon.fr@gmail.com>
---
.../src/org/spearce/jgit/lib/Repository.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
index 8132e27..cfd92b8 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -152,7 +152,7 @@ public Repository(final File d) throws IOException {
for (String alt=ar.readLine(); alt!=null; alt=ar.readLine()) {
readObjectsDirs(FS.resolve(objectsDir, alt), ret);
}
- } catch (Exception e) {
+ } finally {
ar.close();
}
}
--
1.6.1.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-19 9:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-19 9:16 [PATCH JGIT 4/5] Method fails to close stream Yann Simon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.