Code review comment: Sure, if debug is actually enabled.

Code before review:
void processCodestartDir(final Path sourceDirectory, final Map<String, Object> finalData) {
log.debug(() -> "processing dir: " + sourceDirectory.toString());
final Collection<Path> sources = findSources(sourceDirectory);
for (Path sourcePath : sources) {
final Path relativeSourcePath = sourceDirectory.relativize(sourcePath);
if (!Files.isDirectory(sourcePath)) {
log.debug(() -> "found source file: " + relativeSourcePath.toString());
final String sourceFileName = sourcePath.getFileName().toString();
final Optional<CodestartFileReader> possibleReader = CodestartFileReader.ALL.stream()
.filter(r -> r.matches(sourceFileName))
.findFirst();
final CodestartFileReader reader = possibleReader.orElse(CodestartFileReader.DEFAULT);
log.debug(() -> "using reader: " + reader.getClass().getName());
final String targetFileName = reader.cleanFileName(sourceFileName);
final Path relativeTargetPath = relativeSourcePath.getNameCount() > 1
? relativeSourcePath.getParent().resolve(targetFileName)
: Paths.get(targetFileName);
final boolean hasFileStrategyHandler = getStrategy(relativeTargetPath.toString()).isPresent();
try {
final String processedRelativeTargetPath = CodestartPathProcessor.process(relativeTargetPath.toString(),
finalData);
if (!possibleReader.isPresent() && !hasFileStrategyHandler) {
final Path targetPath = targetDirectory.resolve(processedRelativeTargetPath);
log.debug(() -> "copy static file: " + sourcePath.toString() + "->" + targetPath.toString());
getSelectedDefaultStrategy().copyStaticFile(sourcePath, targetPath);
continue;
}
final Optional<String> content = reader.read(sourceDirectory, relativeSourcePath,
languageName, finalData);
if (content.isPresent()) {
log.debug(() -> "adding file to processing stack: " + sourcePath.toString());
this.files.putIfAbsent(processedRelativeTargetPath, new ArrayList<>());
this.files.get(processedRelativeTargetPath)
.add(new CodestartFile(processedRelativeTargetPath, content.get()));
} else {
log.debug(() -> "ignoring file: " + sourcePath.toString());
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
}
}

Line under review: log.debug(() -> "processing dir: " + sourceDirectory.toString());

Code after addressing the review:
void processCodestartDir(final Path sourceDirectory, final Map<String, Object> finalData) {
log.debug("processing dir: %s", sourceDirectory.toString());
final Collection<Path> sources = findSources(sourceDirectory);
for (Path sourcePath : sources) {
final Path relativeSourcePath = sourceDirectory.relativize(sourcePath);
if (!Files.isDirectory(sourcePath)) {
log.debug("found source file: %s", relativeSourcePath);
final String sourceFileName = sourcePath.getFileName().toString();
final Optional<CodestartFileReader> possibleReader = CodestartFileReader.ALL.stream()
.filter(r -> r.matches(sourceFileName))
.findFirst();
final CodestartFileReader reader = possibleReader.orElse(CodestartFileReader.DEFAULT);
log.debug("using reader: %s", reader.getClass().getName());
final String targetFileName = reader.cleanFileName(sourceFileName);
final Path relativeTargetPath = relativeSourcePath.getNameCount() > 1
? relativeSourcePath.getParent().resolve(targetFileName)
: Paths.get(targetFileName);
final boolean hasFileStrategyHandler = getStrategy(relativeTargetPath.toString()).isPresent();
try {
final String processedRelativeTargetPath = CodestartPathProcessor.process(relativeTargetPath.toString(),
finalData);
if (!possibleReader.isPresent() && !hasFileStrategyHandler) {
final Path targetPath = targetDirectory.resolve(processedRelativeTargetPath);
log.debug("copy static file: %s -> %s", sourcePath, targetPath);
getSelectedDefaultStrategy().copyStaticFile(sourcePath, targetPath);
continue;
}
final Optional<String> content = reader.read(sourceDirectory, relativeSourcePath,
languageName, finalData);
if (content.isPresent()) {
log.debug("adding file to processing stack: %s", sourcePath);
this.files.putIfAbsent(processedRelativeTargetPath, new ArrayList<>());
this.files.get(processedRelativeTargetPath)
.add(new CodestartFile(processedRelativeTargetPath, content.get()));
} else {
log.debug("ignoring file: %s", sourcePath);
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
}
}