Program: 114788
Project: 114788
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.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) {
        String val="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
        artifact.setAttribute("String_Node_Str",val);
        artifact.setAttribute("String_Node_Str","String_Node_Str");
        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");
}

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) {
        String val="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
        artifact.setAttribute("String_Node_Str",val);
        artifact.setAttribute("String_Node_Str","String_Node_Str");
        artifact.setAttribute("String_Node_Str","String_Node_Str");
        String env=artifact.getAttribute("String_Node_Str");
        if (env == null) {
          artifact.setAttribute("String_Node_Str","String_Node_Str");
        }
        String trans=artifact.getAttribute("String_Node_Str");
        if (trans == null) {
          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");
}