{"thread":{"id":"18400","subject":"[PATCH JGIT 4/5] Method fails to close stream","startedAt":"2009-03-19T09:16:43Z","lastAt":"2009-03-19T09:16:43Z","messageCount":1,"participants":["Yann Simon"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"108496","messageId":"49C20D7B.1060702@gmail.com","threadId":"18400","inReplyTo":null,"subject":"[PATCH JGIT 4/5] Method fails to close stream","fromName":"Yann Simon","fromEmail":"yann.simon.fr@gmail.com","sentAt":"2009-03-19T09:16:43Z","receivedAt":"2009-03-19T09:16:43Z","isPatch":true,"sender":{"key":"yann.simon.fr@gmail.com","avatar":"https://gravatar.com/avatar/2d926895d27ac988c5c8e591887e5a6a4c7036390403c74fce92519119b887a0?d=mp&s=160"},"body":"The stream was only closed in case of an error.\nUse a finally block instead to ensure that the\nstream is closed.\n\nSigned-off-by: Yann Simon <yann.simon.fr@gmail.com>\n---\n .../src/org/spearce/jgit/lib/Repository.java       |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\nindex 8132e27..cfd92b8 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\n@@ -152,7 +152,7 @@ public Repository(final File d) throws IOException {\n \t\t\t\tfor (String alt=ar.readLine(); alt!=null; alt=ar.readLine()) {\n \t\t\t\t\treadObjectsDirs(FS.resolve(objectsDir, alt), ret);\n \t\t\t\t}\n-\t\t\t} catch (Exception e) {\n+\t\t\t} finally {\n \t\t\t\tar.close();\n \t\t\t}\n \t\t}\n-- \n1.6.1.2\n"}]}