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. 10
      org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff/IndexDiffWithSymlinkTest.java

10
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();
}
}

Loading…
Cancel
Save