Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse2018-03-06 23:25:15 +0000
committerDavid Pursehouse2018-03-06 23:25:15 +0000
commitde96131d36e0b8ee4a595cb60e7accf26cf14106 (patch)
tree4f05c05bc9729c526ca3e3e2970016376b4a00d5 /org.eclipse.jgit.test/tst
parent7b57ce518693ba9cf2899100e8dad892571d500e (diff)
downloadjgit-de96131d36e0b8ee4a595cb60e7accf26cf14106.tar.gz
jgit-de96131d36e0b8ee4a595cb60e7accf26cf14106.tar.xz
jgit-de96131d36e0b8ee4a595cb60e7accf26cf14106.zip
IndexDiffWithSymlinkTest: Open InputStream in try-with-resource
Change-Id: I5f49f80debb2259f665748408cd3604f869fa3ef Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff/IndexDiffWithSymlinkTest.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff/IndexDiffWithSymlinkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff/IndexDiffWithSymlinkTest.java
index 3db27926c6..d5d3857ca4 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff/IndexDiffWithSymlinkTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff/IndexDiffWithSymlinkTest.java
@@ -111,14 +111,12 @@ public class IndexDiffWithSymlinkTest extends LocalDiskRepositoryTestCase {
&& FS.DETECTED.supportsSymlinks());
super.setUp();
File testDir = createTempDirectory(this.getClass().getSimpleName());
- InputStream in = this.getClass().getClassLoader().getResourceAsStream(
+ try (InputStream in = this.getClass().getClassLoader()
+ .getResourceAsStream(
this.getClass().getPackage().getName().replace('.', '/') + '/'
- + FILEREPO + ".txt");
- assertNotNull("Test repo file not found", in);
- try {
+ + FILEREPO + ".txt")) {
+ assertNotNull("Test repo file not found", in);
testRepoDir = restoreGitRepo(in, testDir, FILEREPO);
- } finally {
- in.close();
}
}

Back to the top