Program: 114919
Project: 114919
Buggy source:
/** 
 * This method is used to migrate rxt and rxt data This adds three new attributes to the api rxt
 * @throws APIMigrationException
 */
private void rxtMigration() throws APIMigrationException {
  log.info("String_Node_Str");
  String rxtName="String_Node_Str";
  String rxtDir=CarbonUtils.getCarbonHome() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ rxtName;
  for (  Tenant tenant : getTenantsArray()) {
    try {
      registryService.startTenantFlow(tenant);
      log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
      String rxt=FileUtil.readFileToString(rxtDir);
      registryService.updateRXTResource(rxtName,rxt);
      log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
      log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
      GenericArtifact[] artifacts=registryService.getGenericAPIArtifacts();
      for (      GenericArtifact artifact : artifacts) {
        artifact.setAttribute("String_Node_Str","String_Node_Str");
      }
      registryService.updateGenericAPIArtifacts(artifacts);
      log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
    }
 catch (    GovernanceException e) {
      log.error("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')',e);
    }
catch (    IOException e) {
      log.error("String_Node_Str" + rxtDir + "String_Node_Str"+ tenant.getId()+ '('+ tenant.getDomain()+ ')',e);
    }
catch (    org.wso2.carbon.registry.core.exceptions.RegistryException e) {
      log.error("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')',e);
    }
catch (    UserStoreException e) {
      log.error("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')',e);
    }
 finally {
      registryService.endTenantFlow();
    }
  }
  log.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * This method is used to migrate rxt and rxt data This adds three new attributes to the api rxt
 * @throws APIMigrationException
 */
private void rxtMigration() throws APIMigrationException {
  log.info("String_Node_Str");
  String rxtName="String_Node_Str";
  String rxtDir=CarbonUtils.getCarbonHome() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ rxtName;
  for (  Tenant tenant : getTenantsArray()) {
    try {
      registryService.startTenantFlow(tenant);
      log.info("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
      String rxt=FileUtil.readFileToString(rxtDir);
      registryService.updateRXTResource(rxtName,rxt);
      log.info("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
      log.info("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
      GenericArtifact[] artifacts=registryService.getGenericAPIArtifacts();
      for (      GenericArtifact artifact : artifacts) {
        artifact.setAttribute("String_Node_Str","String_Node_Str");
      }
      registryService.updateGenericAPIArtifacts(artifacts);
      log.info("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
    }
 catch (    GovernanceException e) {
      log.error("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')',e);
    }
catch (    IOException e) {
      log.error("String_Node_Str" + rxtDir + "String_Node_Str"+ tenant.getId()+ '('+ tenant.getDomain()+ ')',e);
    }
catch (    org.wso2.carbon.registry.core.exceptions.RegistryException e) {
      log.error("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')',e);
    }
catch (    UserStoreException e) {
      log.error("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')',e);
    }
 finally {
      registryService.endTenantFlow();
    }
  }
  log.info("String_Node_Str");
}