Skip to content

Commit 1e9c9ca

Browse files
committed
Rename a few variables
1 parent b87ea2c commit 1e9c9ca

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343

4444
public class JDKDirectoryWatch extends JDKBaseWatch {
4545
private final Logger logger = LogManager.getLogger();
46-
private volatile @MonotonicNonNull Closeable bundledWatch;
4746
private final boolean nativeRecursive;
47+
private volatile @MonotonicNonNull Closeable bundledJDKWatcher;
4848

4949
private static final BundledSubscription<SubscriptionKey, List<java.nio.file.WatchEvent<?>>>
5050
BUNDLED_JDK_WATCHERS = new BundledSubscription<>(JDKPoller::register);
@@ -75,20 +75,20 @@ private void handleChanges(List<java.nio.file.WatchEvent<?>> events) {
7575

7676
@Override
7777
public synchronized void close() throws IOException {
78-
if (bundledWatch != null) {
78+
if (bundledJDKWatcher != null) {
7979
logger.trace("Closing watch for: {}", this.path);
80-
bundledWatch.close();
80+
bundledJDKWatcher.close();
8181
}
8282
}
8383

8484
@Override
8585
protected synchronized boolean runIfFirstTime() throws IOException {
86-
if (bundledWatch != null) {
86+
if (bundledJDKWatcher != null) {
8787
return false;
8888
}
8989

9090
var key = new SubscriptionKey(path, nativeRecursive);
91-
bundledWatch = BUNDLED_JDK_WATCHERS.subscribe(key, this::handleChanges);
91+
bundledJDKWatcher = BUNDLED_JDK_WATCHERS.subscribe(key, this::handleChanges);
9292
return true;
9393
}
9494
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ public FileVisitResult postVisitDirectory(Path subdir, IOException exc) throws I
148148
}
149149

150150
private void addNewDirectory(Path dir) throws IOException {
151-
var watcher = activeWatches.computeIfAbsent(dir, d -> new JDKDirectoryWatch(d, exec, relocater(dir)));
151+
var watch = activeWatches.computeIfAbsent(dir, d -> new JDKDirectoryWatch(d, exec, relocater(dir)));
152152
try {
153-
if (!watcher.runIfFirstTime()) {
154-
logger.debug("We lost the race on starting a nested watcher, that shouldn't be a problem, but it's a very busy, so we might have lost a few events in {}", dir);
153+
if (!watch.runIfFirstTime()) {
154+
logger.debug("We lost the race on starting a nested watch, that shouldn't be a problem, but it's a very busy, so we might have lost a few events in {}", dir);
155155
}
156156
} catch (IOException ex) {
157157
activeWatches.remove(dir);
@@ -160,7 +160,7 @@ private void addNewDirectory(Path dir) throws IOException {
160160
}
161161
}
162162

163-
/** Make sure that the events are relative to the actual root of the recursive watcher */
163+
/** Make sure that the events are relative to the actual root of the recursive watch */
164164
private Consumer<WatchEvent> relocater(Path subRoot) {
165165
final Path newRelative = path.relativize(subRoot);
166166
return ev -> {

0 commit comments

Comments
 (0)