modules/jdk.packager/src/main/java/jdk/packager/builders/windows/WindowsAppImageBuilder.java

Print this page

        

*** 54,63 **** --- 54,64 ---- import java.util.Objects; import java.util.ResourceBundle; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; import java.util.regex.Pattern; + import java.util.stream.Stream; import static com.oracle.tools.packager.StandardBundlerParam.*; /** *
*** 287,306 **** throw new RuntimeException("Not found MSVC dlls"); } AtomicReference<IOException> ioe = new AtomicReference<>(); final String finalVsVer = vsVer; ! Files.list(runtimeDir.resolve("bin")) ! .filter(p -> Pattern.matches("msvc(r|p)\\d\\d\\d.dll", p.toFile().getName().toLowerCase())) .filter(p -> !p.toString().toLowerCase().endsWith(finalVsVer + ".dll")) .forEach(p -> { try { Files.copy(p, root.resolve((p.toFile().getName()))); } catch (IOException e) { ioe.set(e); } }); IOException e = ioe.get(); if (e != null) { throw e; } --- 288,308 ---- throw new RuntimeException("Not found MSVC dlls"); } AtomicReference<IOException> ioe = new AtomicReference<>(); final String finalVsVer = vsVer; ! try (Stream<Path> files = Files.list(runtimeDir.resolve("bin"))) { ! files.filter(p -> Pattern.matches("msvc(r|p)\\d\\d\\d.dll", p.toFile().getName().toLowerCase())) .filter(p -> !p.toString().toLowerCase().endsWith(finalVsVer + ".dll")) .forEach(p -> { try { Files.copy(p, root.resolve((p.toFile().getName()))); } catch (IOException e) { ioe.set(e); } }); + } IOException e = ioe.get(); if (e != null) { throw e; }