Program: 188528
Project: 188528
Buggy source:
public static String executeRsyncAIP(AIP aip,boolean hasCompression,boolean syncHistory) throws CommandException {
  String dataTarget=RodaCoreFactory.getRodaConfigurationAsString("String_Node_Str","String_Node_Str","String_Node_Str");
  if (dataTarget == null) {
    return PROPERTIES_ERROR_MESSAGE;
  }
  List<String> rsyncCommand=addInitialCommandPart(hasCompression);
  Path sourceAipPath=RodaCoreFactory.getDataPath().resolve(RodaConstants.CORE_STORAGE_FOLDER).resolve(RodaConstants.STORAGE_CONTAINER_AIP).resolve(aip.getId());
  String targetAipPath=dataTarget + "String_Node_Str" + RodaConstants.CORE_STORAGE_FOLDER+ "String_Node_Str"+ RodaConstants.STORAGE_CONTAINER_AIP+ "String_Node_Str"+ aip.getId()+ "String_Node_Str";
  String ret;
  rsyncCommand.add(sourceAipPath + "String_Node_Str");
  rsyncCommand.add(targetAipPath);
  LOGGER.debug("String_Node_Str",rsyncCommand);
  ret=CommandUtility.execute(rsyncCommand);
  if (syncHistory) {
    Path sourceAipHistoryDataPath=RodaCoreFactory.getDataPath().resolve(RodaConstants.CORE_STORAGE_HISTORY_FOLDER).resolve(RodaConstants.STORAGE_HISTORY_CONTAINER_DATA).resolve(RodaConstants.STORAGE_CONTAINER_AIP).resolve(aip.getId());
    Path sourceAipHistoryMetadataPath=RodaCoreFactory.getDataPath().resolve(RodaConstants.CORE_STORAGE_HISTORY_FOLDER).resolve(RodaConstants.STORAGE_HISTORY_CONTAINER_METADATA).resolve(RodaConstants.STORAGE_CONTAINER_AIP).resolve(aip.getId());
    String targetAipHistoryDataPath=dataTarget + "String_Node_Str" + RodaConstants.CORE_STORAGE_HISTORY_FOLDER+ "String_Node_Str"+ RodaConstants.STORAGE_HISTORY_CONTAINER_DATA+ "String_Node_Str"+ RodaConstants.STORAGE_CONTAINER_AIP+ "String_Node_Str"+ aip.getId()+ "String_Node_Str";
    String targetAipHistoryMetadataPath=dataTarget + "String_Node_Str" + RodaConstants.CORE_STORAGE_HISTORY_FOLDER+ "String_Node_Str"+ RodaConstants.STORAGE_HISTORY_CONTAINER_METADATA+ "String_Node_Str"+ RodaConstants.STORAGE_CONTAINER_AIP+ "String_Node_Str"+ aip.getId()+ "String_Node_Str";
    List<String> rsyncHistoryDataCommand=addInitialCommandPart(hasCompression);
    rsyncHistoryDataCommand.add(sourceAipHistoryDataPath + "String_Node_Str");
    rsyncHistoryDataCommand.add(targetAipHistoryDataPath);
    LOGGER.debug("String_Node_Str",rsyncHistoryDataCommand);
    ret+=CommandUtility.execute(rsyncHistoryDataCommand);
    List<String> rsyncHistoryMetadataCommand=addInitialCommandPart(hasCompression);
    rsyncHistoryMetadataCommand.add(sourceAipHistoryMetadataPath + "String_Node_Str");
    rsyncHistoryMetadataCommand.add(targetAipHistoryMetadataPath);
    LOGGER.debug("String_Node_Str",rsyncHistoryMetadataCommand);
    ret+=CommandUtility.execute(rsyncHistoryMetadataCommand);
  }
  return ret;
}

Fixed version (ground truth):
public static String executeRsyncAIP(AIP aip,boolean hasCompression) throws CommandException {
  String dataTarget=RodaCoreFactory.getRodaConfigurationAsString("String_Node_Str","String_Node_Str","String_Node_Str");
  if (dataTarget == null) {
    return PROPERTIES_ERROR_MESSAGE;
  }
  List<String> rsyncCommand=addInitialCommandPart(hasCompression);
  Path sourceAipPath=RodaCoreFactory.getDataPath().resolve(RodaConstants.CORE_STORAGE_FOLDER).resolve(RodaConstants.STORAGE_CONTAINER_AIP).resolve(aip.getId());
  String targetAipPath=dataTarget + RodaConstants.CORE_STORAGE_FOLDER + "String_Node_Str"+ RodaConstants.STORAGE_CONTAINER_AIP+ "String_Node_Str"+ aip.getId()+ "String_Node_Str";
  StringBuilder ret=new StringBuilder();
  if (Files.exists(sourceAipPath)) {
    rsyncCommand.add(sourceAipPath + "String_Node_Str");
    rsyncCommand.add(targetAipPath);
    String output=CommandUtility.execute(rsyncCommand);
    ret.append("String_Node_Str").append(StringUtils.join(rsyncCommand,"String_Node_Str")).append("String_Node_Str");
    ret.append(output);
  }
  Path sourceAipHistoryDataPath=RodaCoreFactory.getDataPath().resolve(RodaConstants.CORE_STORAGE_HISTORY_FOLDER).resolve(RodaConstants.STORAGE_HISTORY_CONTAINER_DATA).resolve(RodaConstants.STORAGE_CONTAINER_AIP).resolve(aip.getId());
  String targetAipHistoryDataPath=dataTarget + RodaConstants.CORE_STORAGE_HISTORY_FOLDER + "String_Node_Str"+ RodaConstants.STORAGE_HISTORY_CONTAINER_DATA+ "String_Node_Str"+ RodaConstants.STORAGE_CONTAINER_AIP+ "String_Node_Str"+ aip.getId()+ "String_Node_Str";
  if (Files.exists(sourceAipHistoryDataPath)) {
    List<String> rsyncHistoryDataCommand=addInitialCommandPart(hasCompression);
    rsyncHistoryDataCommand.add(sourceAipHistoryDataPath + "String_Node_Str");
    rsyncHistoryDataCommand.add(targetAipHistoryDataPath);
    String output=CommandUtility.execute(rsyncHistoryDataCommand);
    ret.append("String_Node_Str").append(StringUtils.join(rsyncHistoryDataCommand,"String_Node_Str")).append("String_Node_Str");
    ret.append(output);
  }
 else {
  }
  Path sourceAipHistoryMetadataPath=RodaCoreFactory.getDataPath().resolve(RodaConstants.CORE_STORAGE_HISTORY_FOLDER).resolve(RodaConstants.STORAGE_HISTORY_CONTAINER_METADATA).resolve(RodaConstants.STORAGE_CONTAINER_AIP).resolve(aip.getId());
  String targetAipHistoryMetadataPath=dataTarget + RodaConstants.CORE_STORAGE_HISTORY_FOLDER + "String_Node_Str"+ RodaConstants.STORAGE_HISTORY_CONTAINER_METADATA+ "String_Node_Str"+ RodaConstants.STORAGE_CONTAINER_AIP+ "String_Node_Str"+ aip.getId()+ "String_Node_Str";
  if (Files.exists(sourceAipHistoryMetadataPath)) {
    List<String> rsyncHistoryMetadataCommand=addInitialCommandPart(hasCompression);
    rsyncHistoryMetadataCommand.add(sourceAipHistoryMetadataPath + "String_Node_Str");
    rsyncHistoryMetadataCommand.add(targetAipHistoryMetadataPath);
    String output=CommandUtility.execute(rsyncHistoryMetadataCommand);
    ret.append("String_Node_Str").append(StringUtils.join(rsyncHistoryMetadataCommand,"String_Node_Str")).append("String_Node_Str");
    ret.append(output);
  }
 else {
  }
  return ret.toString();
}