From 903f1d1639781fe18d867d4efb29b6213c6c8a97 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 5 Mar 2018 20:55:20 +0900 Subject: [PATCH] CGitVsJGitRandomIgnorePatternTest: Open OutputStream in try-with-resource Change-Id: I08e27d0ee48dabd94a4eeb608508f815a3000ec9 Signed-off-by: David Pursehouse --- .../jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java | 8 ++++---- 1 file 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 03b34acc0..438d2d625 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; }