Skip to contentSkip to conversation

Method fails to close stream

PATCH New Yann Simon 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore

Yann Simon

author
#0 lore raw

PATCH 4/5 Method fails to close stream

The stream was only closed in case of an error.
Use a finally block instead to ensure that the
stream is closed.

---
 .../src/org/spearce/jgit/lib/Repository.java       |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java +1 -1
index 8132e27..cfd92b8 100644
@@ -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();
 			}
 		}
Signature · 1 line
1.6.1.2