Skip to content

Commit b760db9

Browse files
committed
Rename method to better convey intent
1 parent 2cc3c66 commit b760db9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private void getFileNameAndThen(WatchEvent event, Consumer<Path> consumer) {
145145
}
146146

147147
private void acceptOverflow() {
148-
openAndCloseChildWatches();
148+
syncChildWatchesWithFileSystem();
149149
for (var childWatch : childWatches.values()) {
150150
reportOverflowTo(childWatch);
151151
}
@@ -172,7 +172,7 @@ private void reportOverflowTo(JDKFileTreeWatch childWatch) {
172172
}
173173
}
174174

175-
private void openAndCloseChildWatches() {
175+
private void syncChildWatchesWithFileSystem() {
176176
var toBeClosed = new HashSet<>(childWatches.keySet());
177177

178178
try (var children = Files.find(path, 1, (p, attrs) -> p != path && attrs.isDirectory())) {
@@ -267,7 +267,7 @@ public synchronized void close() throws IOException {
267267
@Override
268268
protected synchronized void start() throws IOException {
269269
internal.open();
270-
openAndCloseChildWatches();
270+
syncChildWatchesWithFileSystem();
271271
// There's no need to report an overflow event, because `internal` was
272272
// opened *before* the file system was accessed to fetch children. Thus,
273273
// if a new directory is created while this method is running, then at

0 commit comments

Comments
 (0)