Skip to content

Commit 6ea1016

Browse files
committed
WIP
1 parent dd9c4cb commit 6ea1016

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/main/java/engineering/swat/watch/impl/mac/NativeEventHandler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@ default void handle(String rootPath, String relativePath, int kindOrdinal) {
6666
var kind =
6767
kindOrdinal == Kind.CREATE.ordinal() ? ENTRY_CREATE :
6868
kindOrdinal == Kind.MODIFY.ordinal() ? ENTRY_MODIFY :
69-
kindOrdinal == Kind.DELETE.ordinal() ? ENTRY_DELETE : ENTRY_DELETE;
69+
kindOrdinal == Kind.DELETE.ordinal() ? ENTRY_DELETE : null;
7070

71-
handle(kind, context);
71+
if (kind != null) {
72+
handle(kind, context);
73+
}
7274
}
7375
}
7476
}

src/main/rust/src/fs_monitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use core_foundation::{
2121
};
2222
use fsevent_sys::{self as fse};
2323

24-
pub enum Kind {
24+
pub enum Kind { // Ordinals need to be consistent with enum `Kind` in Java
2525
OVERFLOW=0,
2626
CREATE=1,
2727
DELETE=2,

src/test/java/engineering/swat/watch/impl/mac/NativeEventStreamTests.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
import java.io.IOException;
3232
import java.nio.file.Files;
33-
import java.nio.file.Path;
3433
import java.nio.file.WatchEvent.Kind;
3534
import java.util.concurrent.atomic.AtomicBoolean;
3635

@@ -79,8 +78,6 @@ public <T> void handle(Kind<T> kind, @Nullable T context) {
7978
stream.open();
8079
Files.write(testDir.getTestFiles().get(0), "Hello".getBytes());
8180
await("Signal received").untilTrue(signaled);
82-
// Thread.sleep(60_000);
8381
}
84-
8582
}
8683
}

0 commit comments

Comments
 (0)