Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
In this method
WatchManager.addWatch(String path, Watcher watcher, WatcherMode watcherMode)
use
Map.computeIfAbsent
simplify code like
Set<String> paths = watch2Paths.get(watcher); if (paths == null) { paths = new HashSet<>(); watch2Paths.put(watcher, paths); }
result:
Set<String> paths = watch2Paths.computeIfAbsent(watcher, k -> new HashSet<>());
Attachments
Issue Links
- links to