equal
deleted
inserted
replaced
50 return this; |
50 return this; |
51 } |
51 } |
52 |
52 |
53 List<String> execute(Path root) throws IOException { |
53 List<String> execute(Path root) throws IOException { |
54 // Get the list of files in the root for which to look up for needed shared libraries |
54 // Get the list of files in the root for which to look up for needed shared libraries |
55 List<Path> allPackageFiles = Files.walk(root).filter( |
55 List<Path> allPackageFiles; |
56 Files::isRegularFile).filter(LibProvidersLookup::canDependOnLibs).collect( |
56 try (Stream<Path> stream = Files.walk(root)) { |
57 Collectors.toList()); |
57 allPackageFiles = stream.filter(Files::isRegularFile).filter( |
|
58 LibProvidersLookup::canDependOnLibs).collect( |
|
59 Collectors.toList()); |
|
60 } |
58 |
61 |
59 Collection<Path> neededLibs = getNeededLibsForFiles(allPackageFiles); |
62 Collection<Path> neededLibs = getNeededLibsForFiles(allPackageFiles); |
60 |
63 |
61 // Get the list of unique package names. |
64 // Get the list of unique package names. |
62 List<String> neededPackages = neededLibs.stream().map(libPath -> { |
65 List<String> neededPackages = neededLibs.stream().map(libPath -> { |