Program: 114918
Project: 114918
Buggy source:
private void migrateLifeCycles() throws APIMigrationException {
  log.info("String_Node_Str");
  String apiLifeCycleXMLPath=CarbonUtils.getCarbonHome() + File.separator + APIConstants.RESOURCE_FOLDER_LOCATION+ File.separator+ Constants.LIFE_CYCLES_FOLDER+ File.separator+ APIConstants.API_LIFE_CYCLE+ "String_Node_Str";
  String executorlessApiLifeCycle=null;
  String apiLifeCycle=null;
  try (FileInputStream fileInputStream=new FileInputStream(new File(apiLifeCycleXMLPath))){
    apiLifeCycle=IOUtils.toString(fileInputStream);
    executorlessApiLifeCycle=ResourceModifier.removeExecutorsFromAPILifeCycle(apiLifeCycle);
  }
 catch (  FileNotFoundException e) {
    ResourceUtil.handleException("String_Node_Str" + apiLifeCycleXMLPath + "String_Node_Str",e);
  }
catch (  IOException e) {
    ResourceUtil.handleException("String_Node_Str" + apiLifeCycleXMLPath,e);
  }
  final String apiLifeCycleRegistryPath=RegistryConstants.LIFECYCLE_CONFIGURATION_PATH + APIConstants.API_LIFE_CYCLE;
  for (  Tenant tenant : getTenantsArray()) {
    log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
    try {
      registryService.startTenantFlow(tenant);
      addExecutorlessLifeCycle(tenant,apiLifeCycleRegistryPath,executorlessApiLifeCycle);
      updateApiLifeCycleStatus(tenant);
      updateWithCompleteLifeCycle(tenant,apiLifeCycleRegistryPath,apiLifeCycle);
    }
  finally {
      registryService.endTenantFlow();
    }
    log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
  }
  log.info("String_Node_Str");
}

Fixed version (ground truth):
private void migrateLifeCycles() throws APIMigrationException {
  log.info("String_Node_Str");
  String apiLifeCycleXMLPath=CarbonUtils.getCarbonHome() + File.separator + APIConstants.RESOURCE_FOLDER_LOCATION+ File.separator+ Constants.LIFE_CYCLES_FOLDER+ File.separator+ APIConstants.API_LIFE_CYCLE+ "String_Node_Str";
  String executorlessApiLifeCycle=null;
  String apiLifeCycle=null;
  try (FileInputStream fileInputStream=new FileInputStream(new File(apiLifeCycleXMLPath))){
    apiLifeCycle=IOUtils.toString(fileInputStream);
    executorlessApiLifeCycle=ResourceModifier.removeExecutorsFromAPILifeCycle(apiLifeCycle);
  }
 catch (  FileNotFoundException e) {
    ResourceUtil.handleException("String_Node_Str" + apiLifeCycleXMLPath + "String_Node_Str",e);
  }
catch (  IOException e) {
    ResourceUtil.handleException("String_Node_Str" + apiLifeCycleXMLPath,e);
  }
  final String apiLifeCycleRegistryPath=RegistryConstants.LIFECYCLE_CONFIGURATION_PATH + APIConstants.API_LIFE_CYCLE;
  for (  Tenant tenant : getTenantsArray()) {
    log.info("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
    try {
      registryService.startTenantFlow(tenant);
      addExecutorlessLifeCycle(tenant,apiLifeCycleRegistryPath,executorlessApiLifeCycle);
      updateApiLifeCycleStatus(tenant);
      updateWithCompleteLifeCycle(tenant,apiLifeCycleRegistryPath,apiLifeCycle);
    }
  finally {
      registryService.endTenantFlow();
    }
    log.info("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
  }
  log.info("String_Node_Str");
}