diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-05 20:55:20 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-05 20:55:20 +0900 |
commit | 903f1d1639781fe18d867d4efb29b6213c6c8a97 (patch) | |
tree | f1d03430c6825fa9eeb9d594769c381ef7d3da86 /org.eclipse.jgit.test/exttst | |
parent | 594722530bd9b3fd4f073a12775d88f27ad62de0 (diff) | |
download | jgit-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.java | 8 |
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; } |