Skip to content

Commit 5c4b337

Browse files
committed
Fix relative path of overflow events
1 parent 333e7ef commit 5c4b337

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/engineering/swat/watch/impl/jdk/JDKBaseWatch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ else if (jdkEvent.kind() == StandardWatchEventKinds.OVERFLOW) {
8181
throw new IllegalArgumentException("Unexpected watch event: " + jdkEvent);
8282
}
8383
var rootPath = path;
84-
var relativePath = kind == WatchEvent.Kind.OVERFLOW ? rootPath : (@Nullable Path)jdkEvent.context();
84+
var relativePath = kind == WatchEvent.Kind.OVERFLOW ? Path.of("") : (@Nullable Path)jdkEvent.context();
8585

8686
var event = new WatchEvent(kind, rootPath, relativePath);
8787
logger.trace("Translated: {} to {}", jdkEvent, event);

0 commit comments

Comments
 (0)