Skip to content

Commit 1d8739e

Browse files
authored
sync: correct previous code to work with Java 8 (#540)
1 parent e291571 commit 1d8739e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/me/itzg/helpers/sync/SynchronizingFileVisitor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ public SynchronizingFileVisitor(Path src, Path dest, boolean skipNewerInDestinat
2727
static int walkDirectories(List<Path> srcDest, boolean skipNewerInDestination,
2828
FileProcessor fileProcessor
2929
) {
30-
final Path dest = srcDest.getLast();
30+
// TODO can use getLast() with java 21
31+
final Path dest = srcDest.get(srcDest.size() - 1);
3132

3233
for (final Path src : srcDest.subList(0, srcDest.size() - 1)) {
3334
if (Files.isDirectory(src)) {

0 commit comments

Comments
 (0)