From 903f1d1639781fe18d867d4efb29b6213c6c8a97 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 5 Mar 2018 20:55:20 +0900 Subject: CGitVsJGitRandomIgnorePatternTest: Open OutputStream in try-with-resource Change-Id: I08e27d0ee48dabd94a4eeb608508f815a3000ec9 Signed-off-by: David Pursehouse --- .../eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'org.eclipse.jgit.test/exttst') 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; } -- cgit v1.2.3