nus-yam/ex-repair huggingface dataset:
Program: 116576
Project: 116576
Buggy source:
@Override public void startDependency(){
  preOrderTraverse=DependencyBuilder.getStartupOrder(component);
  if (!preOrderTraverse.isEmpty()) {
    String dependency=preOrderTraverse.poll();
    if (dependency.contains("String_Node_Str")) {
      for (      Group group : component.getAliasToGroupMap().values()) {
        if (group.getName().equals(dependency.substring(6))) {
          startGroupMonitor(this,group.getAlias(),component);
        }
      }
    }
 else     if (dependency.contains("String_Node_Str")) {
      for (      ClusterDataHolder dataHolder : component.getClusterDataMap().values()) {
        if (dataHolder.getServiceType().equals(dependency.substring(10))) {
          String clusterId=dataHolder.getClusterId();
          String serviceName=dataHolder.getServiceType();
          Cluster cluster=null;
          TopologyManager.acquireReadLock();
          cluster=TopologyManager.getTopology().getService(serviceName).getCluster(clusterId);
          TopologyManager.releaseReadLock();
          if (cluster != null) {
            startClusterMonitor(cluster);
          }
 else {
          }
        }
      }
    }
  }
 else {
    log.info("String_Node_Str" + this.id + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void startDependency(){
  preOrderTraverse=DependencyBuilder.getStartupOrder(component);
  if (!preOrderTraverse.isEmpty()) {
    String dependency=preOrderTraverse.poll();
    if (dependency.contains("String_Node_Str")) {
      for (      Group group : component.getAliasToGroupMap().values()) {
        if (group.getName().equals(dependency.substring(6))) {
          startGroupMonitor(this,group.getAlias(),component);
        }
      }
    }
 else     if (dependency.contains("String_Node_Str")) {
      for (      ClusterDataHolder dataHolder : component.getClusterDataMap().values()) {
        if (dataHolder.getServiceType().equals(dependency.substring(10))) {
          String clusterId=dataHolder.getClusterId();
          String serviceName=dataHolder.getServiceType();
          Cluster cluster=null;
          TopologyManager.acquireReadLock();
          cluster=TopologyManager.getTopology().getService(serviceName).getCluster(clusterId);
          TopologyManager.releaseReadLock();
          if (cluster != null) {
            startClusterMonitor(this,cluster);
          }
 else {
          }
        }
      }
    }
  }
 else {
    log.info("String_Node_Str" + this.id + "String_Node_Str");
  }
}
Program: 116577
Project: 116577
Buggy source:
protected void activate(ComponentContext context){
  try {
    TopicSubscriber subscriber=new TopicSubscriber(CloudControllerConstants.INSTANCE_TOPIC);
    subscriber.setMessageListener(new InstanceStatusEventMessageListener());
    Thread tsubscriber=new Thread(subscriber);
    tsubscriber.start();
    InstanceStatusEventMessageDelegator delegator=new InstanceStatusEventMessageDelegator();
    Thread tdelegator=new Thread(delegator);
    tdelegator.start();
    BundleContext bundleContext=context.getBundleContext();
    bundleContext.registerService(CloudControllerService.class.getName(),new CloudControllerServiceImpl(),null);
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str");
    }
    TopologySynchronizerTaskScheduler.schedule(ServiceReferenceHolder.getInstance().getTaskService());
  }
 catch (  Throwable e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
protected void activate(ComponentContext context){
  try {
    TopicSubscriber subscriber=new TopicSubscriber(CloudControllerConstants.INSTANCE_TOPIC);
    subscriber.setMessageListener(new InstanceStatusEventMessageListener());
    Thread tsubscriber=new Thread(subscriber);
    tsubscriber.start();
    InstanceStatusEventMessageDelegator delegator=new InstanceStatusEventMessageDelegator();
    Thread tdelegator=new Thread(delegator);
    tdelegator.start();
    applicationStatusTopicReceiver=new ApplicationStatusTopicReceiver();
    Thread appThread=new Thread(applicationStatusTopicReceiver);
    appThread.start();
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    BundleContext bundleContext=context.getBundleContext();
    bundleContext.registerService(CloudControllerService.class.getName(),new CloudControllerServiceImpl(),null);
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str");
    }
    TopologySynchronizerTaskScheduler.schedule(ServiceReferenceHolder.getInstance().getTaskService());
  }
 catch (  Throwable e) {
    log.error("String_Node_Str",e);
  }
}
Program: 116578
Project: 116578
Buggy source:
public static Queue<String> getStartupOrder(ParentBehavior component){
  Queue<String> startup=new LinkedList<String>();
  DependencyOrder dependencyOrder=component.getDependencyOrder();
  if (dependencyOrder != null) {
    Set<StartupOrder> startupOrderSet=dependencyOrder.getStartupOrders();
    for (    StartupOrder startupOrder : startupOrderSet) {
      String start=startupOrder.getStart();
      String after=startupOrder.getAfter();
      if (!startup.contains(start)) {
        startup.add(start);
        if (!startup.contains(after)) {
          startup.add(after);
        }
 else {
        }
      }
 else {
        if (!startup.contains(after)) {
          startup.add(after);
        }
 else {
        }
      }
    }
  }
  for (  String grpAlias : component.getAliasToGroupMap().keySet()) {
    if (!startup.contains("String_Node_Str" + grpAlias)) {
      startup.add("String_Node_Str" + grpAlias);
    }
  }
  Set<String> cartridgeAliases=component.getClusterDataMap().keySet();
  for (  String carAlias : cartridgeAliases) {
    if (!startup.contains("String_Node_Str" + carAlias)) {
      startup.add("String_Node_Str" + carAlias);
    }
  }
  return startup;
}

Fixed version (ground truth):
public static Queue<String> getStartupOrder(ParentBehavior component){
  Queue<String> startup=new LinkedList<String>();
  DependencyOrder dependencyOrder=component.getDependencyOrder();
  if (dependencyOrder != null) {
    Set<StartupOrder> startupOrderSet=dependencyOrder.getStartupOrders();
    for (    StartupOrder startupOrder : startupOrderSet) {
      String start=startupOrder.getStart();
      String after=startupOrder.getAfter();
      if (!startup.contains(start)) {
        startup.add(start);
        if (!startup.contains(after)) {
          startup.add(after);
        }
 else {
        }
      }
 else {
        if (!startup.contains(after)) {
          startup.add(after);
        }
 else {
        }
      }
    }
  }
  if (component instanceof Application) {
    for (    Group group : component.getAliasToGroupMap().values()) {
      if (!startup.contains("String_Node_Str" + group.getAlias())) {
        startup.add("String_Node_Str" + group.getAlias());
      }
    }
    Set<String> cartridgeAliases=component.getClusterDataMap().keySet();
    for (    String carAlias : cartridgeAliases) {
      if (!startup.contains("String_Node_Str" + carAlias)) {
        startup.add("String_Node_Str" + carAlias);
      }
    }
  }
 else   if (component instanceof Group) {
    for (    Group group : component.getAliasToGroupMap().values()) {
      if (!startup.contains("String_Node_Str" + group.getName())) {
        startup.add("String_Node_Str" + group.getName());
      }
    }
    for (    ClusterDataHolder dataHolder : component.getClusterDataMap().values()) {
      if (!startup.contains("String_Node_Str" + dataHolder.getServiceType())) {
        startup.add("String_Node_Str" + dataHolder.getServiceType());
      }
    }
  }
  return startup;
}
Program: 116579
Project: 116579
Buggy source:
public void run(){
  ApplicationMonitor applicationMonitor=null;
  int retries=5;
  boolean success=false;
  while (!success && retries != 0) {
    try {
      applicationMonitor=AutoscalerUtil.getApplicationMonitor(application);
      success=true;
    }
 catch (    Exception e) {
      String msg="String_Node_Str" + application.getId();
      log.debug(msg,e);
      retries--;
      try {
        Thread.sleep(5000);
      }
 catch (      InterruptedException e1) {
      }
    }
  }
  if (applicationMonitor == null) {
    String msg="String_Node_Str" + "String_Node_Str" + applicationMonitor.getId();
    log.error(msg);
    throw new RuntimeException(msg);
  }
  AutoscalerContext.getInstance().addAppMonitor(applicationMonitor);
  if (log.isInfoEnabled()) {
    log.info(String.format("String_Node_Str" + "String_Node_Str",applicationMonitor.getId()));
  }
}

Fixed version (ground truth):
public void run(){
  ApplicationMonitor applicationMonitor=null;
  int retries=5;
  boolean success=false;
  do {
    try {
      Thread.sleep(5000);
    }
 catch (    InterruptedException e1) {
    }
    try {
      long start=System.currentTimeMillis();
      applicationMonitor=AutoscalerUtil.getApplicationMonitor(application);
      long end=System.currentTimeMillis();
      log.info("String_Node_Str" + (end - start) / 1000);
      success=true;
    }
 catch (    Exception e) {
      String msg="String_Node_Str" + application.getId();
      log.debug(msg,e);
      retries--;
    }
  }
 while (!success && retries != 0);
  if (applicationMonitor == null) {
    String msg="String_Node_Str" + "String_Node_Str" + applicationMonitor.getId();
    log.error(msg);
    throw new RuntimeException(msg);
  }
  AutoscalerContext.getInstance().addAppMonitor(applicationMonitor);
  if (log.isInfoEnabled()) {
    log.info(String.format("String_Node_Str" + "String_Node_Str",applicationMonitor.getId()));
  }
}
Program: 116581
Project: 116581
Buggy source:
protected synchronized void startGroupMonitor(Monitor parent,String dependency,ParentBehavior component){
  Thread th=null;
  if (!this.groupMonitors.containsKey(dependency)) {
    th=new Thread(new GroupMonitorAdder(parent,dependency,component));
  }
  if (th != null) {
    th.start();
    try {
      th.join();
    }
 catch (    InterruptedException ignore) {
    }
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",dependency));
    }
  }
}

Fixed version (ground truth):
protected synchronized void startGroupMonitor(Monitor parent,String dependency,ParentBehavior component){
  Thread th=null;
  if (!this.groupMonitors.containsKey(dependency)) {
    th=new Thread(new GroupMonitorAdder(parent,dependency,component));
  }
  if (th != null) {
    th.start();
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",dependency));
    }
  }
}
Program: 116582
Project: 116582
Buggy source:
protected synchronized void startClusterMonitor(Cluster cluster){
  Thread th=null;
  if (cluster.isLbCluster() && !this.abstractClusterMonitors.containsKey(cluster.getClusterId())) {
    th=new Thread(new LBClusterMonitorAdder(cluster));
  }
 else   if (!cluster.isLbCluster() && !this.abstractClusterMonitors.containsKey(cluster.getClusterId())) {
    th=new Thread(new ClusterMonitorAdder(cluster));
  }
  if (th != null) {
    th.start();
    try {
      th.join();
    }
 catch (    InterruptedException ignore) {
    }
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",cluster.getClusterId()));
    }
  }
}

Fixed version (ground truth):
protected synchronized void startClusterMonitor(Cluster cluster){
  Thread th=null;
  if (cluster.isLbCluster() && !this.abstractClusterMonitors.containsKey(cluster.getClusterId())) {
    th=new Thread(new LBClusterMonitorAdder(cluster));
  }
 else   if (!cluster.isLbCluster() && !this.abstractClusterMonitors.containsKey(cluster.getClusterId())) {
    th=new Thread(new ClusterMonitorAdder(cluster));
  }
  if (th != null) {
    th.start();
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",cluster.getClusterId()));
    }
  }
}
Program: 116583
Project: 116583
Buggy source:
public void startDependency(){
  preOrderTraverse=DependencyBuilder.getStartupOrder(component);
  if (!preOrderTraverse.isEmpty()) {
    String dependency=preOrderTraverse.poll();
    if (dependency.contains("String_Node_Str")) {
      startGroupMonitor(this,dependency.substring(6),component);
    }
 else     if (dependency.contains("String_Node_Str")) {
      ClusterDataHolder clusterDataHolder=component.getClusterData(dependency.substring(10));
      String clusterId=clusterDataHolder.getClusterId();
      String serviceName=clusterDataHolder.getServiceType();
      Cluster cluster=null;
      TopologyManager.acquireReadLock();
      cluster=TopologyManager.getTopology().getService(serviceName).getCluster(clusterId);
      TopologyManager.releaseReadLock();
      if (cluster != null) {
        startClusterMonitor(cluster);
      }
 else {
      }
    }
  }
 else {
    log.info("String_Node_Str" + this.id + "String_Node_Str");
  }
}

Fixed version (ground truth):
protected abstract void startDependency();
Program: 116585
Project: 116585
Buggy source:
public static Queue<String> getStartupOrder(ParentBehavior component){
  Queue<String> startup=new LinkedList<String>();
  DependencyOrder dependencyOrder=component.getDependencyOrder();
  if (dependencyOrder != null) {
    Set<StartupOrder> startupOrderSet=dependencyOrder.getStartupOrders();
    for (    StartupOrder startupOrder : startupOrderSet) {
      String start=startupOrder.getStart();
      String after=startupOrder.getAfter();
      if (!startup.contains(start)) {
        startup.add(start);
        if (!startup.contains(after)) {
          startup.add(after);
        }
 else {
        }
      }
 else {
        if (!startup.contains(after)) {
          startup.add(after);
        }
 else {
        }
      }
    }
  }
  for (  Group group : component.getAliasToGroupMap().values()) {
    if (!startup.contains(group.getAlias())) {
      startup.add(group.getAlias());
    }
  }
  for (  Set<String> clusterIds : component.getServiceNameToClusterIdsMap().values()) {
    for (    String clusterId : clusterIds) {
      if (!startup.contains(clusterId)) {
        startup.add(clusterId);
      }
    }
  }
  return startup;
}

Fixed version (ground truth):
public static Queue<String> getStartupOrder(ParentBehavior component){
  Queue<String> startup=new LinkedList<String>();
  DependencyOrder dependencyOrder=component.getDependencyOrder();
  if (dependencyOrder != null) {
    Set<StartupOrder> startupOrderSet=dependencyOrder.getStartupOrders();
    for (    StartupOrder startupOrder : startupOrderSet) {
      String start=startupOrder.getStart();
      String after=startupOrder.getAfter();
      if (!startup.contains(start)) {
        startup.add(start);
        if (!startup.contains(after)) {
          startup.add(after);
        }
 else {
        }
      }
 else {
        if (!startup.contains(after)) {
          startup.add(after);
        }
 else {
        }
      }
    }
  }
  for (  String grpAlias : component.getAliasToGroupMap().keySet()) {
    if (!startup.contains("String_Node_Str" + grpAlias)) {
      startup.add("String_Node_Str" + grpAlias);
    }
  }
  for (  Set<String> clusterIds : component.getServiceNameToClusterIdsMap().values()) {
    for (    String clusterId : clusterIds) {
      if (!startup.contains("String_Node_Str" + clusterId)) {
        startup.add("String_Node_Str" + clusterId);
      }
    }
  }
  return startup;
}
Program: 116586
Project: 116586
Buggy source:
public Monitor(ParentBehavior component){
  this.component=component;
  startDependency();
}

Fixed version (ground truth):
public Monitor(ParentBehavior component){
  groupMonitors=new HashMap<String,GroupMonitor>();
  abstractClusterMonitors=new HashMap<String,AbstractClusterMonitor>();
  this.component=component;
  startDependency();
}
Program: 116587
Project: 116587
Buggy source:
public void startDependency(){
  preOrderTraverse=DependencyBuilder.getStartupOrder(component);
  if (!preOrderTraverse.isEmpty()) {
    String dependency=preOrderTraverse.poll();
    if (dependency.contains("String_Node_Str")) {
      startGroupMonitor(this,dependency,component);
    }
 else     if (dependency.contains("String_Node_Str")) {
      Set<String> clusterIds=component.getClusterIds(dependency);
      for (      String clusterId : clusterIds) {
        Cluster cluster=null;
        TopologyManager.acquireReadLock();
        cluster=TopologyManager.getTopology().getService(dependency).getCluster(clusterId);
        TopologyManager.releaseReadLock();
        if (cluster != null) {
          startClusterMonitor(cluster);
        }
 else {
        }
      }
    }
  }
 else {
    log.info("String_Node_Str" + this.id + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void startDependency(){
  preOrderTraverse=DependencyBuilder.getStartupOrder(component);
  if (!preOrderTraverse.isEmpty()) {
    String dependency=preOrderTraverse.poll();
    if (dependency.contains("String_Node_Str")) {
      startGroupMonitor(this,dependency.substring(6),component);
    }
 else     if (dependency.contains("String_Node_Str")) {
    }
  }
 else {
    log.info("String_Node_Str" + this.id + "String_Node_Str");
  }
}
Program: 116590
Project: 116590
Buggy source:
/** 
 * Update an existing Kubernetes host
 */
public synchronized boolean updateKubernetesHost(KubernetesHost kubernetesHost) throws InvalidKubernetesHostException, NonExistingKubernetesHostException {
  validateKubernetesHost(kubernetesHost);
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroupContainingHost(kubernetesHost.getHostId());
    for (int i=0; i < kubernetesGroupStored.getKubernetesHosts().length; i++) {
      if (kubernetesGroupStored.getKubernetesHosts()[i].getHostId().equals(kubernetesHost.getHostId())) {
        KubernetesGroup clonedObj=SerializationUtils.clone(kubernetesGroupStored);
        clonedObj.getKubernetesHosts()[i]=kubernetesHost;
        RegistryManager.getInstance().persistKubernetesGroup(clonedObj);
        kubernetesGroupStored.getKubernetesHosts()[i]=kubernetesHost;
        if (log.isInfoEnabled()) {
          log.info(String.format("String_Node_Str",kubernetesHost.getHostId()));
        }
        return true;
      }
    }
  }
 catch (  Exception e) {
    throw new InvalidKubernetesHostException(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Update an existing Kubernetes host
 */
public synchronized boolean updateKubernetesHost(KubernetesHost kubernetesHost) throws InvalidKubernetesHostException, NonExistingKubernetesHostException {
  validateKubernetesHost(kubernetesHost);
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesHost);
  }
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroupContainingHost(kubernetesHost.getHostId());
    for (int i=0; i < kubernetesGroupStored.getKubernetesHosts().length; i++) {
      if (kubernetesGroupStored.getKubernetesHosts()[i].getHostId().equals(kubernetesHost.getHostId())) {
        KubernetesGroup clonedObj=SerializationUtils.clone(kubernetesGroupStored);
        clonedObj.getKubernetesHosts()[i]=kubernetesHost;
        RegistryManager.getInstance().persistKubernetesGroup(clonedObj);
        kubernetesGroupStored.getKubernetesHosts()[i]=kubernetesHost;
        if (log.isInfoEnabled()) {
          log.info(String.format("String_Node_Str",kubernetesHost.getHostId()));
        }
        return true;
      }
    }
  }
 catch (  Exception e) {
    throw new InvalidKubernetesHostException(e.getMessage(),e);
  }
  return false;
}
Program: 116591
Project: 116591
Buggy source:
/** 
 * Remove a registered Kubernetes group from registry
 */
public synchronized boolean removeKubernetesGroup(String kubernetesGroupId) throws NonExistingKubernetesGroupException {
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroup(kubernetesGroupId);
    RegistryManager.getInstance().removeKubernetesGroup(kubernetesGroupStored);
    kubernetesGroupsMap.remove(kubernetesGroupId);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesGroupId));
    }
  }
 catch (  Exception e) {
    throw new NonExistingKubernetesGroupException(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Remove a registered Kubernetes group from registry
 */
public synchronized boolean removeKubernetesGroup(String kubernetesGroupId) throws NonExistingKubernetesGroupException {
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesGroupId);
  }
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroup(kubernetesGroupId);
    RegistryManager.getInstance().removeKubernetesGroup(kubernetesGroupStored);
    kubernetesGroupsMap.remove(kubernetesGroupId);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesGroupId));
    }
  }
 catch (  Exception e) {
    throw new NonExistingKubernetesGroupException(e.getMessage(),e);
  }
  return false;
}
Program: 116592
Project: 116592
Buggy source:
/** 
 * Update an existing Kubernetes master
 */
public synchronized boolean updateKubernetesMaster(KubernetesMaster kubernetesMaster) throws InvalidKubernetesMasterException, NonExistingKubernetesMasterException {
  validateKubernetesMaster(kubernetesMaster);
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroupContainingHost(kubernetesMaster.getHostId());
    KubernetesGroup clonedObj=SerializationUtils.clone(kubernetesGroupStored);
    clonedObj.setKubernetesMaster(kubernetesMaster);
    RegistryManager.getInstance().persistKubernetesGroup(clonedObj);
    kubernetesGroupStored.setKubernetesMaster(kubernetesMaster);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesMaster.getHostId()));
    }
  }
 catch (  Exception e) {
    throw new InvalidKubernetesMasterException(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Update an existing Kubernetes master
 */
public synchronized boolean updateKubernetesMaster(KubernetesMaster kubernetesMaster) throws InvalidKubernetesMasterException, NonExistingKubernetesMasterException {
  validateKubernetesMaster(kubernetesMaster);
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesMaster);
  }
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroupContainingHost(kubernetesMaster.getHostId());
    KubernetesGroup clonedObj=SerializationUtils.clone(kubernetesGroupStored);
    clonedObj.setKubernetesMaster(kubernetesMaster);
    RegistryManager.getInstance().persistKubernetesGroup(clonedObj);
    kubernetesGroupStored.setKubernetesMaster(kubernetesMaster);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesMaster.getHostId()));
    }
  }
 catch (  Exception e) {
    throw new InvalidKubernetesMasterException(e.getMessage(),e);
  }
  return false;
}
Program: 116594
Project: 116594
Buggy source:
/** 
 * Register a new KubernetesGroup in AutoScaler.
 */
public synchronized boolean addNewKubernetesGroup(KubernetesGroup kubernetesGroup) throws InvalidKubernetesGroupException {
  validateKubernetesGroup(kubernetesGroup);
  try {
    validateKubernetesEndPointViaCloudController(kubernetesGroup.getKubernetesMaster());
    RegistryManager.getInstance().persistKubernetesGroup(kubernetesGroup);
    addKubernetesGroupToInformationModel(kubernetesGroup);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesGroup.getGroupId(),kubernetesGroup.getDescription()));
    }
    return true;
  }
 catch (  Exception e) {
    throw new InvalidKubernetesGroupException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Register a new KubernetesGroup in AutoScaler.
 */
public synchronized boolean addNewKubernetesGroup(KubernetesGroup kubernetesGroup) throws InvalidKubernetesGroupException {
  if (kubernetesGroup == null) {
    throw new InvalidKubernetesGroupException("String_Node_Str");
  }
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesGroup);
  }
  validateKubernetesGroup(kubernetesGroup);
  try {
    validateKubernetesEndPointViaCloudController(kubernetesGroup.getKubernetesMaster());
    addKubernetesGroupToInformationModel(kubernetesGroup);
    RegistryManager.getInstance().persistKubernetesGroup(kubernetesGroup);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesGroup.getGroupId(),kubernetesGroup.getDescription()));
    }
    return true;
  }
 catch (  Exception e) {
    throw new InvalidKubernetesGroupException(e.getMessage(),e);
  }
}
Program: 116596
Project: 116596
Buggy source:
/** 
 * Remove a registered Kubernetes host from registry
 */
public synchronized boolean removeKubernetesHost(String kubernetesHostId) throws NonExistingKubernetesHostException {
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroupContainingHost(kubernetesHostId);
    List<KubernetesHost> kubernetesHostList=new ArrayList<KubernetesHost>();
    for (    KubernetesHost kubernetesHost : kubernetesGroupStored.getKubernetesHosts()) {
      if (!kubernetesHost.getHostId().equals(kubernetesHostId)) {
        kubernetesHostList.add(kubernetesHost);
      }
    }
    KubernetesHost[] kubernetesHostsArray=new KubernetesHost[kubernetesHostList.size()];
    kubernetesHostList.toArray(kubernetesHostsArray);
    KubernetesGroup clonedObj=SerializationUtils.clone(kubernetesGroupStored);
    clonedObj.setKubernetesHosts(kubernetesHostsArray);
    RegistryManager.getInstance().persistKubernetesGroup(clonedObj);
    kubernetesGroupStored.setKubernetesHosts(kubernetesHostsArray);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesHostId));
    }
  }
 catch (  Exception e) {
    throw new NonExistingKubernetesHostException(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Remove a registered Kubernetes host from registry
 */
public synchronized boolean removeKubernetesHost(String kubernetesHostId) throws NonExistingKubernetesHostException {
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesHostId);
  }
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroupContainingHost(kubernetesHostId);
    List<KubernetesHost> kubernetesHostList=new ArrayList<KubernetesHost>();
    for (    KubernetesHost kubernetesHost : kubernetesGroupStored.getKubernetesHosts()) {
      if (!kubernetesHost.getHostId().equals(kubernetesHostId)) {
        kubernetesHostList.add(kubernetesHost);
      }
    }
    KubernetesHost[] kubernetesHostsArray=new KubernetesHost[kubernetesHostList.size()];
    kubernetesHostList.toArray(kubernetesHostsArray);
    KubernetesGroup clonedObj=SerializationUtils.clone(kubernetesGroupStored);
    clonedObj.setKubernetesHosts(kubernetesHostsArray);
    RegistryManager.getInstance().persistKubernetesGroup(clonedObj);
    kubernetesGroupStored.setKubernetesHosts(kubernetesHostsArray);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesHostId));
    }
  }
 catch (  Exception e) {
    throw new NonExistingKubernetesHostException(e.getMessage(),e);
  }
  return false;
}
Program: 116597
Project: 116597
Buggy source:
/** 
 * Update an existing Kubernetes host
 */
public synchronized boolean updateKubernetesHost(KubernetesHost kubernetesHost) throws InvalidKubernetesHostException, NonExistingKubernetesHostException {
  validateKubernetesHost(kubernetesHost);
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesHost);
  }
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroupContainingHost(kubernetesHost.getHostId());
    for (int i=0; i < kubernetesGroupStored.getKubernetesHosts().length; i++) {
      if (kubernetesGroupStored.getKubernetesHosts()[i].getHostId().equals(kubernetesHost.getHostId())) {
        KubernetesGroup clonedObj=SerializationUtils.clone(kubernetesGroupStored);
        clonedObj.getKubernetesHosts()[i]=kubernetesHost;
        RegistryManager.getInstance().persistKubernetesGroup(clonedObj);
        kubernetesGroupStored.getKubernetesHosts()[i]=kubernetesHost;
        if (log.isInfoEnabled()) {
          log.info(String.format("String_Node_Str",kubernetesHost.getHostId()));
        }
        return true;
      }
    }
  }
 catch (  Exception e) {
    throw new InvalidKubernetesHostException(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Update an existing Kubernetes host
 */
public synchronized boolean updateKubernetesHost(KubernetesHost kubernetesHost) throws InvalidKubernetesHostException, NonExistingKubernetesHostException {
  validateKubernetesHost(kubernetesHost);
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesHost);
  }
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroupContainingHost(kubernetesHost.getHostId());
    for (int i=0; i < kubernetesGroupStored.getKubernetesHosts().length; i++) {
      if (kubernetesGroupStored.getKubernetesHosts()[i].getHostId().equals(kubernetesHost.getHostId())) {
        kubernetesGroupStored.getKubernetesHosts()[i]=kubernetesHost;
        RegistryManager.getInstance().persistKubernetesGroup(kubernetesGroupStored);
        if (log.isInfoEnabled()) {
          log.info(String.format("String_Node_Str",kubernetesHost.getHostId()));
        }
        return true;
      }
    }
  }
 catch (  Exception e) {
    throw new InvalidKubernetesHostException(e.getMessage(),e);
  }
  throw new NonExistingKubernetesHostException("String_Node_Str" + kubernetesHost.getHostId());
}
Program: 116598
Project: 116598
Buggy source:
/** 
 * Remove a registered Kubernetes group from registry
 */
public synchronized boolean removeKubernetesGroup(String kubernetesGroupId) throws NonExistingKubernetesGroupException {
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesGroupId);
  }
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroup(kubernetesGroupId);
    RegistryManager.getInstance().removeKubernetesGroup(kubernetesGroupStored);
    kubernetesGroupsMap.remove(kubernetesGroupId);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesGroupId));
    }
  }
 catch (  Exception e) {
    throw new NonExistingKubernetesGroupException(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Remove a registered Kubernetes group from registry
 */
public synchronized boolean removeKubernetesGroup(String kubernetesGroupId) throws NonExistingKubernetesGroupException {
  if (StringUtils.isEmpty(kubernetesGroupId)) {
    throw new NonExistingKubernetesGroupException("String_Node_Str");
  }
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesGroupId);
  }
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroup(kubernetesGroupId);
    kubernetesGroupsMap.remove(kubernetesGroupId);
    RegistryManager.getInstance().removeKubernetesGroup(kubernetesGroupStored);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesGroupId));
    }
    return true;
  }
 catch (  Exception e) {
    throw new NonExistingKubernetesGroupException(e.getMessage(),e);
  }
}
Program: 116599
Project: 116599
Buggy source:
/** 
 * Update an existing Kubernetes master
 */
public synchronized boolean updateKubernetesMaster(KubernetesMaster kubernetesMaster) throws InvalidKubernetesMasterException, NonExistingKubernetesMasterException {
  validateKubernetesMaster(kubernetesMaster);
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesMaster);
  }
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroupContainingHost(kubernetesMaster.getHostId());
    KubernetesGroup clonedObj=SerializationUtils.clone(kubernetesGroupStored);
    clonedObj.setKubernetesMaster(kubernetesMaster);
    RegistryManager.getInstance().persistKubernetesGroup(clonedObj);
    kubernetesGroupStored.setKubernetesMaster(kubernetesMaster);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesMaster.getHostId()));
    }
  }
 catch (  Exception e) {
    throw new InvalidKubernetesMasterException(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Update an existing Kubernetes master
 */
public synchronized boolean updateKubernetesMaster(KubernetesMaster kubernetesMaster) throws InvalidKubernetesMasterException, NonExistingKubernetesMasterException {
  validateKubernetesMaster(kubernetesMaster);
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesMaster);
  }
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroupContainingHost(kubernetesMaster.getHostId());
    kubernetesGroupStored.setKubernetesMaster(kubernetesMaster);
    RegistryManager.getInstance().persistKubernetesGroup(kubernetesGroupStored);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesMaster.getHostId()));
    }
  }
 catch (  Exception e) {
    throw new InvalidKubernetesMasterException(e.getMessage(),e);
  }
  return false;
}
Program: 116600
Project: 116600
Buggy source:
private void validateKubernetesHost(KubernetesHost kubernetesHost) throws InvalidKubernetesHostException {
  if (kubernetesHost == null) {
    throw new InvalidKubernetesHostException("String_Node_Str");
  }
  if (StringUtils.isEmpty(kubernetesHost.getHostId())) {
    throw new InvalidKubernetesHostException("String_Node_Str");
  }
  if (kubernetesHost.getHostIpAddress() == null) {
    throw new InvalidKubernetesHostException("String_Node_Str" + "String_Node_Str" + kubernetesHost.getHostId());
  }
}

Fixed version (ground truth):
private void validateKubernetesHost(KubernetesHost kubernetesHost) throws InvalidKubernetesHostException {
  if (kubernetesHost == null) {
    throw new InvalidKubernetesHostException("String_Node_Str");
  }
  if (StringUtils.isEmpty(kubernetesHost.getHostId())) {
    throw new InvalidKubernetesHostException("String_Node_Str");
  }
  if (kubernetesHost.getHostIpAddress() == null) {
    throw new InvalidKubernetesHostException("String_Node_Str" + "String_Node_Str" + kubernetesHost.getHostId());
  }
  if (!InetAddresses.isInetAddress(kubernetesHost.getHostIpAddress())) {
    throw new InvalidKubernetesHostException("String_Node_Str" + kubernetesHost.getHostIpAddress());
  }
}
Program: 116602
Project: 116602
Buggy source:
/** 
 * Remove a registered Kubernetes host from registry
 */
public synchronized boolean removeKubernetesHost(String kubernetesHostId) throws NonExistingKubernetesHostException {
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesHostId);
  }
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroupContainingHost(kubernetesHostId);
    List<KubernetesHost> kubernetesHostList=new ArrayList<KubernetesHost>();
    for (    KubernetesHost kubernetesHost : kubernetesGroupStored.getKubernetesHosts()) {
      if (!kubernetesHost.getHostId().equals(kubernetesHostId)) {
        kubernetesHostList.add(kubernetesHost);
      }
    }
    KubernetesHost[] kubernetesHostsArray=new KubernetesHost[kubernetesHostList.size()];
    kubernetesHostList.toArray(kubernetesHostsArray);
    KubernetesGroup clonedObj=SerializationUtils.clone(kubernetesGroupStored);
    clonedObj.setKubernetesHosts(kubernetesHostsArray);
    RegistryManager.getInstance().persistKubernetesGroup(clonedObj);
    kubernetesGroupStored.setKubernetesHosts(kubernetesHostsArray);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesHostId));
    }
  }
 catch (  Exception e) {
    throw new NonExistingKubernetesHostException(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Remove a registered Kubernetes host from registry
 */
public synchronized boolean removeKubernetesHost(String kubernetesHostId) throws NonExistingKubernetesHostException {
  if (kubernetesHostId == null) {
    throw new NonExistingKubernetesHostException("String_Node_Str");
  }
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + kubernetesHostId);
  }
  try {
    KubernetesGroup kubernetesGroupStored=getKubernetesGroupContainingHost(kubernetesHostId);
    if (kubernetesGroupStored.getKubernetesMaster().getHostId().equals(kubernetesHostId)) {
      throw new NonExistingKubernetesHostException("String_Node_Str" + kubernetesHostId);
    }
    List<KubernetesHost> kubernetesHostList=new ArrayList<KubernetesHost>();
    for (    KubernetesHost kubernetesHost : kubernetesGroupStored.getKubernetesHosts()) {
      if (!kubernetesHost.getHostId().equals(kubernetesHostId)) {
        kubernetesHostList.add(kubernetesHost);
      }
    }
    if (kubernetesHostList.size() == kubernetesGroupStored.getKubernetesHosts().length) {
      throw new NonExistingKubernetesHostException("String_Node_Str" + kubernetesHostId);
    }
    KubernetesHost[] kubernetesHostsArray=new KubernetesHost[kubernetesHostList.size()];
    kubernetesHostList.toArray(kubernetesHostsArray);
    kubernetesGroupStored.setKubernetesHosts(kubernetesHostsArray);
    RegistryManager.getInstance().persistKubernetesGroup(kubernetesGroupStored);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",kubernetesHostId));
    }
    return true;
  }
 catch (  Exception e) {
    throw new NonExistingKubernetesHostException(e.getMessage(),e);
  }
}
Program: 116603
Project: 116603
Buggy source:
public List<KubernetesMaster> getKubernetesMasters(){
  return kubernetesMasters;
}

Fixed version (ground truth):
public KubernetesMaster getKubernetesMasters(){
  return kubernetesMaster;
}
Program: 116604
Project: 116604
Buggy source:
public void setKubernetesMasters(List<KubernetesMaster> kubernetesMasters){
  this.kubernetesMasters=kubernetesMasters;
}

Fixed version (ground truth):
public void setKubernetesMasters(KubernetesMaster kubernetesMasters){
  this.kubernetesMaster=kubernetesMasters;
}
Program: 116606
Project: 116606
Buggy source:
@Override protected void onEvent(Event event){
  try {
    TopologyManager.acquireReadLock();
    ServiceRemovedEvent serviceRemovedEvent=(ServiceRemovedEvent)event;
    Service service=TopologyManager.getTopology().getService(serviceRemovedEvent.getServiceName());
    if (service != null) {
      for (      Cluster cluster : service.getClusters()) {
        LoadBalancerContextUtil.removeClusterAgainstHostNames(cluster.getClusterId());
      }
    }
 else {
      if (log.isWarnEnabled()) {
        log.warn(String.format("String_Node_Str",serviceRemovedEvent.getServiceName()));
      }
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
 finally {
    TopologyManager.releaseReadLock();
  }
}

Fixed version (ground truth):
@Override protected void onEvent(Event event){
  try {
    TopologyManager.acquireReadLock();
    ServiceRemovedEvent serviceRemovedEvent=(ServiceRemovedEvent)event;
    Service service=TopologyManager.getTopology().getService(serviceRemovedEvent.getServiceName());
    if (service != null) {
      for (      Cluster cluster : service.getClusters()) {
        for (        Member member : cluster.getMembers()) {
          removeMemberIpsFromMemberIpHostnameMap(member);
        }
        LoadBalancerContextUtil.removeClusterAgainstHostNames(cluster.getClusterId());
      }
    }
 else {
      if (log.isWarnEnabled()) {
        log.warn(String.format("String_Node_Str",serviceRemovedEvent.getServiceName()));
      }
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
 finally {
    TopologyManager.releaseReadLock();
  }
}
Program: 116609
Project: 116609
Buggy source:
private LoadBalancerContext(){
  tenantIdSynapseEnvironmentServiceMap=new TenantIdSynapseEnvironmentServiceMap();
  serviceNameServiceContextMap=new ServiceNameServiceContextMap();
  clusterIdClusterContextMap=new ClusterIdClusterContextMap();
  clusterIdClusterMap=new ClusterIdClusterMap();
  hostNameClusterMap=new HostNameClusterMap();
  hostNameAppContextMap=new HostNameAppContextMap();
  multiTenantClusterMap=new MultiTenantClusterMap();
}

Fixed version (ground truth):
private LoadBalancerContext(){
  tenantIdSynapseEnvironmentServiceMap=new TenantIdSynapseEnvironmentServiceMap();
  serviceNameServiceContextMap=new ServiceNameServiceContextMap();
  clusterIdClusterContextMap=new ClusterIdClusterContextMap();
  clusterIdClusterMap=new ClusterIdClusterMap();
  hostNameClusterMap=new HostNameClusterMap();
  hostNameAppContextMap=new HostNameAppContextMap();
  multiTenantClusterMap=new MultiTenantClusterMap();
  memberIpHostnameMap=new MemberIpHostnameMap();
}
Program: 116613
Project: 116613
Buggy source:
@Override public CartridgeSubscriptionInfo registerSubscription(Properties properties) throws ADCException, UnregisteredCartridgeException {
  CartridgeInfo cartridgeInfo=getCartridgeInfo();
  if (!cartridgeInfo.isMultiTenantSpecified()) {
    getLoadBalancerCategory().register(cartridgeInfo,getCluster(),getPayloadData(),getAutoscalingPolicyName(),getDeploymentPolicyName(),properties);
  }
  return ApplicationManagementUtil.createCartridgeSubscription(getCartridgeInfo(),getAutoscalingPolicyName(),getType(),getAlias(),getSubscriber().getTenantId(),getSubscriber().getTenantDomain(),getRepository(),getCluster().getHostName(),getCluster().getClusterDomain(),getCluster().getClusterSubDomain(),getCluster().getMgtClusterDomain(),getCluster().getMgtClusterSubDomain(),null,getSubscriptionStatus(),getSubscriptionKey());
}

Fixed version (ground truth):
@Override public CartridgeSubscriptionInfo registerSubscription(Properties properties) throws ADCException, UnregisteredCartridgeException {
  if (!loadBalancerCategory.isLoadBalancedServiceMultiTenant()) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    getLoadBalancerCategory().register(getCartridgeInfo(),getCluster(),getPayloadData(),getAutoscalingPolicyName(),getDeploymentPolicyName(),properties);
  }
  return ApplicationManagementUtil.createCartridgeSubscription(getCartridgeInfo(),getAutoscalingPolicyName(),getType(),getAlias(),getSubscriber().getTenantId(),getSubscriber().getTenantDomain(),getRepository(),getCluster().getHostName(),getCluster().getClusterDomain(),getCluster().getClusterSubDomain(),getCluster().getMgtClusterDomain(),getCluster().getMgtClusterSubDomain(),null,getSubscriptionStatus(),getSubscriptionKey());
}
Program: 116614
Project: 116614
Buggy source:
public void register(CartridgeInfo cartridgeInfo,Cluster cluster,PayloadData payloadData,String autoscalePolicyName,String deploymentPolicyName,Properties properties) throws ADCException, UnregisteredCartridgeException {
  log.info("String_Node_Str" + payloadData.getCompletePayloadData().toString());
  ApplicationManagementUtil.registerService(cartridgeInfo.getType(),cluster.getClusterDomain(),cluster.getClusterSubDomain(),payloadData.getCompletePayloadData(),payloadData.getBasicPayloadData().getTenantRange(),cluster.getHostName(),autoscalePolicyName,deploymentPolicyName,properties);
}

Fixed version (ground truth):
public void register(CartridgeInfo cartridgeInfo,Cluster cluster,PayloadData payloadData,String autoscalePolicyName,String deploymentPolicyName,Properties properties) throws ADCException, UnregisteredCartridgeException {
  if (payloadData != null) {
    log.info("String_Node_Str" + payloadData.getCompletePayloadData().toString());
  }
 else {
    log.info("String_Node_Str");
  }
  ApplicationManagementUtil.registerService(cartridgeInfo.getType(),cluster.getClusterDomain(),cluster.getClusterSubDomain(),payloadData.getCompletePayloadData(),payloadData.getBasicPayloadData().getTenantRange(),cluster.getHostName(),autoscalePolicyName,deploymentPolicyName,properties);
}
Program: 116616
Project: 116616
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 + "String_Node_Str"+ alias);
    }
    defaultLBExists=true;
    ClusterContext clusterContext;
    try {
      clusterContext=CloudControllerServiceClient.getServiceClient().getClusterContext(clusterId);
    }
 catch (    RemoteException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new ADCException(e);
    }
    if (clusterContext != null) {
      cluster.setHostName(clusterContext.getHostName());
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + clusterContext.getHostName() + "String_Node_Str"+ alias);
      }
    }
  }
 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;
  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 + "String_Node_Str"+ alias);
    }
    defaultLBExists=true;
    ClusterContext clusterContext;
    try {
      clusterContext=CloudControllerServiceClient.getServiceClient().getClusterContext(clusterId);
    }
 catch (    RemoteException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new ADCException(e);
    }
    if (clusterContext != null) {
      cluster.setHostName(clusterContext.getHostName());
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + clusterContext.getHostName() + "String_Node_Str"+ alias);
      }
    }
    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: 116617
Project: 116617
Buggy source:
public void register(CartridgeInfo cartridgeInfo,Cluster cluster,PayloadData payloadData,String autoscalePolicyName,String deploymentPolicyName,Properties properties) throws ADCException, UnregisteredCartridgeException {
  if (!isDefaultLBExists()) {
    log.info("String_Node_Str" + payloadData.getCompletePayloadData().toString());
    super.register(cartridgeInfo,cluster,payloadData,autoscalePolicyName,deploymentPolicyName,properties);
  }
 else {
    log.info("String_Node_Str");
  }
}

Fixed version (ground truth):
public void register(CartridgeInfo cartridgeInfo,Cluster cluster,PayloadData payloadData,String autoscalePolicyName,String deploymentPolicyName,Properties properties) throws ADCException, UnregisteredCartridgeException {
  log.info("String_Node_Str" + payloadData + "String_Node_Str");
  if (!isDefaultLBExists()) {
    if (payloadData != null) {
      log.info("String_Node_Str" + payloadData.getCompletePayloadData().toString());
    }
    super.register(cartridgeInfo,cluster,payloadData,autoscalePolicyName,deploymentPolicyName,properties);
  }
 else {
    log.info("String_Node_Str");
  }
}