nus-yam/ex-repair huggingface dataset:
Program: 115923
Project: 115923
Buggy source:
/** 
 * Describe a tenant
 * @param domainName
 * @throws org.apache.stratos.cli.exception.CommandException
 */
public void describeTenant(final String domainName) throws CommandException {
  try {
    Type listType=new TypeToken<ArrayList<TenantInfoBean>>(){
    }
.getType();
    List<TenantInfoBean> tenantList=(List<TenantInfoBean>)restClient.listEntity(ENDPOINT_LIST_TENANTS,listType,"String_Node_Str");
    TenantInfoBean tenant=null;
    for (    TenantInfoBean item : tenantList) {
      if (item.getTenantDomain().equals(domainName)) {
        tenant=item;
        break;
      }
    }
    if (tenant == null) {
      System.out.println("String_Node_Str");
      return;
    }
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + tenant.getTenantDomain());
    System.out.println("String_Node_Str" + tenant.getTenantId());
    System.out.println("String_Node_Str" + tenant.getEmail());
    System.out.println("String_Node_Str" + tenant.isActive());
    System.out.println("String_Node_Str" + tenant.getCreatedDate());
  }
 catch (  Exception e) {
    String message="String_Node_Str" + domainName;
    printError(message,e);
  }
}

Fixed version (ground truth):
/** 
 * Describe a tenant
 * @param domainName
 * @throws org.apache.stratos.cli.exception.CommandException
 */
public void describeTenant(final String domainName) throws CommandException {
  try {
    Type listType=new TypeToken<ArrayList<TenantInfoBean>>(){
    }
.getType();
    List<TenantInfoBean> tenantList=(List<TenantInfoBean>)restClient.listEntity(ENDPOINT_LIST_TENANTS,listType,"String_Node_Str");
    TenantInfoBean tenant=null;
    for (    TenantInfoBean item : tenantList) {
      if (item.getTenantDomain().equals(domainName)) {
        tenant=item;
        break;
      }
    }
    if (tenant == null) {
      System.out.println("String_Node_Str");
      return;
    }
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + tenant.getTenantDomain());
    System.out.println("String_Node_Str" + tenant.getTenantId());
    System.out.println("String_Node_Str" + tenant.getEmail());
    System.out.println("String_Node_Str" + tenant.isActive());
    System.out.println("String_Node_Str" + new Date(tenant.getCreatedDate()));
  }
 catch (  Exception e) {
    String message="String_Node_Str" + domainName;
    printError(message,e);
  }
}
Program: 115924
Project: 115924
Buggy source:
/** 
 * List tenants by a partial domain serach
 * @throws org.apache.stratos.cli.exception.CommandException
 */
public void listTenantsByPartialDomain(String partialDomain) throws CommandException {
  try {
    Type listType=new TypeToken<ArrayList<TenantInfoBean>>(){
    }
.getType();
    List<TenantInfoBean> tenantList=(List<TenantInfoBean>)restClient.listEntity(ENDPOINT_LIST_TENANTS_BY_PARTIAL_DOMAIN.replace("String_Node_Str",partialDomain),listType,"String_Node_Str");
    if ((tenantList == null) || (tenantList.size() == 0)) {
      System.out.println("String_Node_Str");
      return;
    }
    RowMapper<TenantInfoBean> tenantMapper=new RowMapper<TenantInfoBean>(){
      public String[] getData(      TenantInfoBean tenant){
        String[] data=new String[5];
        data[0]=tenant.getTenantDomain();
        data[1]=String.valueOf(tenant.getTenantId());
        data[2]=String.valueOf(tenant.isActive());
        data[3]=tenant.getEmail();
        data[4]=String.valueOf(tenant.getCreatedDate());
        return data;
      }
    }
;
    TenantInfoBean[] tenants=new TenantInfoBean[tenantList.size()];
    tenants=tenantList.toArray(tenants);
    System.out.println("String_Node_Str");
    CliUtils.printTable(tenants,tenantMapper,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    String message="String_Node_Str";
    printError(message,e);
  }
}

Fixed version (ground truth):
/** 
 * List tenants by a partial domain serach
 * @throws org.apache.stratos.cli.exception.CommandException
 */
public void listTenantsByPartialDomain(String partialDomain) throws CommandException {
  try {
    Type listType=new TypeToken<ArrayList<TenantInfoBean>>(){
    }
.getType();
    List<TenantInfoBean> tenantList=(List<TenantInfoBean>)restClient.listEntity(ENDPOINT_LIST_TENANTS_BY_PARTIAL_DOMAIN.replace("String_Node_Str",partialDomain),listType,"String_Node_Str");
    if ((tenantList == null) || (tenantList.size() == 0)) {
      System.out.println("String_Node_Str");
      return;
    }
    RowMapper<TenantInfoBean> tenantMapper=new RowMapper<TenantInfoBean>(){
      public String[] getData(      TenantInfoBean tenant){
        String[] data=new String[5];
        data[0]=tenant.getTenantDomain();
        data[1]=String.valueOf(tenant.getTenantId());
        data[2]=String.valueOf(tenant.isActive());
        data[3]=tenant.getEmail();
        data[4]=new Date(tenant.getCreatedDate()).toString();
        return data;
      }
    }
;
    TenantInfoBean[] tenants=new TenantInfoBean[tenantList.size()];
    tenants=tenantList.toArray(tenants);
    System.out.println("String_Node_Str");
    CliUtils.printTable(tenants,tenantMapper,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    String message="String_Node_Str";
    printError(message,e);
  }
}
Program: 115925
Project: 115925
Buggy source:
/** 
 * Describe a tenant
 * @param domainName
 * @throws org.apache.stratos.cli.exception.CommandException
 */
public void describeTenant(final String domainName) throws CommandException {
  try {
    Type listType=new TypeToken<ArrayList<TenantInfoBean>>(){
    }
.getType();
    List<TenantInfoBean> tenantList=(List<TenantInfoBean>)restClient.listEntity(ENDPOINT_LIST_TENANTS,listType,"String_Node_Str");
    TenantInfoBean tenant=null;
    for (    TenantInfoBean item : tenantList) {
      if (item.getTenantDomain().equals(domainName)) {
        tenant=item;
        break;
      }
    }
    if (tenant == null) {
      System.out.println("String_Node_Str");
      return;
    }
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + tenant.getTenantDomain());
    System.out.println("String_Node_Str" + tenant.getTenantId());
    System.out.println("String_Node_Str" + tenant.getEmail());
    System.out.println("String_Node_Str" + tenant.isActive());
    System.out.println("String_Node_Str" + tenant.getCreatedDate());
  }
 catch (  Exception e) {
    String message="String_Node_Str" + domainName;
    printError(message,e);
  }
}

Fixed version (ground truth):
/** 
 * Describe a tenant
 * @param domainName
 * @throws org.apache.stratos.cli.exception.CommandException
 */
public void describeTenant(final String domainName) throws CommandException {
  try {
    Type listType=new TypeToken<ArrayList<TenantInfoBean>>(){
    }
.getType();
    List<TenantInfoBean> tenantList=(List<TenantInfoBean>)restClient.listEntity(ENDPOINT_LIST_TENANTS,listType,"String_Node_Str");
    TenantInfoBean tenant=null;
    for (    TenantInfoBean item : tenantList) {
      if (item.getTenantDomain().equals(domainName)) {
        tenant=item;
        break;
      }
    }
    if (tenant == null) {
      System.out.println("String_Node_Str");
      return;
    }
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + tenant.getTenantDomain());
    System.out.println("String_Node_Str" + tenant.getTenantId());
    System.out.println("String_Node_Str" + tenant.getEmail());
    System.out.println("String_Node_Str" + tenant.isActive());
    System.out.println("String_Node_Str" + new Date(tenant.getCreatedDate()));
  }
 catch (  Exception e) {
    String message="String_Node_Str" + domainName;
    printError(message,e);
  }
}
Program: 115926
Project: 115926
Buggy source:
/** 
 * List tenants by a partial domain serach
 * @throws org.apache.stratos.cli.exception.CommandException
 */
public void listTenantsByPartialDomain(String partialDomain) throws CommandException {
  try {
    Type listType=new TypeToken<ArrayList<TenantInfoBean>>(){
    }
.getType();
    List<TenantInfoBean> tenantList=(List<TenantInfoBean>)restClient.listEntity(ENDPOINT_LIST_TENANTS_BY_PARTIAL_DOMAIN.replace("String_Node_Str",partialDomain),listType,"String_Node_Str");
    if ((tenantList == null) || (tenantList.size() == 0)) {
      System.out.println("String_Node_Str");
      return;
    }
    RowMapper<TenantInfoBean> tenantMapper=new RowMapper<TenantInfoBean>(){
      public String[] getData(      TenantInfoBean tenant){
        String[] data=new String[5];
        data[0]=tenant.getTenantDomain();
        data[1]=String.valueOf(tenant.getTenantId());
        data[2]=String.valueOf(tenant.isActive());
        data[3]=tenant.getEmail();
        data[4]=String.valueOf(tenant.getCreatedDate());
        return data;
      }
    }
;
    TenantInfoBean[] tenants=new TenantInfoBean[tenantList.size()];
    tenants=tenantList.toArray(tenants);
    System.out.println("String_Node_Str");
    CliUtils.printTable(tenants,tenantMapper,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    String message="String_Node_Str";
    printError(message,e);
  }
}

Fixed version (ground truth):
/** 
 * List tenants by a partial domain serach
 * @throws org.apache.stratos.cli.exception.CommandException
 */
public void listTenantsByPartialDomain(String partialDomain) throws CommandException {
  try {
    Type listType=new TypeToken<ArrayList<TenantInfoBean>>(){
    }
.getType();
    List<TenantInfoBean> tenantList=(List<TenantInfoBean>)restClient.listEntity(ENDPOINT_LIST_TENANTS_BY_PARTIAL_DOMAIN.replace("String_Node_Str",partialDomain),listType,"String_Node_Str");
    if ((tenantList == null) || (tenantList.size() == 0)) {
      System.out.println("String_Node_Str");
      return;
    }
    RowMapper<TenantInfoBean> tenantMapper=new RowMapper<TenantInfoBean>(){
      public String[] getData(      TenantInfoBean tenant){
        String[] data=new String[5];
        data[0]=tenant.getTenantDomain();
        data[1]=String.valueOf(tenant.getTenantId());
        data[2]=String.valueOf(tenant.isActive());
        data[3]=tenant.getEmail();
        data[4]=new Date(tenant.getCreatedDate()).toString();
        return data;
      }
    }
;
    TenantInfoBean[] tenants=new TenantInfoBean[tenantList.size()];
    tenants=tenantList.toArray(tenants);
    System.out.println("String_Node_Str");
    CliUtils.printTable(tenants,tenantMapper,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    String message="String_Node_Str";
    printError(message,e);
  }
}
Program: 115927
Project: 115927
Buggy source:
@Override public List<String> getNextNetworkPartitions(NetworkPartitionAlgorithmContext networkPartitionAlgorithmContext){
  if (networkPartitionAlgorithmContext == null) {
    return null;
  }
  ApplicationPolicy applicationPolicy=networkPartitionAlgorithmContext.getApplicationPolicy();
  if (applicationPolicy == null) {
    return null;
  }
  String[] networkPartitions=applicationPolicy.getNetworkPartitions();
  if (networkPartitions == null || networkPartitions.length == 0) {
    return null;
  }
  int totalNetworkPartitions=networkPartitions.length;
  int currentPartitionIndex=networkPartitionAlgorithmContext.getCurrentNetworkPartitionIndex().intValue();
  if (currentPartitionIndex >= totalNetworkPartitions) {
    return null;
  }
  int selectedIndex=networkPartitionAlgorithmContext.getCurrentNetworkPartitionIndex().incrementAndGet();
  List<String> nextNetworkPartitions=new ArrayList<String>();
  nextNetworkPartitions.add(networkPartitions[selectedIndex]);
  return nextNetworkPartitions;
}

Fixed version (ground truth):
@Override public List<String> getNextNetworkPartitions(NetworkPartitionAlgorithmContext networkPartitionAlgorithmContext){
  if (networkPartitionAlgorithmContext == null) {
    return null;
  }
  ApplicationPolicy applicationPolicy=networkPartitionAlgorithmContext.getApplicationPolicy();
  if (applicationPolicy == null) {
    return null;
  }
  String[] networkPartitions=applicationPolicy.getNetworkPartitions();
  if (networkPartitions == null || networkPartitions.length == 0) {
    return null;
  }
  int totalNetworkPartitions=networkPartitions.length;
  int currentPartitionIndex=networkPartitionAlgorithmContext.getCurrentNetworkPartitionIndex().intValue();
  if (currentPartitionIndex >= totalNetworkPartitions) {
    return null;
  }
  int selectedIndex=networkPartitionAlgorithmContext.getCurrentNetworkPartitionIndex().incrementAndGet();
  List<String> nextNetworkPartitions=new ArrayList<String>();
  nextNetworkPartitions.add(networkPartitions[selectedIndex - 1]);
  return nextNetworkPartitions;
}
Program: 115928
Project: 115928
Buggy source:
/** 
 * Extract Subscription Information from the Application Definition
 * @param applicationContext ApplicationContext object with Application information
 * @return Map [cartridge alias -> Group]
 * @throws ApplicationDefinitionException if the Subscription information is invalid
 */
private Map<String,SubscribableInfoContext> getSubscribableInformation(ApplicationContext applicationContext) throws ApplicationDefinitionException {
  Map<String,SubscribableInfoContext> subscribableInfoContextMap=new HashMap<String,SubscribableInfoContext>();
  findSubscribableInfoOfCartridgeContexts(subscribableInfoContextMap,applicationContext);
  findSubscribableInfoOfGroupContexts(applicationContext.getApplicationId(),subscribableInfoContextMap,applicationContext.getComponents().getGroupContexts());
  return subscribableInfoContextMap;
}

Fixed version (ground truth):
/** 
 * Extract Subscription Information from the Application Definition
 * @param applicationContext ApplicationContext object with Application information
 * @return Map [cartridge alias -> Group]
 * @throws ApplicationDefinitionException if the Subscription information is invalid
 */
private Map<String,SubscribableInfoContext> getSubscribableInformation(ApplicationContext applicationContext) throws ApplicationDefinitionException {
  Map<String,SubscribableInfoContext> subscribableInfoContextMap=new HashMap<String,SubscribableInfoContext>();
  String applicationId=applicationContext.getApplicationId();
  ComponentContext componentContext=applicationContext.getComponents();
  if (componentContext != null) {
    CartridgeContext[] cartridgeContexts=componentContext.getCartridgeContexts();
    if (cartridgeContexts != null) {
      findSubscribableInfoOfCartridgeContexts(applicationId,subscribableInfoContextMap,cartridgeContexts);
    }
    GroupContext[] groupContexts=componentContext.getGroupContexts();
    if (groupContexts != null) {
      findSubscribableInfoOfGroupContexts(applicationId,subscribableInfoContextMap,groupContexts);
    }
  }
  return subscribableInfoContextMap;
}
Program: 115929
Project: 115929
Buggy source:
/** 
 * Find subscribable information in cartridge contexts
 * @param subscribableInfoContextMap Map to return subscribable information
 * @param applicationContext Application to read cartridge contexts
 * @return
 * @throws ApplicationDefinitionException
 */
private void findSubscribableInfoOfCartridgeContexts(Map<String,SubscribableInfoContext> subscribableInfoContextMap,ApplicationContext applicationContext) throws ApplicationDefinitionException {
  CartridgeContext[] cartridgeContexts=applicationContext.getComponents().getCartridgeContexts();
  if (cartridgeContexts != null) {
    for (    CartridgeContext cartridgeContext : cartridgeContexts) {
      if (cartridgeContext != null) {
        SubscribableInfoContext subscribableInfoContext=cartridgeContext.getSubscribableInfoContext();
        addSubscribableInfo(applicationContext.getApplicationId(),cartridgeContext.getType(),subscribableInfoContextMap,subscribableInfoContext);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Find subscribable information in cartridge contexts
 * @param applicationId TODO
 * @param subscribableInfoContextMap Map to return subscribable information
 * @param cartridgeContexts Application to read cartridge contexts
 * @return
 * @throws ApplicationDefinitionException
 */
private void findSubscribableInfoOfCartridgeContexts(String applicationId,Map<String,SubscribableInfoContext> subscribableInfoContextMap,CartridgeContext[] cartridgeContexts) throws ApplicationDefinitionException {
  if (cartridgeContexts != null) {
    for (    CartridgeContext cartridgeContext : cartridgeContexts) {
      if (cartridgeContext != null) {
        SubscribableInfoContext subscribableInfoContext=cartridgeContext.getSubscribableInfoContext();
        addSubscribableInfo(applicationId,cartridgeContext.getType(),subscribableInfoContextMap,subscribableInfoContext);
      }
    }
  }
}
Program: 115930
Project: 115930
Buggy source:
/** 
 * Get subscribable information of group contexts recursively.
 * @param subscribableInfoContextMap Map to return subscribable information
 * @param groupContexts Group contexts to read subscribable information
 * @return
 * @throws ApplicationDefinitionException
 */
private void findSubscribableInfoOfGroupContexts(String applicationId,Map<String,SubscribableInfoContext> subscribableInfoContextMap,GroupContext[] groupContexts) throws ApplicationDefinitionException {
  if (groupContexts != null) {
    for (    GroupContext groupContext : groupContexts) {
      if (groupContext.getGroupContexts() != null) {
        findSubscribableInfoOfGroupContexts(applicationId,subscribableInfoContextMap,groupContext.getGroupContexts());
      }
 else {
        CartridgeContext[] cartridgeContexts=groupContext.getCartridgeContexts();
        for (        CartridgeContext cartridgeContext : cartridgeContexts) {
          if (cartridgeContext != null) {
            SubscribableInfoContext subscribableInfoContext=cartridgeContext.getSubscribableInfoContext();
            addSubscribableInfo(applicationId,cartridgeContext.getType(),subscribableInfoContextMap,subscribableInfoContext);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Get subscribable information of group contexts recursively.
 * @param subscribableInfoContextMap Map to return subscribable information
 * @param groupContexts Group contexts to read subscribable information
 * @return
 * @throws ApplicationDefinitionException
 */
private void findSubscribableInfoOfGroupContexts(String applicationId,Map<String,SubscribableInfoContext> subscribableInfoContextMap,GroupContext[] groupContexts) throws ApplicationDefinitionException {
  if (groupContexts != null) {
    for (    GroupContext groupContext : groupContexts) {
      if (groupContext.getGroupContexts() != null) {
        findSubscribableInfoOfGroupContexts(applicationId,subscribableInfoContextMap,groupContext.getGroupContexts());
      }
      if (groupContext.getCartridgeContexts() != null) {
        findSubscribableInfoOfCartridgeContexts(applicationId,subscribableInfoContextMap,groupContext.getCartridgeContexts());
      }
    }
  }
}
Program: 115931
Project: 115931
Buggy source:
private static void getAliasToDeployloymentPolicyIdMapFromChildGroupContexts(Map<String,String> aliasToDeploymentPolicyIdMap,GroupContext[] groupContexts){
  if (groupContexts != null && groupContexts.length != 0) {
    for (    GroupContext groupContext : groupContexts) {
      if (groupContext != null) {
        if (groupContext.getDeploymentPolicy() == null || groupContext.getDeploymentPolicy().isEmpty()) {
          getAliasToDeployloymentPolicyIdMapFromChildCartridgeContexts(aliasToDeploymentPolicyIdMap,groupContext.getCartridgeContexts());
          getAliasToDeployloymentPolicyIdMapFromChildGroupContexts(aliasToDeploymentPolicyIdMap,groupContext.getGroupContexts());
        }
 else {
          String deploymentPolicyId=groupContext.getDeploymentPolicy();
          if (groupContext.getCartridgeContexts() != null && groupContext.getCartridgeContexts().length != 0) {
            setDeploymentPolicyIdToChildCartridgeContexts(aliasToDeploymentPolicyIdMap,deploymentPolicyId,groupContext.getCartridgeContexts());
          }
          if (groupContext.getGroupContexts() != null && groupContext.getGroupContexts().length != 0) {
            setDeploymentPolicyIdToChildGroupContexts(aliasToDeploymentPolicyIdMap,deploymentPolicyId,groupContext.getGroupContexts());
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private static void getAliasToDeployloymentPolicyIdMapFromChildGroupContexts(Map<String,String> aliasToDeploymentPolicyIdMap,GroupContext[] groupContexts){
  if (groupContexts != null && groupContexts.length != 0) {
    for (    GroupContext groupContext : groupContexts) {
      if (groupContext != null) {
        if (groupContext.getDeploymentPolicy() == null || groupContext.getDeploymentPolicy().isEmpty()) {
          getAliasToDeployloymentPolicyIdMapFromChildCartridgeContexts(aliasToDeploymentPolicyIdMap,groupContext.getCartridgeContexts());
          getAliasToDeployloymentPolicyIdMapFromChildGroupContexts(aliasToDeploymentPolicyIdMap,groupContext.getGroupContexts());
        }
 else {
          String deploymentPolicyId=groupContext.getDeploymentPolicy();
          aliasToDeploymentPolicyIdMap.put(groupContext.getAlias(),deploymentPolicyId);
          if (groupContext.getCartridgeContexts() != null && groupContext.getCartridgeContexts().length != 0) {
            setDeploymentPolicyIdToChildCartridgeContexts(aliasToDeploymentPolicyIdMap,deploymentPolicyId,groupContext.getCartridgeContexts());
          }
          if (groupContext.getGroupContexts() != null && groupContext.getGroupContexts().length != 0) {
            setDeploymentPolicyIdToChildGroupContexts(aliasToDeploymentPolicyIdMap,deploymentPolicyId,groupContext.getGroupContexts());
          }
        }
      }
    }
  }
}
Program: 115938
Project: 115938
Buggy source:
private PolicyManager(){
  DistributedObjectProvider distributedObjectProvider=ServiceReferenceHolder.getInstance().getDistributedObjectProvider();
  autoscalePolicyListMap=distributedObjectProvider.getMap(AS_POLICY_ID_TO_AUTOSCALE_POLICY_MAP);
  deploymentPolicyListMap=distributedObjectProvider.getMap(DEPLOYMENT_POLICY_ID_TO_DEPLOYMENT_POLICY_MAP);
  applicationPolicyListMap=distributedObjectProvider.getMap(DEPLOYMENT_POLICY_ID_TO_DEPLOYMENT_POLICY_MAP);
}

Fixed version (ground truth):
private PolicyManager(){
  DistributedObjectProvider distributedObjectProvider=ServiceReferenceHolder.getInstance().getDistributedObjectProvider();
  autoscalePolicyListMap=distributedObjectProvider.getMap(AS_POLICY_ID_TO_AUTOSCALE_POLICY_MAP);
  deploymentPolicyListMap=distributedObjectProvider.getMap(DEPLOYMENT_POLICY_ID_TO_DEPLOYMENT_POLICY_MAP);
  applicationPolicyListMap=distributedObjectProvider.getMap(APPLICATION_ID_TO_APPLICATION_POLICY_MAP);
}
Program: 115941
Project: 115941
Buggy source:
/** 
 * List domain mappings
 * @throws CommandException
 */
public void listDomainMappings(String applicationId){
  try {
    Type listType=new TypeToken<ArrayList<DomainMappingBean>>(){
    }
.getType();
    List<DomainMappingBean> list=(List<DomainMappingBean>)restClient.listEntity(ENDPOINT_DOMAIN_MAPPINGS.replace("String_Node_Str",applicationId),listType,"String_Node_Str");
    if ((list != null) && (list.size() > 0)) {
      System.out.println("String_Node_Str" + applicationId);
      return;
    }
    RowMapper<DomainMappingBean> rowMapper=new RowMapper<DomainMappingBean>(){
      public String[] getData(      DomainMappingBean domainMappingBean){
        String[] data=new String[3];
        data[0]=domainMappingBean.getCartridgeAlias();
        data[1]=domainMappingBean.getDomainName();
        data[2]=domainMappingBean.getContextPath();
        return data;
      }
    }
;
    DomainMappingBean[] array=new DomainMappingBean[list.size()];
    array=list.toArray(array);
    System.out.println("String_Node_Str" + applicationId);
    CliUtils.printTable(array,rowMapper,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    String message="String_Node_Str" + applicationId;
    printError(message,e);
  }
}

Fixed version (ground truth):
/** 
 * List domain mappings
 * @throws CommandException
 */
public void listDomainMappings(String applicationId){
  try {
    Type listType=new TypeToken<ArrayList<DomainMappingBean>>(){
    }
.getType();
    List<DomainMappingBean> list=(List<DomainMappingBean>)restClient.listEntity(ENDPOINT_DOMAIN_MAPPINGS.replace("String_Node_Str",applicationId),listType,"String_Node_Str");
    if ((list == null) && (list.size() <= 0)) {
      System.out.println("String_Node_Str" + applicationId);
      return;
    }
    RowMapper<DomainMappingBean> rowMapper=new RowMapper<DomainMappingBean>(){
      public String[] getData(      DomainMappingBean domainMappingBean){
        String[] data=new String[2];
        data[0]=domainMappingBean.getDomainName();
        data[1]=domainMappingBean.getContextPath();
        return data;
      }
    }
;
    DomainMappingBean[] array=new DomainMappingBean[list.size()];
    array=list.toArray(array);
    System.out.println("String_Node_Str" + applicationId);
    CliUtils.printTable(array,rowMapper,"String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    String message="String_Node_Str" + applicationId;
    printError(message,e);
  }
}
Program: 115943
Project: 115943
Buggy source:
/** 
 * Check if the specified member is in the topology and is in MemberStatus.Initialized state
 * @param serviceName
 * @param clusterId
 * @param memberId
 * @return true if member is present in the topology and in initialized state, false otherwise
 */
public static boolean checkTopologyConsistency(String serviceName,String clusterId,String memberId){
  Member activatedMember=getMemberFromTopology(serviceName,clusterId,memberId);
  if (activatedMember.getStatus() != MemberStatus.Initialized) {
    if (log.isErrorEnabled()) {
      log.error(String.format("String_Node_Str",memberId));
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Check if the specified member is in the topology and is in MemberStatus.Initialized state
 * @param serviceName
 * @param clusterId
 * @param memberId
 * @return true if member is present in the topology and in initialized state, false otherwise
 */
public static boolean checkTopologyConsistency(String serviceName,String clusterId,String memberId){
  Member activatedMember=getMemberFromTopology(serviceName,clusterId,memberId);
  if (activatedMember == null) {
    if (log.isErrorEnabled()) {
      log.error(String.format("String_Node_Str",memberId,clusterId,serviceName));
    }
    return false;
  }
  return true;
}
Program: 115944
Project: 115944
Buggy source:
private static void getAliasToDeployloymentPolicyIdMapFromChildGroupContexts(Map<String,String> aliasToDeploymentPolicyIdMap,GroupContext[] groupContexts){
  if (groupContexts != null && groupContexts.length != 0) {
    for (    GroupContext groupContext : groupContexts) {
      if (groupContext != null) {
        if (groupContext.getDeploymentPolicy() == null || groupContext.getDeploymentPolicy().isEmpty()) {
          getAliasToDeployloymentPolicyIdMapFromChildCartridgeContexts(aliasToDeploymentPolicyIdMap,groupContext.getCartridgeContexts());
          getAliasToDeployloymentPolicyIdMapFromChildGroupContexts(aliasToDeploymentPolicyIdMap,groupContext.getGroupContexts());
        }
 else {
          String deploymentPolicyId=groupContext.getDeploymentPolicy();
          if (groupContext.getCartridgeContexts() != null && groupContext.getCartridgeContexts().length != 0) {
            setDeploymentPolicyIdToChildCartridgeContexts(aliasToDeploymentPolicyIdMap,deploymentPolicyId,groupContext.getCartridgeContexts());
          }
          if (groupContext.getGroupContexts() != null && groupContext.getGroupContexts().length != 0) {
            setDeploymentPolicyIdToChildGroupContexts(aliasToDeploymentPolicyIdMap,deploymentPolicyId,groupContext.getGroupContexts());
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private static void getAliasToDeployloymentPolicyIdMapFromChildGroupContexts(Map<String,String> aliasToDeploymentPolicyIdMap,GroupContext[] groupContexts){
  if (groupContexts != null && groupContexts.length != 0) {
    for (    GroupContext groupContext : groupContexts) {
      if (groupContext != null) {
        if (groupContext.getDeploymentPolicy() == null || groupContext.getDeploymentPolicy().isEmpty()) {
          getAliasToDeployloymentPolicyIdMapFromChildCartridgeContexts(aliasToDeploymentPolicyIdMap,groupContext.getCartridgeContexts());
          getAliasToDeployloymentPolicyIdMapFromChildGroupContexts(aliasToDeploymentPolicyIdMap,groupContext.getGroupContexts());
        }
 else {
          String deploymentPolicyId=groupContext.getDeploymentPolicy();
          aliasToDeploymentPolicyIdMap.put(groupContext.getAlias(),deploymentPolicyId);
          if (groupContext.getCartridgeContexts() != null && groupContext.getCartridgeContexts().length != 0) {
            setDeploymentPolicyIdToChildCartridgeContexts(aliasToDeploymentPolicyIdMap,deploymentPolicyId,groupContext.getCartridgeContexts());
          }
          if (groupContext.getGroupContexts() != null && groupContext.getGroupContexts().length != 0) {
            setDeploymentPolicyIdToChildGroupContexts(aliasToDeploymentPolicyIdMap,deploymentPolicyId,groupContext.getGroupContexts());
          }
        }
      }
    }
  }
}
Program: 115948
Project: 115948
Buggy source:
/** 
 * List domain mappings
 * @throws CommandException
 */
public void listDomainMappings(String applicationId){
  try {
    Type listType=new TypeToken<ArrayList<DomainMappingBean>>(){
    }
.getType();
    List<DomainMappingBean> list=(List<DomainMappingBean>)restClient.listEntity(ENDPOINT_DOMAIN_MAPPINGS.replace("String_Node_Str",applicationId),listType,"String_Node_Str");
    if ((list != null) && (list.size() > 0)) {
      System.out.println("String_Node_Str" + applicationId);
      return;
    }
    RowMapper<DomainMappingBean> rowMapper=new RowMapper<DomainMappingBean>(){
      public String[] getData(      DomainMappingBean domainMappingBean){
        String[] data=new String[3];
        data[0]=domainMappingBean.getCartridgeAlias();
        data[1]=domainMappingBean.getDomainName();
        data[2]=domainMappingBean.getContextPath();
        return data;
      }
    }
;
    DomainMappingBean[] array=new DomainMappingBean[list.size()];
    array=list.toArray(array);
    System.out.println("String_Node_Str" + applicationId);
    CliUtils.printTable(array,rowMapper,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    String message="String_Node_Str" + applicationId;
    printError(message,e);
  }
}

Fixed version (ground truth):
/** 
 * List domain mappings
 * @throws CommandException
 */
public void listDomainMappings(String applicationId){
  try {
    Type listType=new TypeToken<ArrayList<DomainMappingBean>>(){
    }
.getType();
    List<DomainMappingBean> list=(List<DomainMappingBean>)restClient.listEntity(ENDPOINT_DOMAIN_MAPPINGS.replace("String_Node_Str",applicationId),listType,"String_Node_Str");
    if ((list == null) && (list.size() <= 0)) {
      System.out.println("String_Node_Str" + applicationId);
      return;
    }
    RowMapper<DomainMappingBean> rowMapper=new RowMapper<DomainMappingBean>(){
      public String[] getData(      DomainMappingBean domainMappingBean){
        String[] data=new String[2];
        data[0]=domainMappingBean.getDomainName();
        data[1]=domainMappingBean.getContextPath();
        return data;
      }
    }
;
    DomainMappingBean[] array=new DomainMappingBean[list.size()];
    array=list.toArray(array);
    System.out.println("String_Node_Str" + applicationId);
    CliUtils.printTable(array,rowMapper,"String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    String message="String_Node_Str" + applicationId;
    printError(message,e);
  }
}
Program: 115949
Project: 115949
Buggy source:
private PolicyManager(){
  DistributedObjectProvider distributedObjectProvider=ServiceReferenceHolder.getInstance().getDistributedObjectProvider();
  autoscalePolicyListMap=distributedObjectProvider.getMap(AS_POLICY_ID_TO_AUTOSCALE_POLICY_MAP);
  deploymentPolicyListMap=distributedObjectProvider.getMap(DEPLOYMENT_POLICY_ID_TO_DEPLOYMENT_POLICY_MAP);
  applicationPolicyListMap=distributedObjectProvider.getMap(DEPLOYMENT_POLICY_ID_TO_DEPLOYMENT_POLICY_MAP);
}

Fixed version (ground truth):
private PolicyManager(){
  DistributedObjectProvider distributedObjectProvider=ServiceReferenceHolder.getInstance().getDistributedObjectProvider();
  autoscalePolicyListMap=distributedObjectProvider.getMap(AS_POLICY_ID_TO_AUTOSCALE_POLICY_MAP);
  deploymentPolicyListMap=distributedObjectProvider.getMap(DEPLOYMENT_POLICY_ID_TO_DEPLOYMENT_POLICY_MAP);
  applicationPolicyListMap=distributedObjectProvider.getMap(APPLICATION_ID_TO_APPLICATION_POLICY_MAP);
}
Program: 115951
Project: 115951
Buggy source:
@Override public void onProcessComplete(int i){
  log.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onProcessComplete(int i){
  log.info(commandText + "String_Node_Str");
}
Program: 115952
Project: 115952
Buggy source:
/** 
 * Execute shell command
 * @param commandText
 */
private ByteArrayOutputStreamLocal executeCommand(String commandText,File workingDir){
  final ByteArrayOutputStreamLocal outputStream=new ByteArrayOutputStreamLocal();
  try {
    CommandLine commandline=CommandLine.parse(commandText);
    DefaultExecutor exec=new DefaultExecutor();
    exec.setWorkingDirectory(workingDir);
    if (workingDir != null) {
      exec.setWorkingDirectory(workingDir);
    }
    PumpStreamHandler streamHandler=new PumpStreamHandler(outputStream);
    exec.setStreamHandler(streamHandler);
    ExecuteWatchdog watchdog=new ExecuteWatchdog(TIMEOUT);
    exec.setWatchdog(watchdog);
    log.info("String_Node_Str" + commandText + (workingDir == null ? "String_Node_Str" : "String_Node_Str" + workingDir.getCanonicalPath()));
    exec.execute(commandline,new ExecuteResultHandler(){
      @Override public void onProcessComplete(      int i){
        log.info("String_Node_Str");
      }
      @Override public void onProcessFailed(      ExecuteException e){
        log.error("String_Node_Str",e);
      }
    }
);
    executorList.put(commandText,exec);
    return outputStream;
  }
 catch (  Exception e) {
    log.error(outputStream.toString(),e);
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Execute shell command
 * @param commandText
 */
private ByteArrayOutputStreamLocal executeCommand(final String commandText,File workingDir){
  final ByteArrayOutputStreamLocal outputStream=new ByteArrayOutputStreamLocal();
  try {
    CommandLine commandline=CommandLine.parse(commandText);
    DefaultExecutor exec=new DefaultExecutor();
    exec.setWorkingDirectory(workingDir);
    if (workingDir != null) {
      exec.setWorkingDirectory(workingDir);
    }
    PumpStreamHandler streamHandler=new PumpStreamHandler(outputStream);
    exec.setStreamHandler(streamHandler);
    ExecuteWatchdog watchdog=new ExecuteWatchdog(TIMEOUT);
    exec.setWatchdog(watchdog);
    log.info("String_Node_Str" + commandText + (workingDir == null ? "String_Node_Str" : "String_Node_Str" + workingDir.getCanonicalPath()));
    exec.execute(commandline,new ExecuteResultHandler(){
      @Override public void onProcessComplete(      int i){
        log.info(commandText + "String_Node_Str");
      }
      @Override public void onProcessFailed(      ExecuteException e){
        log.error(commandText + "String_Node_Str",e);
      }
    }
);
    executorList.put(commandText,exec);
    return outputStream;
  }
 catch (  Exception e) {
    log.error(outputStream.toString(),e);
    throw new RuntimeException(e);
  }
}
Program: 115953
Project: 115953
Buggy source:
@Override public void onProcessFailed(ExecuteException e){
  log.error("String_Node_Str",e);
}

Fixed version (ground truth):
@Override public void onProcessFailed(ExecuteException e){
  log.error(commandText + "String_Node_Str",e);
}
Program: 115954
Project: 115954
Buggy source:
@Override protected void onEvent(Event event){
  log.info("String_Node_Str");
  instanceActivated[0]=true;
}

Fixed version (ground truth):
@Override protected void onEvent(Event event){
  log.info("String_Node_Str");
  instanceActivated=true;
}
Program: 115955
Project: 115955
Buggy source:
@Before public void setup(){
  serverSocketList=new ArrayList<ServerSocket>();
  executorList=new HashMap<String,Executor>();
  agentHome=setupJavaAgent();
  ExecutorService executorService=StratosThreadPool.getExecutorService("String_Node_Str",5);
  TopologyEventReceiver topologyEventReceiver=new TopologyEventReceiver();
  topologyEventReceiver.setExecutorService(executorService);
  topologyEventReceiver.execute();
  InstanceStatusEventReceiver instanceStatusEventReceiver=new InstanceStatusEventReceiver();
  instanceStatusEventReceiver.setExecutorService(executorService);
  instanceStatusEventReceiver.execute();
  instanceStarted=new boolean[1];
  instanceStatusEventReceiver.addEventListener(new InstanceStartedEventListener(){
    @Override protected void onEvent(    Event event){
      log.info("String_Node_Str");
      instanceStarted[0]=true;
    }
  }
);
  instanceActivated=new boolean[1];
  instanceStatusEventReceiver.addEventListener(new InstanceActivatedEventListener(){
    @Override protected void onEvent(    Event event){
      log.info("String_Node_Str");
      instanceActivated[0]=true;
    }
  }
);
  startServerSocket(7711);
  log.info("String_Node_Str");
  String binPath=agentHome + "String_Node_Str";
  outputStream=executeCommand("String_Node_Str",new File(binPath));
}

Fixed version (ground truth):
@Before public void setup(){
  serverSocketList=new ArrayList<ServerSocket>();
  executorList=new HashMap<String,Executor>();
  String agentHome=setupJavaAgent();
  ExecutorService executorService=StratosThreadPool.getExecutorService("String_Node_Str",5);
  TopologyEventReceiver topologyEventReceiver=new TopologyEventReceiver();
  topologyEventReceiver.setExecutorService(executorService);
  topologyEventReceiver.execute();
  InstanceStatusEventReceiver instanceStatusEventReceiver=new InstanceStatusEventReceiver();
  instanceStatusEventReceiver.setExecutorService(executorService);
  instanceStatusEventReceiver.execute();
  instanceStarted=false;
  instanceStatusEventReceiver.addEventListener(new InstanceStartedEventListener(){
    @Override protected void onEvent(    Event event){
      log.info("String_Node_Str");
      instanceStarted=true;
    }
  }
);
  instanceActivated=false;
  instanceStatusEventReceiver.addEventListener(new InstanceActivatedEventListener(){
    @Override protected void onEvent(    Event event){
      log.info("String_Node_Str");
      instanceActivated=true;
    }
  }
);
  startServerSocket(7711);
  log.info("String_Node_Str");
  String binPath=agentHome + "String_Node_Str";
  outputStream=executeCommand("String_Node_Str",new File(binPath));
}
Program: 115958
Project: 115958
Buggy source:
public void delegateTerminate(ClusterLevelPartitionContext clusterMonitorPartitionContext,String memberId){
  try {
    if (clusterMonitorPartitionContext.activeMemberAvailable(memberId)) {
      log.info(String.format("String_Node_Str" + "String_Node_Str",memberId,clusterMonitorPartitionContext.getPartitionId(),clusterMonitorPartitionContext.getNetworkPartitionId()));
      clusterMonitorPartitionContext.moveActiveMemberToTerminationPendingMembers(memberId);
    }
 else     if (clusterMonitorPartitionContext.pendingMemberAvailable(memberId)) {
      log.info(String.format("String_Node_Str" + "String_Node_Str",memberId,clusterMonitorPartitionContext.getPartitionId(),clusterMonitorPartitionContext.getNetworkPartitionId()));
      clusterMonitorPartitionContext.movePendingMemberToObsoleteMembers(memberId);
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void delegateTerminate(ClusterLevelPartitionContext clusterMonitorPartitionContext,String memberId){
  try {
    if (clusterMonitorPartitionContext.activeMemberAvailable(memberId)) {
      log.info(String.format("String_Node_Str" + "String_Node_Str",memberId,clusterMonitorPartitionContext.getPartitionId(),clusterMonitorPartitionContext.getNetworkPartitionId()));
      clusterMonitorPartitionContext.moveActiveMemberToTerminationPendingMembers(memberId);
      clusterMonitorPartitionContext.removeMemberStatsContext(memberId);
    }
 else     if (clusterMonitorPartitionContext.pendingMemberAvailable(memberId)) {
      log.info(String.format("String_Node_Str" + "String_Node_Str",memberId,clusterMonitorPartitionContext.getPartitionId(),clusterMonitorPartitionContext.getNetworkPartitionId()));
      clusterMonitorPartitionContext.movePendingMemberToObsoleteMembers(memberId);
      clusterMonitorPartitionContext.removeMemberStatsContext(memberId);
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
}
Program: 115959
Project: 115959
Buggy source:
public HealthStatisticsNotifier(){
  this.statsPublisher=HealthStatisticsPublisherFactory.createHealthStatisticsPublisher(StatisticsPublisherType.WSO2CEP);
  String pluginFileName=System.getProperty("String_Node_Str");
  if (pluginFileName != null) {
    File pluginFile=new File(pluginFileName);
    if ((pluginFile != null) && (pluginFile.exists())) {
      List<Class> pluginClass=PluginLoader.loadPluginClassesFromJar(pluginFile,IHealthStatisticsReader.class);
      if (!pluginClass.isEmpty()) {
        try {
          log.trace("String_Node_Str" + pluginClass);
          this.statsReader=(IHealthStatisticsReader)pluginClass.get(0).newInstance();
        }
 catch (        InstantiationException e) {
          log.error("String_Node_Str" + pluginClass,e);
        }
catch (        IllegalAccessException e) {
          log.error("String_Node_Str" + pluginClass,e);
        }
      }
    }
 else {
      log.error("String_Node_Str" + pluginFileName + ((pluginFile == null) ? "String_Node_Str" : "String_Node_Str"));
    }
  }
  if (this.statsReader == null) {
    this.statsReader=new HealthStatisticsReader();
  }
  String interval=System.getProperty("String_Node_Str");
  if (interval != null) {
    statsPublisherInterval=Long.getLong(interval);
  }
}

Fixed version (ground truth):
public HealthStatisticsNotifier(){
  this.statsPublisher=HealthStatisticsPublisherFactory.createHealthStatisticsPublisher(StatisticsPublisherType.WSO2CEP);
  String pluginFileName=System.getProperty("String_Node_Str");
  if ((pluginFileName != null) && (pluginFileName.length() != 0)) {
    File pluginFile=new File(pluginFileName);
    if ((pluginFile != null) && (pluginFile.exists())) {
      List<Class> pluginClass=PluginLoader.loadPluginClassesFromJar(pluginFile,IHealthStatisticsReader.class);
      if (!pluginClass.isEmpty()) {
        try {
          log.trace("String_Node_Str" + pluginClass);
          this.statsReader=(IHealthStatisticsReader)pluginClass.get(0).newInstance();
        }
 catch (        InstantiationException e) {
          log.error("String_Node_Str" + pluginClass,e);
        }
catch (        IllegalAccessException e) {
          log.error("String_Node_Str" + pluginClass,e);
        }
      }
    }
 else {
      log.error("String_Node_Str" + pluginFileName + ((pluginFile == null) ? "String_Node_Str" : "String_Node_Str"));
    }
  }
  if (this.statsReader == null) {
    this.statsReader=new HealthStatisticsReader();
  }
  String interval=System.getProperty("String_Node_Str");
  if (interval != null) {
    statsPublisherInterval=Long.getLong(interval);
  }
}
Program: 115960
Project: 115960
Buggy source:
public void setDynamicPayload(List<NameValuePair> dynamicPayload){
  this.dynamicPayload=dynamicPayload;
}

Fixed version (ground truth):
public void setDynamicPayload(NameValuePair[] dynamicPayload){
  this.dynamicPayload=dynamicPayload;
}
Program: 115961
Project: 115961
Buggy source:
public List<NameValuePair> getDynamicPayload(){
  return dynamicPayload;
}

Fixed version (ground truth):
public NameValuePair[] getDynamicPayload(){
  return dynamicPayload;
}
Program: 115963
Project: 115963
Buggy source:
/** 
 * Prepare and returns environment variables for the given member.
 * @param clusterContext
 * @param memberContext
 * @return
 */
public static EnvironmentVariable[] prepareEnvironmentVariables(ClusterContext clusterContext,MemberContext memberContext){
  String kubernetesClusterId=clusterContext.getKubernetesClusterId();
  List<EnvironmentVariable> environmentVariables=new ArrayList<EnvironmentVariable>();
  List<NameValuePair> payload=memberContext.getDynamicPayload();
  if (payload != null) {
    for (    NameValuePair parameter : payload) {
      addToEnvironmentVariables(environmentVariables,parameter.getName(),parameter.getValue());
    }
  }
  Properties properties=memberContext.getProperties();
  if (properties != null) {
    for (    Property property : properties.getProperties()) {
      addToEnvironmentVariables(environmentVariables,property.getName(),property.getValue());
    }
  }
  addToEnvironmentVariables(environmentVariables,StratosConstants.KUBERNETES_CLUSTER_ID,kubernetesClusterId);
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",memberContext.getClusterId(),memberContext.getMemberId(),environmentVariables.toString()));
  }
  EnvironmentVariable[] array=new EnvironmentVariable[environmentVariables.size()];
  return environmentVariables.toArray(array);
}

Fixed version (ground truth):
/** 
 * Prepare and returns environment variables for the given member.
 * @param clusterContext
 * @param memberContext
 * @return
 */
public static EnvironmentVariable[] prepareEnvironmentVariables(ClusterContext clusterContext,MemberContext memberContext){
  String kubernetesClusterId=clusterContext.getKubernetesClusterId();
  List<EnvironmentVariable> environmentVariables=new ArrayList<EnvironmentVariable>();
  NameValuePair[] payload=memberContext.getDynamicPayload();
  if (payload != null && payload.length != 0) {
    for (    NameValuePair parameter : payload) {
      addToEnvironmentVariables(environmentVariables,parameter.getName(),parameter.getValue());
    }
  }
  Properties properties=memberContext.getProperties();
  if (properties != null) {
    for (    Property property : properties.getProperties()) {
      addToEnvironmentVariables(environmentVariables,property.getName(),property.getValue());
    }
  }
  addToEnvironmentVariables(environmentVariables,StratosConstants.KUBERNETES_CLUSTER_ID,kubernetesClusterId);
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",memberContext.getClusterId(),memberContext.getMemberId(),environmentVariables.toString()));
  }
  EnvironmentVariable[] array=new EnvironmentVariable[environmentVariables.size()];
  return environmentVariables.toArray(array);
}
Program: 115964
Project: 115964
Buggy source:
private String findClusterId(String applicationId,String alias){
  Applications applications=ApplicationManager.getApplications();
  if (applications == null) {
    throw new RuntimeException("String_Node_Str");
  }
  Application application=applications.getApplication(applicationId);
  if (application == null) {
    throw new RuntimeException(String.format("String_Node_Str",applicationId));
  }
  ClusterDataHolder clusterData=application.getClusterData(alias);
  if (clusterData == null) {
    for (    Group group : application.getGroups()) {
      clusterData=group.getClusterData(alias);
      if (clusterData != null) {
        break;
      }
    }
    if (clusterData == null) {
      throw new RuntimeException(String.format("String_Node_Str",applicationId,alias));
    }
  }
  return clusterData.getClusterId();
}

Fixed version (ground truth):
private String findClusterId(String applicationId,String alias){
  try {
    AutoscalerServiceClient autoscalerServiceClient=AutoscalerServiceClient.getInstance();
    return autoscalerServiceClient.findClusterId(applicationId,alias);
  }
 catch (  Exception e) {
    String message=String.format("String_Node_Str",applicationId,alias);
    log.error(message,e);
    throw new RuntimeException(message,e);
  }
}