[PATCH JGIT 4/5] Method fails to close stream

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 .../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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux