Browse Source

IndexDiffWithSymlinkTest: Open InputStream in try-with-resource

Change-Id: I5f49f80debb2259f665748408cd3604f869fa3ef
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.11
David Pursehouse 7 years ago
parent
commit
de96131d36
  1. 8
      org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff/IndexDiffWithSymlinkTest.java

8
org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff/IndexDiffWithSymlinkTest.java

@ -111,14 +111,12 @@ public class IndexDiffWithSymlinkTest extends LocalDiskRepositoryTestCase {
&& FS.DETECTED.supportsSymlinks()); && FS.DETECTED.supportsSymlinks());
super.setUp(); super.setUp();
File testDir = createTempDirectory(this.getClass().getSimpleName()); File testDir = createTempDirectory(this.getClass().getSimpleName());
InputStream in = this.getClass().getClassLoader().getResourceAsStream( try (InputStream in = this.getClass().getClassLoader()
.getResourceAsStream(
this.getClass().getPackage().getName().replace('.', '/') + '/' this.getClass().getPackage().getName().replace('.', '/') + '/'
+ FILEREPO + ".txt"); + FILEREPO + ".txt")) {
assertNotNull("Test repo file not found", in); assertNotNull("Test repo file not found", in);
try {
testRepoDir = restoreGitRepo(in, testDir, FILEREPO); testRepoDir = restoreGitRepo(in, testDir, FILEREPO);
} finally {
in.close();
} }
} }

Loading…
Cancel
Save