Skip to content

Commit 7f91fca

Browse files
committed
Improve Files.find call
Assisted-by: Claude Opus 4.6
1 parent f1f1503 commit 7f91fca

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • src/main/java/org/fedoraproject/javapackages/validator

src/main/java/org/fedoraproject/javapackages/validator/Main.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,12 @@ private Map<String, Validator> discover() throws Exception {
403403
compileFiles();
404404

405405
var serviceContent = new ByteArrayOutputStream(0);
406-
for (var serviceFile : Files.find(parameters.sourcePath, Integer.MAX_VALUE,
407-
(p, a) -> !a.isDirectory() && p.getFileName().equals(Path.of(ValidatorFactory.class.getCanonicalName()))).toList()) {
408-
try (var is = Files.newInputStream(serviceFile)) {
409-
is.transferTo(serviceContent);
406+
try (var serviceFiles = Files.find(parameters.sourcePath, Integer.MAX_VALUE,
407+
(p, a) -> !a.isDirectory() && Path.of(ValidatorFactory.class.getCanonicalName()).equals(p.getFileName()))) {
408+
for (var serviceFile : serviceFiles.toList()) {
409+
try (var is = Files.newInputStream(serviceFile)) {
410+
is.transferTo(serviceContent);
411+
}
410412
}
411413
}
412414
if (serviceContent.size() != 0) {

0 commit comments

Comments
 (0)