gnodet-bot commented on code in PR #2318:
URL: https://github.com/apache/maven-resolver/pull/2318#discussion_r4579507305
##########
maven-resolver-util/src/main/java/org/eclipse/aether/util/FileUtils.java:
##########
@@ -156,6 +160,7 @@ private static void copy(Path source, Path target) throws
IOException {
os.write(array, 0, bytes);
}
}
+ target.toFile().setLastModified(source.toFile().lastModified());
Review Comment:
⚠️ **Legacy `File` API — silent failure modes.**
`source.toFile().lastModified()` returns `0L` on error;
`target.toFile().setLastModified()` returns `boolean` and never throws — both
silently swallow failures.
The companion PR on master (#2319) uses the correct NIO2 pattern. Since this
branch's `FileUtils` has no logger:
```suggestion
try {
Files.setLastModifiedTime(target,
Files.getLastModifiedTime(source));
} catch (IOException e) {
// best effort — not critical
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]