nus-yam/ex-repair huggingface dataset:
Program: 116246
Project: 116246
Buggy source:
public static void deployAutoscalingPolicy(AutoscalePolicy autoscalePolicyBean) throws RestAPIException {
  log.info(String.format("String_Node_Str",autoscalePolicyBean.getId()));
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    org.apache.stratos.autoscaler.stub.policy.model.AutoscalePolicy autoscalePolicy=PojoConverter.convertToCCAutoscalerPojo(autoscalePolicyBean);
    try {
      autoscalerServiceClient.deployAutoscalingPolicy(autoscalePolicy);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceInvalidPolicyExceptionException e) {
      String message=e.getFaultMessage().getInvalidPolicyException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
}

Fixed version (ground truth):
public static void deployAutoscalingPolicy(AutoscalePolicy autoscalePolicyBean) throws RestAPIException {
  log.info(String.format("String_Node_Str",autoscalePolicyBean.getId()));
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy autoscalePolicy=PojoConverter.convertToCCAutoscalerPojo(autoscalePolicyBean);
    try {
      autoscalerServiceClient.deployAutoscalingPolicy(autoscalePolicy);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceInvalidPolicyExceptionException e) {
      String message=e.getFaultMessage().getInvalidPolicyException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
}
Program: 116247
Project: 116247
Buggy source:
public static boolean updateKubernetesMaster(KubernetesMaster kubernetesMasterBean) throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    org.apache.stratos.autoscaler.stub.kubernetes.KubernetesMaster kubernetesMaster=PojoConverter.convertToASKubernetesMasterPojo(kubernetesMasterBean);
    try {
      return autoscalerServiceClient.updateKubernetesMaster(kubernetesMaster);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceInvalidKubernetesMasterExceptionException e) {
      String message=e.getFaultMessage().getInvalidKubernetesMasterException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
catch (    AutoScalerServiceNonExistingKubernetesMasterExceptionException e) {
      String message=e.getFaultMessage().getNonExistingKubernetesMasterException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean updateKubernetesMaster(KubernetesMaster kubernetesMasterBean) throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    org.apache.stratos.common.kubernetes.KubernetesMaster kubernetesMaster=PojoConverter.convertToASKubernetesMasterPojo(kubernetesMasterBean);
    try {
      return autoscalerServiceClient.updateKubernetesMaster(kubernetesMaster);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceInvalidKubernetesMasterExceptionException e) {
      String message=e.getFaultMessage().getInvalidKubernetesMasterException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
catch (    AutoScalerServiceNonExistingKubernetesMasterExceptionException e) {
      String message=e.getFaultMessage().getNonExistingKubernetesMasterException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
  return false;
}
Program: 116248
Project: 116248
Buggy source:
public static KubernetesHost[] getKubernetesHosts(String kubernetesGroupId) throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    try {
      org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost[] kubernetesHosts=autoscalerServiceClient.getKubernetesHosts(kubernetesGroupId);
      List<KubernetesHost> arrayList=PojoConverter.populateKubernetesHostsPojo(kubernetesHosts);
      KubernetesHost[] array=new KubernetesHost[arrayList.size()];
      array=arrayList.toArray(array);
      return array;
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceNonExistingKubernetesGroupExceptionException e) {
      String message=e.getFaultMessage().getNonExistingKubernetesGroupException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
  return null;
}

Fixed version (ground truth):
public static KubernetesHost[] getKubernetesHosts(String kubernetesGroupId) throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    try {
      org.apache.stratos.common.kubernetes.KubernetesHost[] kubernetesHosts=autoscalerServiceClient.getKubernetesHosts(kubernetesGroupId);
      List<KubernetesHost> arrayList=PojoConverter.populateKubernetesHostsPojo(kubernetesHosts);
      KubernetesHost[] array=new KubernetesHost[arrayList.size()];
      array=arrayList.toArray(array);
      return array;
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceNonExistingKubernetesGroupExceptionException e) {
      String message=e.getFaultMessage().getNonExistingKubernetesGroupException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
  return null;
}
Program: 116249
Project: 116249
Buggy source:
public static boolean deployKubernetesGroup(KubernetesGroup kubernetesGroupBean) throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup kubernetesGroup=PojoConverter.convertToASKubernetesGroupPojo(kubernetesGroupBean);
    try {
      return autoscalerServiceClient.deployKubernetesGroup(kubernetesGroup);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceInvalidKubernetesGroupExceptionException e) {
      String message=e.getFaultMessage().getInvalidKubernetesGroupException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean deployKubernetesGroup(KubernetesGroup kubernetesGroupBean) throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    org.apache.stratos.common.kubernetes.KubernetesGroup kubernetesGroup=PojoConverter.convertToASKubernetesGroupPojo(kubernetesGroupBean);
    try {
      return autoscalerServiceClient.deployKubernetesGroup(kubernetesGroup);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceInvalidKubernetesGroupExceptionException e) {
      String message=e.getFaultMessage().getInvalidKubernetesGroupException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
  return false;
}
Program: 116250
Project: 116250
Buggy source:
public static boolean deployKubernetesHost(String kubernetesGroupId,KubernetesHost kubernetesHostBean) throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost kubernetesHost=PojoConverter.convertToASKubernetesHostPojo(kubernetesHostBean);
    try {
      return autoscalerServiceClient.deployKubernetesHost(kubernetesGroupId,kubernetesHost);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceInvalidKubernetesHostExceptionException e) {
      String message=e.getFaultMessage().getInvalidKubernetesHostException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
catch (    AutoScalerServiceNonExistingKubernetesGroupExceptionException e) {
      String message=e.getFaultMessage().getNonExistingKubernetesGroupException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean deployKubernetesHost(String kubernetesGroupId,KubernetesHost kubernetesHostBean) throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    org.apache.stratos.common.kubernetes.KubernetesHost kubernetesHost=PojoConverter.convertToASKubernetesHostPojo(kubernetesHostBean);
    try {
      return autoscalerServiceClient.deployKubernetesHost(kubernetesGroupId,kubernetesHost);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceInvalidKubernetesHostExceptionException e) {
      String message=e.getFaultMessage().getInvalidKubernetesHostException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
catch (    AutoScalerServiceNonExistingKubernetesGroupExceptionException e) {
      String message=e.getFaultMessage().getNonExistingKubernetesGroupException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
  return false;
}
Program: 116251
Project: 116251
Buggy source:
public static void updateAutoscalingPolicy(AutoscalePolicy autoscalePolicyBean) throws RestAPIException {
  log.info(String.format("String_Node_Str",autoscalePolicyBean.getId()));
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    org.apache.stratos.autoscaler.stub.policy.model.AutoscalePolicy autoscalePolicy=PojoConverter.convertToCCAutoscalerPojo(autoscalePolicyBean);
    try {
      autoscalerServiceClient.updateAutoscalingPolicy(autoscalePolicy);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceInvalidPolicyExceptionException e) {
      String message=e.getFaultMessage().getInvalidPolicyException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
}

Fixed version (ground truth):
public static void updateAutoscalingPolicy(AutoscalePolicy autoscalePolicyBean) throws RestAPIException {
  log.info(String.format("String_Node_Str",autoscalePolicyBean.getId()));
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy autoscalePolicy=PojoConverter.convertToCCAutoscalerPojo(autoscalePolicyBean);
    try {
      autoscalerServiceClient.updateAutoscalingPolicy(autoscalePolicy);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceInvalidPolicyExceptionException e) {
      String message=e.getFaultMessage().getInvalidPolicyException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
}
Program: 116252
Project: 116252
Buggy source:
public static KubernetesGroup[] getAvailableKubernetesGroups() throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    try {
      org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup[] kubernetesGroups=autoscalerServiceClient.getAvailableKubernetesGroups();
      return PojoConverter.populateKubernetesGroupsPojo(kubernetesGroups);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
  }
  return null;
}

Fixed version (ground truth):
public static KubernetesGroup[] getAvailableKubernetesGroups() throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    try {
      org.apache.stratos.common.kubernetes.KubernetesGroup[] kubernetesGroups=autoscalerServiceClient.getAvailableKubernetesGroups();
      return PojoConverter.populateKubernetesGroupsPojo(kubernetesGroups);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
  }
  return null;
}
Program: 116253
Project: 116253
Buggy source:
public static AutoscalePolicy getAutoScalePolicy(String autoscalePolicyId) throws RestAPIException {
  org.apache.stratos.autoscaler.stub.policy.model.AutoscalePolicy autoscalePolicy=null;
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    try {
      autoscalePolicy=autoscalerServiceClient.getAutoScalePolicy(autoscalePolicyId);
    }
 catch (    RemoteException e) {
      String errorMsg="String_Node_Str" + autoscalePolicyId + "String_Node_Str"+ e.getMessage();
      log.error(errorMsg,e);
      throw new RestAPIException(errorMsg,e);
    }
  }
  return PojoConverter.populateAutoscalePojo(autoscalePolicy);
}

Fixed version (ground truth):
public static AutoscalePolicy getAutoScalePolicy(String autoscalePolicyId) throws RestAPIException {
  org.apache.stratos.autoscaler.stub.autoscale.policy.AutoscalePolicy autoscalePolicy=null;
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    try {
      autoscalePolicy=autoscalerServiceClient.getAutoScalePolicy(autoscalePolicyId);
    }
 catch (    RemoteException e) {
      String errorMsg="String_Node_Str" + autoscalePolicyId + "String_Node_Str"+ e.getMessage();
      log.error(errorMsg,e);
      throw new RestAPIException(errorMsg,e);
    }
  }
  return PojoConverter.populateAutoscalePojo(autoscalePolicy);
}
Program: 116254
Project: 116254
Buggy source:
public static void deployDeploymentPolicy(org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy deploymentPolicyBean) throws RestAPIException {
  log.info(String.format("String_Node_Str",deploymentPolicyBean.getId()));
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    org.apache.stratos.autoscaler.stub.policy.model.DeploymentPolicy deploymentPolicy=PojoConverter.convetToCCDeploymentPolicyPojo(deploymentPolicyBean);
    try {
      autoscalerServiceClient.deployDeploymentPolicy(deploymentPolicy);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceInvalidPolicyExceptionException e) {
      String message=e.getFaultMessage().getInvalidPolicyException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
}

Fixed version (ground truth):
public static void deployDeploymentPolicy(org.apache.stratos.rest.endpoint.bean.autoscaler.policy.deployment.DeploymentPolicy deploymentPolicyBean) throws RestAPIException {
  log.info(String.format("String_Node_Str",deploymentPolicyBean.getId()));
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy deploymentPolicy=PojoConverter.convetToCCDeploymentPolicyPojo(deploymentPolicyBean);
    try {
      autoscalerServiceClient.deployDeploymentPolicy(deploymentPolicy);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceInvalidPolicyExceptionException e) {
      String message=e.getFaultMessage().getInvalidPolicyException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
}
Program: 116255
Project: 116255
Buggy source:
public static KubernetesGroup getKubernetesGroup(String kubernetesGroupId) throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    try {
      org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup kubernetesGroup=autoscalerServiceClient.getKubernetesGroup(kubernetesGroupId);
      return PojoConverter.populateKubernetesGroupPojo(kubernetesGroup);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceNonExistingKubernetesGroupExceptionException e) {
      String message=e.getFaultMessage().getNonExistingKubernetesGroupException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
  return null;
}

Fixed version (ground truth):
public static KubernetesGroup getKubernetesGroup(String kubernetesGroupId) throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    try {
      org.apache.stratos.common.kubernetes.KubernetesGroup kubernetesGroup=autoscalerServiceClient.getKubernetesGroup(kubernetesGroupId);
      return PojoConverter.populateKubernetesGroupPojo(kubernetesGroup);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceNonExistingKubernetesGroupExceptionException e) {
      String message=e.getFaultMessage().getNonExistingKubernetesGroupException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
  return null;
}
Program: 116256
Project: 116256
Buggy source:
public static KubernetesMaster getKubernetesMaster(String kubernetesGroupId) throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    try {
      org.apache.stratos.autoscaler.stub.kubernetes.KubernetesMaster kubernetesMaster=autoscalerServiceClient.getKubernetesMaster(kubernetesGroupId);
      return PojoConverter.populateKubernetesMasterPojo(kubernetesMaster);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceNonExistingKubernetesGroupExceptionException e) {
      String message=e.getFaultMessage().getNonExistingKubernetesGroupException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
  return null;
}

Fixed version (ground truth):
public static KubernetesMaster getKubernetesMaster(String kubernetesGroupId) throws RestAPIException {
  AutoscalerServiceClient autoscalerServiceClient=getAutoscalerServiceClient();
  if (autoscalerServiceClient != null) {
    try {
      org.apache.stratos.common.kubernetes.KubernetesMaster kubernetesMaster=autoscalerServiceClient.getKubernetesMaster(kubernetesGroupId);
      return PojoConverter.populateKubernetesMasterPojo(kubernetesMaster);
    }
 catch (    RemoteException e) {
      log.error(e.getMessage(),e);
      throw new RestAPIException(e.getMessage(),e);
    }
catch (    AutoScalerServiceNonExistingKubernetesGroupExceptionException e) {
      String message=e.getFaultMessage().getNonExistingKubernetesGroupException().getMessage();
      log.error(message,e);
      throw new RestAPIException(message,e);
    }
  }
  return null;
}
Program: 116257
Project: 116257
Buggy source:
public PayloadData create(String alias,Cluster cluster,Subscriber subscriber,Repository repository,CartridgeInfo cartridgeInfo,String subscriptionKey,Map<String,String> customPayloadEntries) throws ADCException, AlreadySubscribedException {
  String clusterId=null;
  try {
    clusterId=AutoscalerServiceClient.getServiceClient().getDefaultLBClusterId(getDeploymentPolicyName());
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + e.getMessage());
    throw new ADCException(e);
  }
  if (clusterId != null) {
    cluster.setClusterDomain(clusterId);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + clusterId);
    }
    defaultLBServiceExists=true;
    ClusterContext clusterContext;
    try {
      clusterContext=CloudControllerServiceClient.getServiceClient().getClusterContext(clusterId);
    }
 catch (    RemoteException e) {
      log.error("String_Node_Str",e);
      throw new ADCException(e);
    }
    if (clusterContext != null) {
      cluster.setHostName(clusterContext.getHostName());
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + clusterContext.getHostName());
      }
    }
    return null;
  }
 else {
    cluster.setClusterDomain(generateClusterId(null,cartridgeInfo.getType()));
    cluster.setHostName(generateHostName(null,cartridgeInfo.getHostName()));
    return createPayload(cartridgeInfo,subscriptionKey,subscriber,cluster,repository,alias,customPayloadEntries);
  }
}

Fixed version (ground truth):
public PayloadData create(String alias,Cluster cluster,Subscriber subscriber,Repository repository,CartridgeInfo cartridgeInfo,String subscriptionKey,Map<String,String> customPayloadEntries) throws ADCException, AlreadySubscribedException {
  String clusterId=null;
  if (clusterId != null) {
    cluster.setClusterDomain(clusterId);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + clusterId);
    }
    defaultLBServiceExists=true;
    ClusterContext clusterContext;
    try {
      clusterContext=CloudControllerServiceClient.getServiceClient().getClusterContext(clusterId);
    }
 catch (    RemoteException e) {
      log.error("String_Node_Str",e);
      throw new ADCException(e);
    }
    if (clusterContext != null) {
      cluster.setHostName(clusterContext.getHostName());
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + clusterContext.getHostName());
      }
    }
    return null;
  }
 else {
    cluster.setClusterDomain(generateClusterId(null,cartridgeInfo.getType()));
    cluster.setHostName(generateHostName(null,cartridgeInfo.getHostName()));
    return createPayload(cartridgeInfo,subscriptionKey,subscriber,cluster,repository,alias,customPayloadEntries);
  }
}
Program: 116259
Project: 116259
Buggy source:
public PayloadData create(String alias,Cluster cluster,Subscriber subscriber,Repository repository,CartridgeInfo cartridgeInfo,String subscriptionKey,Map<String,String> customPayloadEntries) throws ADCException, AlreadySubscribedException {
  String clusterId=null;
  try {
    clusterId=AutoscalerServiceClient.getServiceClient().getDefaultLBClusterId(getDeploymentPolicyName());
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + e.getMessage());
    throw new ADCException(e);
  }
  if (clusterId != null) {
    cluster.setClusterDomain(clusterId);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + clusterId);
    }
    defaultLBExists=true;
    ClusterContext clusterContext;
    try {
      clusterContext=CloudControllerServiceClient.getServiceClient().getClusterContext(clusterId);
    }
 catch (    RemoteException e) {
      log.error("String_Node_Str",e);
      throw new ADCException(e);
    }
    if (clusterContext != null) {
      cluster.setHostName(clusterContext.getHostName());
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + clusterContext.getHostName());
      }
    }
    return null;
  }
 else {
    cluster.setClusterDomain(generateClusterId(alias,cartridgeInfo.getType()));
    cluster.setHostName(generateHostName(alias,cartridgeInfo.getHostName()));
    return createPayload(cartridgeInfo,subscriptionKey,subscriber,cluster,repository,alias,customPayloadEntries);
  }
}

Fixed version (ground truth):
public PayloadData create(String alias,Cluster cluster,Subscriber subscriber,Repository repository,CartridgeInfo cartridgeInfo,String subscriptionKey,Map<String,String> customPayloadEntries) throws ADCException, AlreadySubscribedException {
  String clusterId=null;
  if (clusterId != null) {
    cluster.setClusterDomain(clusterId);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + clusterId);
    }
    defaultLBExists=true;
    ClusterContext clusterContext;
    try {
      clusterContext=CloudControllerServiceClient.getServiceClient().getClusterContext(clusterId);
    }
 catch (    RemoteException e) {
      log.error("String_Node_Str",e);
      throw new ADCException(e);
    }
    if (clusterContext != null) {
      cluster.setHostName(clusterContext.getHostName());
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + clusterContext.getHostName());
      }
    }
    return null;
  }
 else {
    cluster.setClusterDomain(generateClusterId(alias,cartridgeInfo.getType()));
    cluster.setHostName(generateHostName(alias,cartridgeInfo.getHostName()));
    return createPayload(cartridgeInfo,subscriptionKey,subscriber,cluster,repository,alias,customPayloadEntries);
  }
}
Program: 116260
Project: 116260
Buggy source:
public PayloadData create(String alias,Cluster cluster,Subscriber subscriber,Repository repository,CartridgeInfo cartridgeInfo,String subscriptionKey,Map<String,String> customPayloadEntries) throws ADCException, AlreadySubscribedException {
  String clusterId=null;
  try {
    clusterId=AutoscalerServiceClient.getServiceClient().getServiceLBClusterId(getLoadBalancedServiceType(),getDeploymentPolicyName());
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + e.getMessage());
    throw new ADCException(e);
  }
  if (clusterId != null) {
    cluster.setClusterDomain(clusterId);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + clusterId);
    }
    serviceLbExists=true;
    ClusterContext clusterContext;
    try {
      clusterContext=CloudControllerServiceClient.getServiceClient().getClusterContext(clusterId);
    }
 catch (    RemoteException e) {
      log.error("String_Node_Str",e);
      throw new ADCException(e);
    }
    if (clusterContext != null) {
      cluster.setHostName(clusterContext.getHostName());
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + clusterContext.getHostName());
      }
    }
    return null;
  }
 else {
    cluster.setClusterDomain(generateClusterId(alias,cartridgeInfo.getType()));
    cluster.setHostName(generateHostName(alias,cartridgeInfo.getHostName()));
    PayloadData serviceLevelLbPayloadData=createPayload(cartridgeInfo,subscriptionKey,subscriber,cluster,repository,alias,customPayloadEntries);
    serviceLevelLbPayloadData.add(CartridgeConstants.LOAD_BALANCED_SERVICE_TYPE,getLoadBalancedServiceType());
    return serviceLevelLbPayloadData;
  }
}

Fixed version (ground truth):
public PayloadData create(String alias,Cluster cluster,Subscriber subscriber,Repository repository,CartridgeInfo cartridgeInfo,String subscriptionKey,Map<String,String> customPayloadEntries) throws ADCException, AlreadySubscribedException {
  String clusterId=null;
  if (clusterId != null) {
    cluster.setClusterDomain(clusterId);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + clusterId);
    }
    serviceLbExists=true;
    ClusterContext clusterContext;
    try {
      clusterContext=CloudControllerServiceClient.getServiceClient().getClusterContext(clusterId);
    }
 catch (    RemoteException e) {
      log.error("String_Node_Str",e);
      throw new ADCException(e);
    }
    if (clusterContext != null) {
      cluster.setHostName(clusterContext.getHostName());
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + clusterContext.getHostName());
      }
    }
    return null;
  }
 else {
    cluster.setClusterDomain(generateClusterId(alias,cartridgeInfo.getType()));
    cluster.setHostName(generateHostName(alias,cartridgeInfo.getHostName()));
    PayloadData serviceLevelLbPayloadData=createPayload(cartridgeInfo,subscriptionKey,subscriber,cluster,repository,alias,customPayloadEntries);
    serviceLevelLbPayloadData.add(CartridgeConstants.LOAD_BALANCED_SERVICE_TYPE,getLoadBalancedServiceType());
    return serviceLevelLbPayloadData;
  }
}
Program: 116261
Project: 116261
Buggy source:
public PartitionContext getPartitionCtxt(String partitionId){
  return partitionCtxts.get(partitionId);
}

Fixed version (ground truth):
public ClusterLevelPartitionContext getPartitionCtxt(String partitionId){
  return partitionCtxts.get(partitionId);
}
Program: 116262
Project: 116262
Buggy source:
public ParentComponentLevelNetworkPartitionContext(String id,String partitionAlgo,Partition[] partitions){
  super(id,partitionAlgo,partitions);
  this.id=id;
  this.partitionAlgorithm=partitionAlgo;
  if (partitions == null) {
    this.partitions=new Partition[0];
  }
 else {
    this.partitions=Arrays.copyOf(partitions,partitions.length);
  }
  partitionCtxts=new HashMap<String,PartitionContext>();
  for (  Partition partition : partitions) {
    minInstanceCount+=partition.getPartitionMin();
    maxInstanceCount+=partition.getPartitionMax();
  }
  requiredInstanceCountBasedOnStats=minInstanceCount;
  requiredInstanceCountBasedOnDependencies=minInstanceCount;
  instanceIdToInstanceContextMap=new HashMap<String,InstanceContext>();
}

Fixed version (ground truth):
public ParentComponentLevelNetworkPartitionContext(String id,String partitionAlgo,Partition[] partitions){
  super(id,partitionAlgo,partitions);
  this.id=id;
  this.partitionAlgorithm=partitionAlgo;
  if (partitions == null) {
    this.partitions=new Partition[0];
  }
 else {
    this.partitions=Arrays.copyOf(partitions,partitions.length);
  }
  partitionCtxts=new HashMap<String,ClusterLevelPartitionContext>();
  for (  Partition partition : partitions) {
    minInstanceCount+=partition.getPartitionMin();
    maxInstanceCount+=partition.getPartitionMax();
  }
  requiredInstanceCountBasedOnStats=minInstanceCount;
  requiredInstanceCountBasedOnDependencies=minInstanceCount;
  instanceIdToInstanceContextMap=new HashMap<String,InstanceContext>();
}
Program: 116263
Project: 116263
Buggy source:
public void addPartitionContext(PartitionContext partitionContext){
  partitionCtxts.put(partitionContext.getPartitionId(),partitionContext);
}

Fixed version (ground truth):
public void addPartitionContext(ClusterLevelPartitionContext partitionContext){
  partitionCtxts.put(partitionContext.getPartitionId(),partitionContext);
}
Program: 116264
Project: 116264
Buggy source:
public Map<String,PartitionContext> getPartitionCtxts(){
  return partitionCtxts;
}

Fixed version (ground truth):
public Map<String,ClusterLevelPartitionContext> getPartitionCtxts(){
  return partitionCtxts;
}
Program: 116265
Project: 116265
Buggy source:
private void createInstanceAndStartDependency(Application application) throws TopologyInConsistentException, PolicyValidationException {
  List<String> instanceIds=new ArrayList<String>();
  String deploymentPolicyName=application.getDeploymentPolicy();
  if (deploymentPolicyName == null) {
    String msg="String_Node_Str" + appId;
    log.error(msg);
    throw new PolicyValidationException(msg);
  }
  DeploymentPolicy deploymentPolicy=PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyName);
  if (deploymentPolicy == null) {
    if (deploymentPolicy == null) {
      String msg="String_Node_Str" + deploymentPolicyName;
      log.error(msg);
      throw new PolicyValidationException(msg);
    }
  }
  String instanceId;
  for (  PartitionGroup partitionGroup : deploymentPolicy.getPartitionGroups()) {
    instanceId=createApplicationInstance(application,partitionGroup.getId());
    ParentComponentLevelNetworkPartitionContext context=new ParentComponentLevelNetworkPartitionContext(partitionGroup.getId(),partitionGroup.getPartitionAlgo(),partitionGroup.getPartitions());
    context.addInstanceContext(application.getInstanceContexts(instanceId));
    this.addNetworkPartitionContext(context);
    instanceIds.add(instanceId);
  }
  startDependency(application,instanceIds);
}

Fixed version (ground truth):
private void createInstanceAndStartDependency(Application application) throws TopologyInConsistentException, PolicyValidationException {
  List<String> instanceIds=new ArrayList<String>();
  DeploymentPolicy deploymentPolicy=getDeploymentPolicy(application);
  String instanceId;
  for (  PartitionGroup partitionGroup : deploymentPolicy.getPartitionGroups()) {
    instanceId=createApplicationInstance(application,partitionGroup.getId());
    ParentComponentLevelNetworkPartitionContext context=new ParentComponentLevelNetworkPartitionContext(partitionGroup.getId(),partitionGroup.getPartitionAlgo(),partitionGroup.getPartitions());
    context.addInstanceContext(application.getInstanceContexts(instanceId));
    this.addNetworkPartitionContext(context);
    instanceIds.add(instanceId);
  }
  startDependency(application,instanceIds);
}
Program: 116266
Project: 116266
Buggy source:
public void handleAverageRequestsServingCapabilityEvent(AverageRequestsServingCapabilityEvent averageRequestsServingCapabilityEvent){
}

Fixed version (ground truth):
public void handleAverageRequestsServingCapabilityEvent(AverageRequestsServingCapabilityEvent averageRequestsServingCapabilityEvent){
  String clusterId=averageRequestsServingCapabilityEvent.getClusterId();
  String networkPartitionId=averageRequestsServingCapabilityEvent.getNetworkPartitionId();
  Float floatValue=averageRequestsServingCapabilityEvent.getValue();
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",clusterId,networkPartitionId,floatValue));
  }
  NetworkPartitionContext networkPartitionContext=getNetworkPartitionCtxt(null,networkPartitionId);
  if (null != networkPartitionContext) {
    networkPartitionContext.setAverageRequestsServedPerInstance(floatValue);
  }
 else {
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str" + "String_Node_Str",networkPartitionId));
    }
  }
}
Program: 116267
Project: 116267
Buggy source:
@Override public void handleMemberReadyToShutdownEvent(MemberReadyToShutdownEvent memberReadyToShutdownEvent){
}

Fixed version (ground truth):
@Override public void handleMemberReadyToShutdownEvent(MemberReadyToShutdownEvent memberReadyToShutdownEvent){
  NetworkPartitionContext nwPartitionCtxt;
  String networkPartitionId=memberReadyToShutdownEvent.getNetworkPartitionId();
  String instanceId=memberReadyToShutdownEvent.getInstanceId();
  nwPartitionCtxt=getNetworkPartitionCtxt(instanceId,networkPartitionId);
  String memberId=memberReadyToShutdownEvent.getMemberId();
  String partitionId=getPartitionOfMember(memberId);
  PartitionContext partitionCtxt=nwPartitionCtxt.getPartitionCtxt(partitionId);
  try {
    String clusterId=memberReadyToShutdownEvent.getClusterId();
    if (partitionCtxt.getPendingTerminationMember(memberId) != null) {
      partitionCtxt.movePendingTerminationMemberToObsoleteMembers(memberId);
    }
 else     if (partitionCtxt.getPendingTerminationMember(memberId) != null) {
      partitionCtxt.movePendingTerminationMemberToObsoleteMembers(memberId);
    }
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",memberId,partitionId,clusterId));
    }
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + e.getLocalizedMessage();
    log.error(msg,e);
  }
}
Program: 116271
Project: 116271
Buggy source:
private static void updateGroupStatusesRecursively(GroupStatus groupStatus,Collection<Group> groups){
  for (  Group group : groups) {
    if (!group.isStateTransitionValid(groupStatus,null)) {
      log.error("String_Node_Str" + group.getStatus(null) + "String_Node_Str"+ groupStatus);
    }
    group.setStatus(groupStatus,null);
    if (group.getGroups() != null) {
      updateGroupStatusesRecursively(groupStatus,group.getGroups());
    }
  }
}

Fixed version (ground truth):
private static void updateGroupStatusesRecursively(GroupStatus groupStatus,Collection<Group> groups){
  for (  Group group : groups) {
    if (!group.isStateTransitionValid(groupStatus,null)) {
      log.error("String_Node_Str" + group.getStatus(null) + "String_Node_Str"+ groupStatus);
    }
    if (group.getGroups() != null) {
      updateGroupStatusesRecursively(groupStatus,group.getGroups());
    }
  }
}
Program: 116272
Project: 116272
Buggy source:
public static void handleGroupCreatedEvent(String appId,String groupId,String instanceId){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + groupId + "String_Node_Str"+ appId);
  }
  Applications applications=ApplicationHolder.getApplications();
  Application application=applications.getApplication(appId);
  if (application == null) {
    log.warn(String.format("String_Node_Str",appId));
    return;
  }
  Group group=application.getGroupRecursively(groupId);
  if (group == null) {
    log.warn(String.format("String_Node_Str",groupId));
    return;
  }
  GroupStatus status=GroupStatus.Created;
  if (group.isStateTransitionValid(status,null)) {
    group.setStatus(status,null);
    updateGroupMonitor(appId,groupId,status,instanceId);
    ApplicationHolder.persistApplication(application);
    ApplicationsEventPublisher.sendGroupCreatedEvent(appId,groupId,instanceId);
  }
 else {
    log.warn("String_Node_Str" + groupId + "String_Node_Str"+ group.getStatus(null)+ "String_Node_Str"+ status);
  }
}

Fixed version (ground truth):
public static void handleGroupCreatedEvent(String appId,String groupId,String instanceId){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + groupId + "String_Node_Str"+ appId);
  }
  Applications applications=ApplicationHolder.getApplications();
  Application application=applications.getApplication(appId);
  if (application == null) {
    log.warn(String.format("String_Node_Str",appId));
    return;
  }
  Group group=application.getGroupRecursively(groupId);
  if (group == null) {
    log.warn(String.format("String_Node_Str",groupId));
    return;
  }
  GroupStatus status=GroupStatus.Created;
  if (group.isStateTransitionValid(status,null)) {
    updateGroupMonitor(appId,groupId,status,instanceId);
    ApplicationHolder.persistApplication(application);
    ApplicationsEventPublisher.sendGroupCreatedEvent(appId,groupId,instanceId);
  }
 else {
    log.warn("String_Node_Str" + groupId + "String_Node_Str"+ group.getStatus(null)+ "String_Node_Str"+ status);
  }
}
Program: 116273
Project: 116273
Buggy source:
public static void sendApplicationTerminatingEvent(String appId,String instanceId){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId);
  }
  ApplicationTerminatingEvent applicationTerminatingEvent=new ApplicationTerminatingEvent(appId);
  publishEvent(applicationTerminatingEvent);
}

Fixed version (ground truth):
public static void sendApplicationTerminatingEvent(String appId,String instanceId){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId);
  }
  ApplicationTerminatingEvent applicationTerminatingEvent=new ApplicationTerminatingEvent(appId,instanceId);
  publishEvent(applicationTerminatingEvent);
}
Program: 116274
Project: 116274
Buggy source:
public static void sendApplicationInactivatedEvent(String appId){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId);
  }
  ApplicationInactivatedEvent applicationInActivatedEvent=new ApplicationInactivatedEvent(appId);
  publishEvent(applicationInActivatedEvent);
}

Fixed version (ground truth):
public static void sendApplicationInactivatedEvent(String appId,String instanceId){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId);
  }
  ApplicationInactivatedEvent applicationInActivatedEvent=new ApplicationInactivatedEvent(appId,instanceId);
  publishEvent(applicationInActivatedEvent);
}
Program: 116275
Project: 116275
Buggy source:
public MonitorAdder(ParentComponentMonitor parent,ApplicationChildContext context,String instanceId,String appId){
  this.parent=parent;
  this.context=context;
  this.appId=appId;
  this.instanceId=instanceId;
}

Fixed version (ground truth):
public MonitorAdder(ParentComponentMonitor parent,ApplicationChildContext context,String appId,String instanceId){
  this.parent=parent;
  this.context=context;
  this.appId=appId;
  this.instanceId=instanceId;
}
Program: 116276
Project: 116276
Buggy source:
private void startMinimumDependencies(Application application) throws TopologyInConsistentException {
  DeploymentPolicy policy=application.getComponentDeploymentPolicy();
  int min=policy.getMin();
  if (application.getInstanceContextCount() >= min) {
    startDependency(application);
  }
 else {
    if (application.getInstanceContextCount() > 0) {
      startDependency(application);
      int remainingInstancesToBeStarted=min - application.getInstanceContextCount();
      while (remainingInstancesToBeStarted > 0) {
        createInstanceAndStartDependency(application);
        remainingInstancesToBeStarted--;
      }
    }
 else {
      int instancesToBeStarted=min;
      while (instancesToBeStarted > 0) {
        createInstanceAndStartDependency(application);
        instancesToBeStarted--;
      }
    }
  }
}

Fixed version (ground truth):
private void startMinimumDependencies(Application application) throws TopologyInConsistentException {
  DeploymentPolicy policy=application.getComponentDeploymentPolicy();
  int min=1;
  if (policy != null) {
    min=policy.getMin();
  }
  if (application.getInstanceContextCount() >= min) {
    startDependency(application);
  }
 else {
    if (application.getInstanceContextCount() > 0) {
      startDependency(application);
      int remainingInstancesToBeStarted=min - application.getInstanceContextCount();
      while (remainingInstancesToBeStarted > 0) {
        createInstanceAndStartDependency(application);
        remainingInstancesToBeStarted--;
      }
    }
 else {
      int instancesToBeStarted=min;
      while (instancesToBeStarted > 0) {
        createInstanceAndStartDependency(application);
        instancesToBeStarted--;
      }
    }
  }
}
Program: 116278
Project: 116278
Buggy source:
@Override public void onParentStatusEvent(MonitorStatusEvent statusEvent){
  if (statusEvent.getStatus() == GroupStatus.Terminating || statusEvent.getStatus() == ApplicationStatus.Terminating) {
    ClusterStatusEventPublisher.sendClusterTerminatingEvent(appId,this.getServiceId(),clusterId,statusEvent.getInstanceId());
  }
 else   if (statusEvent.getStatus() == ClusterStatus.Created || statusEvent.getStatus() == GroupStatus.Created) {
  }
}

Fixed version (ground truth):
@Override public void onParentStatusEvent(MonitorStatusEvent statusEvent){
  if (statusEvent.getStatus() == GroupStatus.Terminating || statusEvent.getStatus() == ApplicationStatus.Terminating) {
    ClusterStatusEventPublisher.sendClusterTerminatingEvent(appId,this.getServiceId(),clusterId,statusEvent.getInstanceId());
  }
 else   if (statusEvent.getStatus() == ClusterStatus.Created || statusEvent.getStatus() == GroupStatus.Created) {
    Application application=ApplicationHolder.getApplications().getApplication(this.appId);
    Group group=application.getGroupRecursively(statusEvent.getId());
  }
}
Program: 116279
Project: 116279
Buggy source:
public void setStatus(ClusterStatus status){
  this.status=status;
  if (status == ClusterStatus.Inactive && !this.hasStartupDependents) {
    log.info("String_Node_Str" + clusterId + "String_Node_Str"+ "String_Node_Str");
  }
 else {
    MonitorStatusEventBuilder.handleClusterStatusEvent(this.parent,this.status,this.clusterId);
  }
}

Fixed version (ground truth):
public void setStatus(ClusterStatus status){
  if (status == ClusterStatus.Inactive && !this.hasStartupDependents) {
    log.info("String_Node_Str" + clusterId + "String_Node_Str"+ "String_Node_Str");
  }
 else {
    MonitorStatusEventBuilder.handleClusterStatusEvent(this.parent,status,this.clusterId);
  }
}
Program: 116280
Project: 116280
Buggy source:
@Override public void run(){
  while (!isDestroyed()) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + this.toString());
    }
    try {
      if (!ClusterStatus.Inactive.equals(getStatus())) {
        monitor();
      }
 else {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + ClusterStatus.Inactive + "String_Node_Str");
        }
      }
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + this.toString(),e);
    }
    try {
      Thread.sleep(getMonitorIntervalMilliseconds());
    }
 catch (    InterruptedException ignore) {
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (!isDestroyed()) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + this.toString());
    }
    try {
      monitor();
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + this.toString(),e);
    }
    try {
      Thread.sleep(getMonitorIntervalMilliseconds());
    }
 catch (    InterruptedException ignore) {
    }
  }
}
Program: 116281
Project: 116281
Buggy source:
@Override public void run(){
  while (!isDestroyed()) {
    try {
      if (((getStatus().getCode() <= ClusterStatus.Active.getCode()) || (getStatus() == ClusterStatus.Inactive && !hasStartupDependents)) && !this.hasFaultyMember && !stop) {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + this.toString());
        }
        monitor();
      }
 else {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + ClusterStatus.Inactive + "String_Node_Str");
        }
      }
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + this.toString(),e);
    }
    try {
      Thread.sleep(getMonitorIntervalMilliseconds());
    }
 catch (    InterruptedException ignore) {
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (!isDestroyed()) {
    try {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + this.toString());
      }
      monitor();
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + this.toString(),e);
    }
    try {
      Thread.sleep(getMonitorIntervalMilliseconds());
    }
 catch (    InterruptedException ignore) {
    }
  }
}
Program: 116282
Project: 116282
Buggy source:
private void startMinimumDependencies(Group group,String parentInstanceId) throws TopologyInConsistentException {
  DeploymentPolicy policy=group.getComponentDeploymentPolicy();
  int min=policy.getMin();
  if (group.getInstanceContextCount() >= min) {
    startDependency(group);
  }
 else {
    if (group.getInstanceContextCount() > 0) {
      startDependency(group);
      int remainingInstancesToBeStarted=min - group.getInstanceContextCount();
      while (remainingInstancesToBeStarted > 0) {
        createInstanceAndStartDependency(group,parentInstanceId);
        remainingInstancesToBeStarted--;
      }
    }
 else {
      int instancesToBeStarted=min;
      while (instancesToBeStarted > 0) {
        createInstanceAndStartDependency(group,parentInstanceId);
        instancesToBeStarted--;
      }
    }
  }
}

Fixed version (ground truth):
private void startMinimumDependencies(Group group,String parentInstanceId) throws TopologyInConsistentException {
  DeploymentPolicy policy=group.getComponentDeploymentPolicy();
  int min=1;
  if (policy != null) {
    min=policy.getMin();
  }
  if (group.getInstanceContextCount() >= min) {
    startDependency(group);
  }
 else {
    if (group.getInstanceContextCount() > 0) {
      startDependency(group);
      int remainingInstancesToBeStarted=min - group.getInstanceContextCount();
      while (remainingInstancesToBeStarted > 0) {
        createInstanceAndStartDependency(group,parentInstanceId);
        remainingInstancesToBeStarted--;
      }
    }
 else {
      int instancesToBeStarted=min;
      while (instancesToBeStarted > 0) {
        createInstanceAndStartDependency(group,parentInstanceId);
        instancesToBeStarted--;
      }
    }
  }
}