private void trackWatchForAttempt(WatchedPathInfo watchedPathInfo, WatchKey watchKey) {
    assert watchedPathInfo.pathIdentifier != null;
    // TODO May be possible to do finer-grained locks.
    synchronized (watchesPerAttempt) {
      List<WatchKey> list = watchesPerAttempt.get(watchedPathInfo.pathIdentifier);
      if (list == null) {
        list = new LinkedList<>();
        watchesPerAttempt.put(watchedPathInfo.pathIdentifier, list);
      }
      list.add(watchKey);
    }
  }
private void trackWatchForAttempt(WatchedPathInfo watchedPathInfo, WatchKey watchKey) {
    assert watchedPathInfo.pathIdentifier != null;
   
    synchronized (watchesPerAttempt) {
      List<WatchKey> list = watchesPerAttempt.get(watchedPathInfo.pathIdentifier);
      if (list == null) {
        list = new LinkedList<>();
        watchesPerAttempt.put(watchedPathInfo.pathIdentifier, list);
      }
      list.add(watchKey);
    }
  }
private void trackwatchforattempt(watchedpathinfo watchedpathinfo, watchkey watchkey) { assert watchedpathinfo.pathidentifier != null; synchronized (watchesperattempt) { list<watchkey> list = watchesperattempt.get(watchedpathinfo.pathidentifier); if (list == null) { list = new linkedlist<>(); watchesperattempt.put(watchedpathinfo.pathidentifier, list); } list.add(watchkey); } }