diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-07 08:25:15 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-07 08:25:15 +0900 |
commit | de96131d36e0b8ee4a595cb60e7accf26cf14106 (patch) | |
tree | 4f05c05bc9729c526ca3e3e2970016376b4a00d5 /org.eclipse.jgit.test | |
parent | 7b57ce518693ba9cf2899100e8dad892571d500e (diff) | |
download | jgit-de96131d36e0b8ee4a595cb60e7accf26cf14106.tar.gz 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')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff/IndexDiffWithSymlinkTest.java | 10 |
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(); } } |