Program: 188402
Project: 188402
Buggy source:
/** 
 * Moves a directory/file from one path to another
 * @param sourcePath source path
 * @param targetPath target path
 * @param replaceExisting true if the target directory/file should be replaced if it already exists; false otherwise
 * @throws AlreadyExistsException
 * @throws GenericException
 * @throws NotFoundException
 */
public static void move(final Path sourcePath,final Path targetPath,boolean replaceExisting) throws AlreadyExistsException, GenericException, NotFoundException {
  if (!replaceExisting && FSUtils.exists(targetPath)) {
    throw new AlreadyExistsException("String_Node_Str" + targetPath);
  }
  try {
    Files.createDirectories(targetPath.getParent());
  }
 catch (  FileAlreadyExistsException e) {
  }
catch (  IOException e) {
    throw new GenericException("String_Node_Str",e);
  }
  CopyOption[] copyOptions=replaceExisting ? new CopyOption[]{StandardCopyOption.REPLACE_EXISTING} : new CopyOption[]{};
  if (FSUtils.isDirectory(sourcePath)) {
    try {
      Files.move(sourcePath,targetPath,copyOptions);
    }
 catch (    DirectoryNotEmptyException e) {
      LOGGER.debug("String_Node_Str",sourcePath,targetPath);
      moveRecursively(sourcePath,targetPath,replaceExisting);
    }
catch (    IOException e) {
      throw new GenericException("String_Node_Str" + sourcePath + "String_Node_Str"+ targetPath,e);
    }
  }
 else {
    try {
      Files.move(sourcePath,targetPath,copyOptions);
    }
 catch (    NoSuchFileException e) {
      throw new NotFoundException("String_Node_Str",e);
    }
catch (    IOException e) {
      throw new GenericException("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Moves a directory/file from one path to another
 * @param sourcePath source path
 * @param targetPath target path
 * @param replaceExisting true if the target directory/file should be replaced if it already exists; false otherwise
 * @throws AlreadyExistsException
 * @throws GenericException
 * @throws NotFoundException
 */
public static void move(final Path sourcePath,final Path targetPath,boolean replaceExisting) throws AlreadyExistsException, GenericException, NotFoundException {
  if (!replaceExisting && FSUtils.exists(targetPath)) {
    throw new AlreadyExistsException("String_Node_Str" + targetPath);
  }
  try {
    if (targetPath != null) {
      Files.createDirectories(targetPath.getParent());
    }
  }
 catch (  FileAlreadyExistsException e) {
  }
catch (  IOException e) {
    throw new GenericException("String_Node_Str",e);
  }
  CopyOption[] copyOptions=replaceExisting ? new CopyOption[]{StandardCopyOption.REPLACE_EXISTING} : new CopyOption[]{};
  if (FSUtils.isDirectory(sourcePath)) {
    try {
      Files.move(sourcePath,targetPath,copyOptions);
    }
 catch (    DirectoryNotEmptyException e) {
      LOGGER.debug("String_Node_Str",sourcePath,targetPath);
      moveRecursively(sourcePath,targetPath,replaceExisting);
    }
catch (    IOException e) {
      throw new GenericException("String_Node_Str" + sourcePath + "String_Node_Str"+ targetPath,e);
    }
  }
 else {
    try {
      Files.move(sourcePath,targetPath,copyOptions);
    }
 catch (    NoSuchFileException e) {
      throw new NotFoundException("String_Node_Str",e);
    }
catch (    IOException e) {
      throw new GenericException("String_Node_Str",e);
    }
  }
}