]> source.dussan.org Git - jgit.git/commitdiff
CGitVsJGitRandomIgnorePatternTest: Open OutputStream in try-with-resource 66/118666/1
authorDavid Pursehouse <david.pursehouse@gmail.com>
Mon, 5 Mar 2018 11:55:20 +0000 (20:55 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Mon, 5 Mar 2018 11:55:20 +0000 (20:55 +0900)
Change-Id: I08e27d0ee48dabd94a4eeb608508f815a3000ec9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java

index 03b34acc05542fafabe4d590e4e8df58609acd3d..438d2d625b2aadb4d4a3637815504f7d6a4725fb 100644 (file)
@@ -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;
                }