Program: 55328
Project: 55328
Buggy source:
@NotNull private WatchKey processKey() throws InterruptedException {
  WatchKey key=watcher.take();
  for (  WatchEvent<?> event : key.pollEvents()) {
    Kind<?> kind=event.kind();
    if (kind == StandardWatchEventKinds.OVERFLOW) {
      continue;
    }
    WatchEvent<Path> ev=(WatchEvent<Path>)event;
    Path fileName=ev.context();
    String mapKey=fileName.toString();
    if (mapKey.startsWith("String_Node_Str")) {
      continue;
    }
    if (kind == StandardWatchEventKinds.ENTRY_CREATE || kind == StandardWatchEventKinds.ENTRY_MODIFY) {
      Path p=dirPath.resolve(fileName);
      BytesStore mapVal=getFileContentsFromDisk(p,null);
      FileRecord<BytesStore> prev=lastFileRecordMap.get(p.toFile());
      BytesStore prevContents=prev == null ? null : prev.contents();
      try {
        if (mapVal != null & mapVal.contentEquals(prevContents)) {
          continue;
        }
        if (mapVal == null) {
          if (prev != null)           mapVal=prevContents;
        }
 else {
          lastFileRecordMap.put(p.toFile(),new FileRecord<>(p.toFile().lastModified(),mapVal.copy()));
        }
        if (prev == null) {
          subscriptions.notifyEvent(InsertedEvent.of(asset.fullName(),p.toFile().getName(),mapVal,false));
        }
 else {
          subscriptions.notifyEvent(UpdatedEvent.of(asset.fullName(),p.toFile().getName(),prevContents,mapVal,false));
        }
      }
  finally {
        if (prevContents != null)         prevContents.release();
      }
    }
 else     if (kind == StandardWatchEventKinds.ENTRY_DELETE) {
      Path p=dirPath.resolve(fileName);
      FileRecord<BytesStore> prev=lastFileRecordMap.remove(p.toFile());
      BytesStore lastVal=prev == null ? null : prev.contents();
      try {
        subscriptions.notifyEvent(RemovedEvent.of(asset.fullName(),p.toFile().getName(),lastVal,false));
      }
  finally {
        if (lastVal != null)         lastVal.release();
      }
    }
  }
  return key;
}

Fixed version (ground truth):
@NotNull private WatchKey processKey() throws InterruptedException {
  WatchKey key=watcher.take();
  for (  WatchEvent<?> event : key.pollEvents()) {
    Kind<?> kind=event.kind();
    if (kind == StandardWatchEventKinds.OVERFLOW) {
      continue;
    }
    WatchEvent<Path> ev=(WatchEvent<Path>)event;
    Path fileName=ev.context();
    String mapKey=fileName.toString();
    if (mapKey.startsWith("String_Node_Str")) {
      continue;
    }
    if (kind == StandardWatchEventKinds.ENTRY_CREATE || kind == StandardWatchEventKinds.ENTRY_MODIFY) {
      Path p=dirPath.resolve(fileName);
      BytesStore mapVal=getFileContentsFromDisk(p,null);
      FileRecord<BytesStore> prev=lastFileRecordMap.get(p.toFile());
      BytesStore prevContents=prev == null ? null : prev.contents();
      try {
        if (mapVal != null && mapVal.contentEquals(prevContents)) {
          continue;
        }
        if (mapVal == null) {
          if (prev != null)           mapVal=prevContents;
        }
 else {
          lastFileRecordMap.put(p.toFile(),new FileRecord<>(p.toFile().lastModified(),mapVal.copy()));
        }
        if (prev == null) {
          subscriptions.notifyEvent(InsertedEvent.of(asset.fullName(),p.toFile().getName(),mapVal,false));
        }
 else {
          subscriptions.notifyEvent(UpdatedEvent.of(asset.fullName(),p.toFile().getName(),prevContents,mapVal,false));
        }
      }
  finally {
        if (prevContents != null)         prevContents.release();
      }
    }
 else     if (kind == StandardWatchEventKinds.ENTRY_DELETE) {
      Path p=dirPath.resolve(fileName);
      FileRecord<BytesStore> prev=lastFileRecordMap.remove(p.toFile());
      BytesStore lastVal=prev == null ? null : prev.contents();
      try {
        subscriptions.notifyEvent(RemovedEvent.of(asset.fullName(),p.toFile().getName(),lastVal,false));
      }
  finally {
        if (lastVal != null)         lastVal.release();
      }
    }
  }
  return key;
}