Skip to content

Commit e53569a

Browse files
committed
Add general handleEvent implementation back to the base watch
1 parent 84b627b commit e53569a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,11 @@ protected WatchEvent.Kind translate(java.nio.file.WatchEvent.Kind<?> jdkKind) {
128128
public Path getPath() {
129129
return path;
130130
}
131+
132+
@Override
133+
public void handleEvent(WatchEvent e) {
134+
if (eventFilter.test(e)) {
135+
eventHandler.accept(this, e);
136+
}
137+
}
131138
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ public WatchScope getScope() {
9090

9191
@Override
9292
public void handleEvent(WatchEvent e) {
93-
if (!closed && eventFilter.test(e)) {
94-
eventHandler.accept(this, e);
93+
if (!closed) {
94+
super.handleEvent(e);
9595
}
9696
}
9797

0 commit comments

Comments
 (0)