summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/exttst
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-03-05 20:55:20 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-03-05 20:55:20 +0900
commit903f1d1639781fe18d867d4efb29b6213c6c8a97 (patch)
treef1d03430c6825fa9eeb9d594769c381ef7d3da86 /org.eclipse.jgit.test/exttst
parent594722530bd9b3fd4f073a12775d88f27ad62de0 (diff)
downloadjgit-903f1d1639781fe18d867d4efb29b6213c6c8a97.tar.gz
jgit-903f1d1639781fe18d867d4efb29b6213c6c8a97.zip
CGitVsJGitRandomIgnorePatternTest: Open OutputStream in try-with-resource
Change-Id: I08e27d0ee48dabd94a4eeb608508f815a3000ec9 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test/exttst')
-rw-r--r--org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java b/org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java
index 03b34acc05..438d2d625b 100644
--- a/org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java
+++ b/org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java
@@ -187,10 +187,10 @@ public class CGitVsJGitRandomIgnorePatternTest {
"--no-index", "-v", "-n", "--stdin" };
Process proc = Runtime.getRuntime().exec(command, new String[0],
gitDir);
- OutputStream out = proc.getOutputStream();
- out.write((path + "\n").getBytes(UTF_8));
- out.flush();
- out.close();
+ try (OutputStream out = proc.getOutputStream()) {
+ out.write((path + "\n").getBytes(UTF_8));
+ out.flush();
+ }
return proc;
}