Program: 731
Project: 731
Buggy source:
/** 
 * Merges all outstanding changes into the save game. If this operation gets interrupted it can be started again without any file corruption when the file system supports atomic moves. <br><br> The write lock for the save directory should be acquired before this method gets called.
 */
public void mergeChanges() throws IOException {
  final Path sourceDirectory=storagePathProvider.getUnmergedChangesPath();
  final Path targetDirectory=storagePathProvider.getStoragePathDirectory();
  Files.walkFileTree(sourceDirectory,new SimpleFileVisitor<Path>(){
    boolean atomicNotPossibleLogged;
    @Override public FileVisitResult preVisitDirectory(    Path sourceSubDir,    BasicFileAttributes attrs) throws IOException {
      Path targetSubDir=targetDirectory.resolve(sourceDirectory.relativize(sourceSubDir));
      if (!Files.isDirectory(targetSubDir)) {
        Files.createDirectory(targetSubDir);
      }
      return FileVisitResult.CONTINUE;
    }
    @Override public FileVisitResult visitFile(    Path sourcePath,    BasicFileAttributes attrs) throws IOException {
      Path targetPath=targetDirectory.resolve(sourceDirectory.relativize(sourcePath));
      try {
        Files.deleteIfExists(targetPath);
        Files.move(sourcePath,targetPath,StandardCopyOption.ATOMIC_MOVE);
      }
 catch (      AtomicMoveNotSupportedException e) {
        if (!atomicNotPossibleLogged) {
          logger.warn("String_Node_Str");
          atomicNotPossibleLogged=true;
        }
        Files.move(sourcePath,targetPath);
      }
      return FileVisitResult.CONTINUE;
    }
    @Override public FileVisitResult postVisitDirectory(    Path dir,    IOException exc) throws IOException {
      Files.delete(dir);
      return FileVisitResult.CONTINUE;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Merges all outstanding changes into the save game. If this operation gets interrupted it can be started again without any file corruption when the file system supports atomic moves. <br><br> The write lock for the save directory should be acquired before this method gets called.
 */
public void mergeChanges() throws IOException {
  final Path sourceDirectory=storagePathProvider.getUnmergedChangesPath();
  final Path targetDirectory=storagePathProvider.getStoragePathDirectory();
  Files.walkFileTree(sourceDirectory,new SimpleFileVisitor<Path>(){
    boolean atomicNotPossibleLogged;
    @Override public FileVisitResult preVisitDirectory(    Path sourceSubDir,    BasicFileAttributes attrs) throws IOException {
      Path targetSubDir=targetDirectory.resolve(sourceDirectory.relativize(sourceSubDir));
      if (!Files.isDirectory(targetSubDir)) {
        Files.createDirectory(targetSubDir);
      }
      return FileVisitResult.CONTINUE;
    }
    @Override public FileVisitResult visitFile(    Path sourcePath,    BasicFileAttributes attrs) throws IOException {
      Path targetPath=targetDirectory.resolve(sourceDirectory.relativize(sourcePath));
      try {
        Files.deleteIfExists(targetPath);
        Files.move(sourcePath,targetPath,StandardCopyOption.ATOMIC_MOVE);
      }
 catch (      AtomicMoveNotSupportedException e) {
        if (!atomicNotPossibleLogged) {
          logger.warn("String_Node_Str");
          atomicNotPossibleLogged=true;
        }
        Files.move(sourcePath,targetPath);
      }
      return FileVisitResult.CONTINUE;
    }
    @Override public FileVisitResult postVisitDirectory(    Path dir,    IOException exc) throws IOException {
      try {
        Files.delete(dir);
      }
 catch (      DirectoryNotEmptyException e) {
        logger.warn("String_Node_Str");
        try {
          Thread.sleep(1000L);
        }
 catch (        InterruptedException e1) {
          Thread.currentThread().interrupt();
        }
        Files.delete(dir);
      }
      return FileVisitResult.CONTINUE;
    }
  }
);
}