This commit is contained in:
Andrea Cavalli 2022-07-19 02:59:14 +02:00
parent 07015e1799
commit 15075631e9

View File

@ -124,10 +124,10 @@ public class SourcesGenerator {
}
// Get the files list
var generatedFilesToDelete = Files
.find(outPath, Integer.MAX_VALUE, (filePath, fileAttr) -> fileAttr.isRegularFile())
.map(outPath::relativize)
.collect(Collectors.toCollection(HashSet::new));
HashSet<Path> generatedFilesToDelete;
try (var stream = Files.find(outPath, Integer.MAX_VALUE, (filePath, fileAttr) -> fileAttr.isRegularFile())) {
generatedFilesToDelete = stream.map(outPath::relativize).collect(Collectors.toCollection(HashSet::new));
}
// Update the hash
Files.writeString(hashPath, basePackageName + '\n' + useRecordBuilders + '\n' + curHash + '\n',