summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/EditListTest.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/EditListTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/EditListTest.java
index 61bd8cf9c2..6027aff716 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/EditListTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/EditListTest.java
@@ -90,17 +90,14 @@ public class EditListTest {
}
private Patch parseTestPatchFile(final String patchFile) throws IOException {
- final InputStream in = getClass().getResourceAsStream(patchFile);
- if (in == null) {
- fail("No " + patchFile + " test vector");
- return null; // Never happens
- }
- try {
+ try (InputStream in = getClass().getResourceAsStream(patchFile)) {
+ if (in == null) {
+ fail("No " + patchFile + " test vector");
+ return null; // Never happens
+ }
final Patch p = new Patch();
p.parse(in);
return p;
- } finally {
- in.close();
}
}
}