diff --git a/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java b/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java index 2caed57c0ec..50857eea6d5 100644 --- a/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java +++ b/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java @@ -1,23 +1,3 @@ -import static java.io.File.createTempFile; -import static java.lang.Long.parseLong; -import static java.lang.System.getProperty; -import static java.nio.file.Files.readAllBytes; -import static java.util.Arrays.stream; -import static java.util.Collections.emptyList; -import static java.util.stream.Collectors.joining; -import static java.util.stream.Collectors.toList; -import static jdk.test.lib.process.ProcessTools.createJavaProcessBuilder; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.Collection; -import java.util.Optional; -import java.util.stream.Stream; - /* * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,6 +21,26 @@ import java.util.stream.Stream; * questions. */ +import static java.io.File.createTempFile; +import static java.lang.Long.parseLong; +import static java.lang.System.getProperty; +import static java.nio.file.Files.readAllBytes; +import static java.util.Arrays.stream; +import static java.util.Collections.emptyList; +import static java.util.stream.Collectors.joining; +import static java.util.stream.Collectors.toList; +import static jdk.test.lib.process.ProcessTools.createJavaProcessBuilder; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Collection; +import java.util.Optional; +import java.util.stream.Stream; + /* * @test TestInheritFD * @bug 8176717 8176809 @@ -176,7 +176,8 @@ public class TestInheritFD { .findFirst(); System.out.println("using command: " + command.map((c) -> c[0] + " " + c[1]).orElse("")); - return command.map(c -> run(c[0], c[1], "" + pid).collect(toList())).orElse(emptyList()); // if command can not be found return list without log file (some machines does not have "lsof" in the expected place) + // if command can not be found return list without log file (some machines does not have "lsof" in the expected place) + return command.map(c -> run(c[0], c[1], "" + pid).collect(toList())).orElse(emptyList()); } static boolean findOpenLogFile(Collection fileNames) {