nus-yam/ex-repair huggingface dataset:
Program: 116103
Project: 116103
Buggy source:
/** 
 * Utility method to find the group monitor recursively within app monitor
 * @param id       the unique alias of the Group
 * @param monitors the group monitors found in the app monitor
 * @return the found GroupMonitor
 */
private Monitor findGroupMonitor(String id,Collection<Monitor> monitors){
  for (  Monitor monitor : monitors) {
    if (monitor.getId().equals(id)) {
      return monitor;
    }
 else {
      if (monitor instanceof ParentComponentMonitor) {
        return findGroupMonitor(id,((ParentComponentMonitor)monitor).getAliasToActiveMonitorsMap().values());
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Utility method to find the group monitor recursively within app monitor
 * @param id       the unique alias of the Group
 * @param monitors the group monitors found in the app monitor
 * @return the found GroupMonitor
 */
private Monitor findGroupMonitor(String id,Map<String,Monitor> monitors){
  if (monitors.containsKey(id)) {
    return monitors.get(id);
  }
  for (  Monitor monitor : monitors.values()) {
    if (monitor instanceof ParentComponentMonitor) {
      Monitor monitor1=findGroupMonitor(id,((ParentComponentMonitor)monitor).getAliasToActiveMonitorsMap());
      if (monitor1 != null) {
        return monitor1;
      }
    }
  }
  return null;
}
Program: 116104
Project: 116104
Buggy source:
@Override public void onParentStatusEvent(MonitorStatusEvent statusEvent) throws MonitorNotFoundException {
  String instanceId=statusEvent.getInstanceId();
  if (statusEvent.getStatus() == GroupStatus.Terminating || statusEvent.getStatus() == ApplicationStatus.Terminating) {
    GroupInstance instance=(GroupInstance)this.instanceIdToInstanceMap.get(instanceId);
    if (instance != null) {
      ApplicationBuilder.handleGroupTerminatingEvent(appId,id,instanceId);
    }
 else {
      List<String> instanceIds=this.getInstancesByParentInstanceId(instanceId);
      if (!instanceIds.isEmpty()) {
        for (        String instanceId1 : instanceIds) {
          ApplicationBuilder.handleGroupTerminatingEvent(appId,id,instanceId1);
        }
      }
    }
  }
 else   if (statusEvent.getStatus() == ClusterStatus.Created || statusEvent.getStatus() == GroupStatus.Created) {
    Application application=ApplicationHolder.getApplications().getApplication(this.appId);
    Group group=application.getGroupRecursively(statusEvent.getId());
    createInstanceAndStartDependencyOnScaleup(statusEvent.getInstanceId());
  }
}

Fixed version (ground truth):
@Override public void onParentStatusEvent(MonitorStatusEvent statusEvent) throws MonitorNotFoundException {
  String instanceId=statusEvent.getInstanceId();
  if (statusEvent.getStatus() == GroupStatus.Terminating || statusEvent.getStatus() == ApplicationStatus.Terminating) {
    GroupInstance instance=(GroupInstance)this.instanceIdToInstanceMap.get(instanceId);
    if (instance != null) {
      ApplicationBuilder.handleGroupTerminatingEvent(appId,id,instanceId);
    }
 else {
      List<String> instanceIds=this.getInstancesByParentInstanceId(instanceId);
      if (!instanceIds.isEmpty()) {
        for (        String instanceId1 : instanceIds) {
          ApplicationBuilder.handleGroupTerminatingEvent(appId,id,instanceId1);
        }
      }
    }
  }
 else   if (statusEvent.getStatus() == ClusterStatus.Created || statusEvent.getStatus() == GroupStatus.Created) {
    Application application=ApplicationHolder.getApplications().getApplication(this.appId);
    Group group=application.getGroupRecursively(statusEvent.getId());
    createInstanceOnDemand(statusEvent.getInstanceId());
  }
}
Program: 116106
Project: 116106
Buggy source:
/** 
 * This will start the parallel dependencies at once from the top level by traversing to find the terminated dependencies. it will get invoked when start a child monitor on termination of a sub tree
 */
public void startDependencyOnTermination(String instanceId) throws TopologyInConsistentException, MonitorNotFoundException, PolicyValidationException, PartitionValidationException {
  List<ApplicationChildContext> applicationContexts=this.startupDependencyTree.getStarAbleDependenciesByTermination(this,instanceId);
  for (  ApplicationChildContext context : applicationContexts) {
    if (context instanceof GroupChildContext) {
      GroupMonitor groupMonitor=(GroupMonitor)this.aliasToActiveMonitorsMap.get(context.getId());
      groupMonitor.createInstanceAndStartDependencyOnScaleup(instanceId);
    }
 else     if (context instanceof ClusterChildContext) {
      VMClusterMonitor clusterMonitor=(VMClusterMonitor)this.aliasToActiveMonitorsMap.get(context.getId());
      clusterMonitor.createClusterInstanceOnScaleUp(instanceId);
    }
  }
}

Fixed version (ground truth):
/** 
 * This will start the parallel dependencies at once from the top level by traversing to find the terminated dependencies. it will get invoked when start a child monitor on termination of a sub tree
 */
public void startDependencyOnTermination(String instanceId) throws TopologyInConsistentException, MonitorNotFoundException, PolicyValidationException, PartitionValidationException {
  List<ApplicationChildContext> applicationContexts=this.startupDependencyTree.getStarAbleDependenciesByTermination(this,instanceId);
  for (  ApplicationChildContext context : applicationContexts) {
    if (context instanceof GroupChildContext) {
      GroupMonitor groupMonitor=(GroupMonitor)this.aliasToActiveMonitorsMap.get(context.getId());
      groupMonitor.createInstanceOnDemand(instanceId);
    }
 else     if (context instanceof ClusterChildContext) {
      VMClusterMonitor clusterMonitor=(VMClusterMonitor)this.aliasToActiveMonitorsMap.get(context.getId());
      clusterMonitor.createInstanceOnDemand(instanceId);
    }
  }
}
Program: 116107
Project: 116107
Buggy source:
/** 
 * This will start the child monitors based on the active of siblings according to start up order
 * @param childId parent id of the event which received
 */
protected void onChildActivatedEvent(String childId,String instanceId){
  try {
    removeInstanceFromFromInactiveMap(childId,instanceId);
    removeInstanceFromFromTerminatingMap(childId,instanceId);
    boolean startDep;
    if (!aliasToActiveMonitorsMap.containsKey(childId) || !pendingMonitorsList.contains(childId)) {
      startDep=startDependency(childId,instanceId);
    }
 else {
      startDep=startDependencyByInstanceCreation(childId,instanceId);
    }
    if (!startDep) {
      ServiceReferenceHolder.getInstance().getGroupStatusProcessorChain().process(this.id,this.appId,instanceId);
    }
 else {
      log.info("String_Node_Str" + startDep + "String_Node_Str"+ childId);
    }
  }
 catch (  MonitorNotFoundException e) {
    log.error(e);
  }
}

Fixed version (ground truth):
/** 
 * This will start the child monitors based on the active of siblings according to start up order
 * @param childId parent id of the event which received
 */
protected void onChildActivatedEvent(String childId,String instanceId){
  try {
    removeInstanceFromFromInactiveMap(childId,instanceId);
    removeInstanceFromFromTerminatingMap(childId,instanceId);
    boolean startDep;
    if (!aliasToActiveMonitorsMap.containsKey(childId) || !pendingMonitorsList.contains(childId)) {
      startDep=startDependency(childId,instanceId);
    }
 else {
      startDep=startDependencyByInstanceCreation(childId,instanceId);
    }
    if (!startDep) {
      ServiceReferenceHolder.getInstance().getGroupStatusProcessorChain().process(this.id,this.appId,instanceId);
    }
 else {
      log.info("String_Node_Str" + startDep + "String_Node_Str"+ this.id);
    }
  }
 catch (  MonitorNotFoundException e) {
    log.error(e);
  }
}
Program: 116108
Project: 116108
Buggy source:
/** 
 * To start the dependency of the given application contexts
 * @param applicationContexts the found applicationContexts to be started
 */
private boolean startDependency(List<ApplicationChildContext> applicationContexts,String instanceId) throws MonitorNotFoundException {
  if (applicationContexts != null && applicationContexts.isEmpty()) {
    log.info("String_Node_Str" + this.id);
    return false;
  }
  for (  ApplicationChildContext context : applicationContexts) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + context.getId() + "String_Node_Str");
    }
    if (!this.aliasToActiveMonitorsMap.containsKey(context.getId())) {
      String msg="String_Node_Str";
      throw new MonitorNotFoundException(msg);
    }
 else {
      Monitor monitor=aliasToActiveMonitorsMap.get(context.getId());
      if (context instanceof ClusterChildContext) {
        MonitorStatusEventBuilder.notifyChildCluster(monitor,ClusterStatus.Created,instanceId);
      }
 else       if (context instanceof GroupChildContext) {
        MonitorStatusEventBuilder.notifyChildGroup(monitor,GroupStatus.Created,instanceId);
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * To start the dependency of the given application contexts
 * @param applicationContexts the found applicationContexts to be started
 */
private boolean startDependency(List<ApplicationChildContext> applicationContexts,String instanceId) throws MonitorNotFoundException {
  if (applicationContexts != null && applicationContexts.isEmpty()) {
    log.info("String_Node_Str" + this.id);
    return false;
  }
  for (  ApplicationChildContext context : applicationContexts) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + context.getId() + "String_Node_Str");
    }
    if (!this.aliasToActiveMonitorsMap.containsKey(context.getId())) {
      String msg="String_Node_Str";
      throw new MonitorNotFoundException(msg);
    }
 else {
      Monitor monitor=aliasToActiveMonitorsMap.get(context.getId());
      monitor.createInstanceOnDemand(instanceId);
    }
  }
  return true;
}
Program: 116109
Project: 116109
Buggy source:
/** 
 * @param childId
 */
protected void onChildInactiveEvent(String childId,String instanceId){
  List<ApplicationChildContext> terminationList;
  Monitor monitor;
  terminationList=this.startupDependencyTree.getTerminationDependencies(childId);
  ServiceReferenceHolder.getInstance().getGroupStatusProcessorChain().process(this.id,this.appId,instanceId);
  if (this.startupDependencyTree.getTerminationBehavior() == DependencyTree.TerminationBehavior.TERMINATE_ALL && terminationList.size() == this.aliasToActiveMonitorsMap.size()) {
    if (this.parent != null) {
      ApplicationBuilder.handleGroupTerminatingEvent(this.appId,childId,instanceId);
    }
 else {
      sendTerminatingEventOnNotification(terminationList,childId,true,instanceId);
    }
    log.info("String_Node_Str" + childId + "String_Node_Str"+ "String_Node_Str");
  }
 else {
    sendTerminatingEventOnNotification(terminationList,childId,false,instanceId);
  }
}

Fixed version (ground truth):
/** 
 * @param childId
 */
protected void onChildInactiveEvent(String childId,String instanceId){
  List<ApplicationChildContext> terminationList;
  Monitor monitor;
  terminationList=this.startupDependencyTree.getTerminationDependencies(childId);
  ServiceReferenceHolder.getInstance().getGroupStatusProcessorChain().process(this.id,this.appId,instanceId);
  if (this.startupDependencyTree.getTerminationBehavior() == DependencyTree.TerminationBehavior.TERMINATE_ALL && terminationList.size() == this.aliasToActiveMonitorsMap.size()) {
    if (this.parent != null) {
      ApplicationBuilder.handleGroupTerminatingEvent(this.appId,this.id,instanceId);
    }
 else {
      sendTerminatingEventOnNotification(terminationList,childId,true,instanceId);
    }
    log.info("String_Node_Str" + childId + "String_Node_Str"+ "String_Node_Str");
  }
 else {
    sendTerminatingEventOnNotification(terminationList,childId,false,instanceId);
  }
}
Program: 116110
Project: 116110
Buggy source:
public static void handleApplicationInstanceTerminatedEvent(String appId,String instanceId){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + appId);
  }
  Applications applications=ApplicationHolder.getApplications();
  if (!applications.applicationExists(appId)) {
    log.warn("String_Node_Str" + appId);
  }
 else {
    Application application=applications.getApplication(appId);
    Set<ClusterDataHolder> clusterData=application.getClusterDataRecursively();
    ApplicationInstance instance=application.getInstanceContexts(instanceId);
    ApplicationStatus status=ApplicationStatus.Terminated;
    if (instance.isStateTransitionValid(status)) {
      instance.setStatus(status);
      updateApplicationMonitor(appId,status,instanceId);
      ApplicationMonitor applicationMonitor=AutoscalerContext.getInstance().getAppMonitor(appId);
      applicationMonitor.getNetworkPartitionContext(instance.getNetworkPartitionId()).removeClusterApplicationContext(instanceId);
      applicationMonitor.removeInstance(instanceId);
      application.removeInstance(instanceId);
      if (application.getInstanceContextCount() == 0) {
        AutoscalerContext.getInstance().removeAppMonitor(appId);
        log.info("String_Node_Str" + appId);
      }
      ApplicationsEventPublisher.sendApplicationInstanceTerminatedEvent(appId,clusterData);
    }
 else {
      log.warn(String.format("String_Node_Str" + "String_Node_Str",appId,application.getInstanceContexts(instanceId).getStatus(),status));
    }
  }
}

Fixed version (ground truth):
public static void handleApplicationInstanceTerminatedEvent(String appId,String instanceId){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + appId);
  }
  Applications applications=ApplicationHolder.getApplications();
  if (!applications.applicationExists(appId)) {
    log.warn("String_Node_Str" + appId);
  }
 else {
    Application application=applications.getApplication(appId);
    Set<ClusterDataHolder> clusterData=application.getClusterDataRecursively();
    ApplicationInstance instance=application.getInstanceContexts(instanceId);
    ApplicationStatus status=ApplicationStatus.Terminated;
    if (instance.isStateTransitionValid(status)) {
      instance.setStatus(status);
      updateApplicationMonitor(appId,status,instanceId);
      ApplicationMonitor applicationMonitor=AutoscalerContext.getInstance().getAppMonitor(appId);
      applicationMonitor.getNetworkPartitionContext(instance.getNetworkPartitionId()).removeClusterApplicationContext(instanceId);
      applicationMonitor.removeInstance(instanceId);
      application.removeInstance(instanceId);
      if (application.getInstanceContextCount() == 0) {
        AutoscalerContext.getInstance().removeAppMonitor(appId);
        log.info("String_Node_Str" + appId);
      }
      ApplicationsEventPublisher.sendApplicationInstanceTerminatedEvent(appId,instanceId);
    }
 else {
      log.warn(String.format("String_Node_Str" + "String_Node_Str",appId,application.getInstanceContexts(instanceId).getStatus(),status));
    }
  }
}
Program: 116111
Project: 116111
Buggy source:
public static void sendApplicationInstanceTerminatedEvent(String appId,Set<ClusterDataHolder> clusterData){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId);
  }
  ApplicationInstanceTerminatedEvent applicationTerminatedEvent=new ApplicationInstanceTerminatedEvent(appId,clusterData);
  publishEvent(applicationTerminatedEvent);
}

Fixed version (ground truth):
public static void sendApplicationInstanceTerminatedEvent(String appId,String instanceId){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId);
  }
  ApplicationInstanceTerminatedEvent applicationTerminatedEvent=new ApplicationInstanceTerminatedEvent(appId,instanceId);
  publishEvent(applicationTerminatedEvent);
}
Program: 116113
Project: 116113
Buggy source:
@Override public void handleMemberReadyToShutdownEvent(MemberReadyToShutdownEvent memberReadyToShutdownEvent){
  ClusterInstanceContext nwPartitionCtxt;
  String networkPartitionId=memberReadyToShutdownEvent.getNetworkPartitionId();
  String instanceId=memberReadyToShutdownEvent.getInstanceId();
  nwPartitionCtxt=getClusterInstanceContext(networkPartitionId,instanceId);
  String memberId=memberReadyToShutdownEvent.getMemberId();
  String partitionId=getPartitionOfMember(memberId);
  ClusterLevelPartitionContext 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" + "String_Node_Str",memberId,partitionId,clusterId));
    }
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + e.getLocalizedMessage();
    log.error(msg,e);
  }
}

Fixed version (ground truth):
@Override public void handleMemberReadyToShutdownEvent(MemberReadyToShutdownEvent memberReadyToShutdownEvent){
  ClusterInstanceContext nwPartitionCtxt;
  String networkPartitionId=memberReadyToShutdownEvent.getNetworkPartitionId();
  String instanceId=memberReadyToShutdownEvent.getInstanceId();
  nwPartitionCtxt=getClusterInstanceContext(networkPartitionId,instanceId);
  String memberId=memberReadyToShutdownEvent.getMemberId();
  String partitionId=getPartitionOfMember(memberId);
  ClusterLevelPartitionContext partitionCtxt=nwPartitionCtxt.getPartitionCtxt(partitionId);
  try {
    String clusterId=memberReadyToShutdownEvent.getClusterId();
    if (partitionCtxt.getPendingTerminationMember(memberId) != null) {
      partitionCtxt.movePendingTerminationMemberToObsoleteMembers(memberId);
      if (log.isInfoEnabled()) {
        log.info(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str",memberId,partitionId,clusterId));
      }
    }
 else     if (partitionCtxt.getObsoleteMember(memberId) != null) {
      if (log.isInfoEnabled()) {
        log.info(String.format("String_Node_Str" + "String_Node_Str",memberId,partitionId,clusterId));
      }
    }
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + e.getLocalizedMessage();
    log.error(msg,e);
  }
}
Program: 116114
Project: 116114
Buggy source:
@Override public void onChildStatusEvent(MonitorStatusEvent statusEvent){
  String childId=statusEvent.getId();
  String instanceId=statusEvent.getInstanceId();
  LifeCycleState status1=statusEvent.getStatus();
  if (status1 == ClusterStatus.Active || status1 == GroupStatus.Active) {
    onChildActivatedEvent(childId,instanceId);
  }
 else   if (status1 == ClusterStatus.Inactive || status1 == GroupStatus.Inactive) {
    this.markInstanceAsInactive(childId,instanceId);
    onChildInactiveEvent(childId,instanceId);
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    markInstanceAsTerminating(childId,instanceId);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    removeInstanceFromFromInactiveMap(childId,instanceId);
    removeInstanceFromFromTerminatingMap(childId,instanceId);
    ApplicationInstance instance=(ApplicationInstance)instanceIdToInstanceMap.get(instanceId);
    if (instance != null) {
      if (instance.getStatus() == ApplicationStatus.Terminating) {
        ServiceReferenceHolder.getInstance().getGroupStatusProcessorChain().process(this.id,appId,instanceId);
      }
 else {
        onChildTerminatedEvent(childId,instanceId);
      }
    }
 else {
      log.warn("String_Node_Str" + this.id);
    }
  }
}

Fixed version (ground truth):
@Override public void onChildStatusEvent(MonitorStatusEvent statusEvent){
  String childId=statusEvent.getId();
  String instanceId=statusEvent.getInstanceId();
  LifeCycleState status1=statusEvent.getStatus();
  if (status1 == ClusterStatus.Active || status1 == GroupStatus.Active) {
    onChildActivatedEvent(childId,instanceId);
  }
 else   if (status1 == ClusterStatus.Inactive || status1 == GroupStatus.Inactive) {
    this.markInstanceAsInactive(childId,instanceId);
    onChildInactiveEvent(childId,instanceId);
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    markInstanceAsTerminating(childId,instanceId);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    removeInstanceFromFromInactiveMap(childId,instanceId);
    removeInstanceFromFromTerminatingMap(childId,instanceId);
    ApplicationInstance instance=(ApplicationInstance)instanceIdToInstanceMap.get(instanceId);
    if (instance != null) {
      if (this.isTerminating()) {
        ServiceReferenceHolder.getInstance().getGroupStatusProcessorChain().process(this.id,appId,instanceId);
      }
 else {
        onChildTerminatedEvent(childId,instanceId);
      }
    }
 else {
      log.warn("String_Node_Str" + this.id);
    }
  }
}
Program: 116115
Project: 116115
Buggy source:
@Override public void onChildStatusEvent(MonitorStatusEvent statusEvent){
  String childId=statusEvent.getId();
  String instanceId=statusEvent.getInstanceId();
  LifeCycleState status1=statusEvent.getStatus();
  if (status1 == ClusterStatus.Active || status1 == GroupStatus.Active) {
    onChildActivatedEvent(childId,instanceId);
  }
 else   if (status1 == ClusterStatus.Inactive || status1 == GroupStatus.Inactive) {
    if (!this.aliasToActiveMonitorsMap.get(childId).hasStartupDependents()) {
      onChildActivatedEvent(childId,instanceId);
    }
 else {
      this.markInstanceAsInactive(childId,instanceId);
      onChildInactiveEvent(childId,instanceId);
    }
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    markInstanceAsTerminating(childId,instanceId);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    removeInstanceFromFromInactiveMap(childId,instanceId);
    removeInstanceFromFromTerminatingMap(childId,instanceId);
    GroupInstance instance=(GroupInstance)this.instanceIdToInstanceMap.get(instanceId);
    if (instance != null) {
      if (instance.getStatus() == GroupStatus.Terminating || instance.getStatus() == GroupStatus.Terminated) {
        ServiceReferenceHolder.getInstance().getGroupStatusProcessorChain().process(this.id,appId,instanceId);
      }
 else {
        onChildTerminatedEvent(childId,instanceId);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onChildStatusEvent(MonitorStatusEvent statusEvent){
  String childId=statusEvent.getId();
  String instanceId=statusEvent.getInstanceId();
  LifeCycleState status1=statusEvent.getStatus();
  String id=this.id;
  if (status1 == ClusterStatus.Active || status1 == GroupStatus.Active) {
    onChildActivatedEvent(childId,instanceId);
  }
 else   if (status1 == ClusterStatus.Inactive || status1 == GroupStatus.Inactive) {
    if (!aliasToActiveMonitorsMap.get(childId).hasStartupDependents()) {
      onChildActivatedEvent(childId,instanceId);
    }
 else {
      markInstanceAsInactive(childId,instanceId);
      onChildInactiveEvent(childId,instanceId);
    }
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    markInstanceAsTerminating(childId,instanceId);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    removeInstanceFromFromInactiveMap(childId,instanceId);
    removeInstanceFromFromTerminatingMap(childId,instanceId);
    GroupInstance instance=(GroupInstance)instanceIdToInstanceMap.get(instanceId);
    if (instance != null) {
      if (instance.getStatus() == GroupStatus.Terminating || instance.getStatus() == GroupStatus.Terminated) {
        ServiceReferenceHolder.getInstance().getGroupStatusProcessorChain().process(id,appId,instanceId);
      }
 else {
        onChildTerminatedEvent(childId,instanceId);
      }
    }
 else {
      log.warn("String_Node_Str" + id);
    }
  }
}
Program: 116116
Project: 116116
Buggy source:
private boolean doProcess(String idOfComponent,String appId,String instanceId){
  ParentComponent component;
  Map<String,Group> groups;
  Map<String,ClusterDataHolder> clusterData;
  try {
    ApplicationHolder.acquireWriteLock();
    if (idOfComponent.equals(appId)) {
      component=ApplicationHolder.getApplications().getApplication(appId);
    }
 else {
      component=ApplicationHolder.getApplications().getApplication(appId).getGroupRecursively(idOfComponent);
    }
    groups=component.getAliasToGroupMap();
    clusterData=component.getClusterDataMap();
    if (component.isGroupScalingEnabled()) {
    }
 else {
      if (groups.isEmpty() && getAllClusterInSameState(clusterData,ClusterStatus.Active,instanceId) || clusterData.isEmpty() && getAllGroupInSameState(groups,GroupStatus.Active,instanceId) || getAllClusterInSameState(clusterData,ClusterStatus.Active,instanceId) && getAllGroupInSameState(groups,GroupStatus.Active,instanceId)) {
        if (component instanceof Application) {
          log.info("String_Node_Str" + appId);
          ApplicationBuilder.handleApplicationInstanceActivatedEvent(appId,instanceId);
          return true;
        }
 else         if (component instanceof Group) {
          log.info("String_Node_Str" + component.getUniqueIdentifier());
          ApplicationBuilder.handleGroupInstanceActivatedEvent(appId,component.getUniqueIdentifier(),instanceId);
          return true;
        }
      }
    }
  }
  finally {
    ApplicationHolder.releaseWriteLock();
  }
  return false;
}

Fixed version (ground truth):
private boolean doProcess(String idOfComponent,String appId,String instanceId){
  ParentComponent component;
  Map<String,Group> groups;
  Map<String,ClusterDataHolder> clusterData;
  try {
    ApplicationHolder.acquireWriteLock();
    if (idOfComponent.equals(appId)) {
      component=ApplicationHolder.getApplications().getApplication(appId);
    }
 else {
      component=ApplicationHolder.getApplications().getApplication(appId).getGroupRecursively(idOfComponent);
    }
    groups=component.getAliasToGroupMap();
    clusterData=component.getClusterDataMap();
    if (groups.isEmpty() && getAllClusterInSameState(clusterData,ClusterStatus.Active,instanceId) || clusterData.isEmpty() && getAllGroupInSameState(groups,GroupStatus.Active,instanceId) || getAllClusterInSameState(clusterData,ClusterStatus.Active,instanceId) && getAllGroupInSameState(groups,GroupStatus.Active,instanceId)) {
      if (component instanceof Application) {
        log.info("String_Node_Str" + appId);
        ApplicationBuilder.handleApplicationInstanceActivatedEvent(appId,instanceId);
        return true;
      }
 else       if (component instanceof Group) {
        log.info("String_Node_Str" + component.getUniqueIdentifier());
        ApplicationBuilder.handleGroupInstanceActivatedEvent(appId,component.getUniqueIdentifier(),instanceId);
        return true;
      }
    }
  }
  finally {
    ApplicationHolder.releaseWriteLock();
  }
  return false;
}
Program: 116119
Project: 116119
Buggy source:
public ApplicationInstanceTerminatedEvent(String appId,Set<ClusterDataHolder> clusterData){
  this.appId=appId;
  this.clusterData=clusterData;
}

Fixed version (ground truth):
public ApplicationInstanceTerminatedEvent(String appId,String instanceId){
  this.appId=appId;
  this.instanceId=instanceId;
}
Program: 116120
Project: 116120
Buggy source:
private boolean doProcess(ApplicationInstanceTerminatedEvent event,Applications applications){
  if (event.getAppId() == null) {
    String errorMsg="String_Node_Str";
    log.error(errorMsg);
    throw new RuntimeException(errorMsg);
  }
  String appId=event.getAppId();
  if (applications.applicationExists(appId)) {
    log.warn("String_Node_Str" + appId + "String_Node_Str");
    applications.removeApplication(appId);
  }
  notifyEventListeners(event);
  return true;
}

Fixed version (ground truth):
private boolean doProcess(ApplicationInstanceTerminatedEvent event,Applications applications){
  if (event.getAppId() == null) {
    String errorMsg="String_Node_Str";
    log.error(errorMsg);
    throw new RuntimeException(errorMsg);
  }
  String appId=event.getAppId();
  String instanceId=event.getInstanceId();
  if (applications.applicationExists(appId)) {
    log.warn("String_Node_Str" + appId + "String_Node_Str");
    ApplicationInstance instance=applications.getApplication(appId).getInstanceContexts(instanceId);
    if (instance == null) {
      log.info("String_Node_Str" + instanceId + "String_Node_Str");
    }
    instance.setStatus(ApplicationStatus.Terminated);
    applications.getApplication(appId).removeInstance(instanceId);
  }
  notifyEventListeners(event);
  return true;
}
Program: 116121
Project: 116121
Buggy source:
public int getMaxNumberOfInstancesRequired(int numberOfInstancesReuquiredBasedOnRif,int numberOfInstancesReuquiredBasedOnMemoryConsumption,boolean mcReset,int numberOfInstancesReuquiredBasedOnLoadAverage,boolean laReset){
  int numberOfInstances=0;
  int rifBasedRequiredInstances=0;
  int mcBasedRequiredInstances=0;
  int laBasedRequiredInstances=0;
  if (arspiIsSet) {
    rifBasedRequiredInstances=numberOfInstancesReuquiredBasedOnRif;
  }
  if (mcReset) {
    rifBasedRequiredInstances=numberOfInstancesReuquiredBasedOnMemoryConsumption;
  }
  if (laReset) {
    rifBasedRequiredInstances=numberOfInstancesReuquiredBasedOnLoadAverage;
  }
  numberOfInstances=Math.max(Math.max(numberOfInstancesReuquiredBasedOnMemoryConsumption,numberOfInstancesReuquiredBasedOnLoadAverage),numberOfInstancesReuquiredBasedOnRif);
  return numberOfInstances;
}

Fixed version (ground truth):
public int getMaxNumberOfInstancesRequired(int numberOfInstancesReuquiredBasedOnRif,int numberOfInstancesReuquiredBasedOnMemoryConsumption,boolean mcReset,int numberOfInstancesReuquiredBasedOnLoadAverage,boolean laReset){
  int numberOfInstances=0;
  int rifBasedRequiredInstances=0;
  int mcBasedRequiredInstances=0;
  int laBasedRequiredInstances=0;
  if (arspiIsSet) {
    rifBasedRequiredInstances=numberOfInstancesReuquiredBasedOnRif;
  }
  if (mcReset) {
    mcBasedRequiredInstances=numberOfInstancesReuquiredBasedOnMemoryConsumption;
  }
  if (laReset) {
    laBasedRequiredInstances=numberOfInstancesReuquiredBasedOnLoadAverage;
  }
  numberOfInstances=Math.max(Math.max(numberOfInstancesReuquiredBasedOnMemoryConsumption,numberOfInstancesReuquiredBasedOnLoadAverage),numberOfInstancesReuquiredBasedOnRif);
  return numberOfInstances;
}
Program: 116122
Project: 116122
Buggy source:
public int getNumberOfInstancesRequiredBasedOnLoadAndMemoryConsumption(float upperLimit,float lowerLimit,double predictedValue,int activeMemberCount){
  double numberOfInstances=(activeMemberCount * predictedValue) / upperLimit;
  return (int)Math.ceil(numberOfInstances);
}

Fixed version (ground truth):
public int getNumberOfInstancesRequiredBasedOnLoadAndMemoryConsumption(float upperLimit,float lowerLimit,double predictedValue,int activeMemberCount){
  double numberOfInstances=0;
  if (upperLimit != 0) {
    numberOfInstances=(activeMemberCount * predictedValue) / upperLimit;
  }
  return (int)Math.ceil(numberOfInstances);
}
Program: 116124
Project: 116124
Buggy source:
/** 
 * This will check whether instances are there in the map
 * @return true/false
 */
public boolean hasInstance(){
  if (this.instanceIdToInstanceMap.isEmpty()) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This will check whether instances are there in the map
 * @return true/false
 */
public boolean hasInstance(){
  if (this.instanceIdToInstanceMap.isEmpty()) {
    return false;
  }
 else {
    return true;
  }
}
Program: 116125
Project: 116125
Buggy source:
public void run(){
  ClusterInstanceContext instanceContext=getAllNetworkPartitionCtxts().get(networkPartitionId).getClusterInstanceContext(instanceId);
  for (  ClusterLevelPartitionContext partitionContext : instanceContext.getPartitionCtxts()) {
    log.info("String_Node_Str" + getClusterId() + "String_Node_Str"+ instanceContext.getNetworkPartitionId()+ "String_Node_Str"+ partitionContext.getPartitionId()+ "String_Node_Str");
    Iterator<MemberContext> iterator=partitionContext.getActiveMembers().listIterator();
    while (iterator.hasNext()) {
      MemberContext activeMemberCtxt=iterator.next();
      String memberId=activeMemberCtxt.getMemberId();
      log.info("String_Node_Str" + memberId);
      partitionContext.moveActiveMemberToTerminationPendingMembers(memberId);
      InstanceNotificationPublisher.getInstance().sendInstanceCleanupEventForMember(memberId);
    }
    Iterator<MemberContext> pendingIterator=partitionContext.getPendingMembers().listIterator();
    while (pendingIterator.hasNext()) {
      MemberContext pendingMemberCtxt=pendingIterator.next();
      String memeberId=pendingMemberCtxt.getMemberId();
      log.info("String_Node_Str" + memeberId + "String_Node_Str");
      partitionContext.movePendingMemberToObsoleteMembers(memeberId);
    }
  }
}

Fixed version (ground truth):
public void run(){
  ClusterInstanceContext instanceContext=getAllNetworkPartitionCtxts().get(networkPartitionId).getClusterInstanceContext(instanceId);
  for (  ClusterLevelPartitionContext partitionContext : instanceContext.getPartitionCtxts()) {
    log.info("String_Node_Str" + getClusterId() + "String_Node_Str"+ instanceContext.getNetworkPartitionId()+ "String_Node_Str"+ partitionContext.getPartitionId()+ "String_Node_Str");
    List<String> activeMembers=new ArrayList<String>();
    Iterator<MemberContext> iterator=partitionContext.getActiveMembers().listIterator();
    while (iterator.hasNext()) {
      MemberContext activeMemberCtxt=iterator.next();
      activeMembers.add(activeMemberCtxt.getMemberId());
    }
    for (    String memberId : activeMembers) {
      log.info("String_Node_Str" + memberId);
      partitionContext.moveActiveMemberToTerminationPendingMembers(memberId);
      InstanceNotificationPublisher.getInstance().sendInstanceCleanupEventForMember(memberId);
    }
    Iterator<MemberContext> pendingIterator=partitionContext.getPendingMembers().listIterator();
    List<String> pendingMembers=new ArrayList<String>();
    while (pendingIterator.hasNext()) {
      MemberContext activeMemberCtxt=pendingIterator.next();
      pendingMembers.add(activeMemberCtxt.getMemberId());
    }
    for (    String memberId : pendingMembers) {
      MemberContext pendingMemberCtxt=pendingIterator.next();
      String memeberId=pendingMemberCtxt.getMemberId();
      log.info("String_Node_Str" + memeberId + "String_Node_Str");
      partitionContext.movePendingMemberToObsoleteMembers(memeberId);
    }
  }
}
Program: 116129
Project: 116129
Buggy source:
public static void handleGroupInstanceTerminatedEvent(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;
  }
  GroupInstance context=group.getInstanceContexts(instanceId);
  GroupStatus status=GroupStatus.Terminated;
  if (context != null) {
    if (context.isStateTransitionValid(status)) {
      context.setStatus(status);
      updateGroupMonitor(appId,groupId,status,instanceId);
      ApplicationHolder.persistApplication(application);
      ApplicationsEventPublisher.sendGroupInstanceTerminatedEvent(appId,groupId,instanceId);
    }
 else {
      log.warn("String_Node_Str" + groupId + "String_Node_Str"+ instanceId+ "String_Node_Str"+ context.getStatus()+ "String_Node_Str"+ status);
    }
  }
 else {
    log.warn("String_Node_Str" + groupId + "String_Node_Str"+ instanceId);
  }
}

Fixed version (ground truth):
public static void handleGroupInstanceTerminatedEvent(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;
  }
  GroupInstance context=group.getInstanceContexts(instanceId);
  GroupStatus status=GroupStatus.Terminated;
  if (context != null) {
    if (context.isStateTransitionValid(status)) {
      context.setStatus(status);
      group.removeInstance(instanceId);
      updateGroupMonitor(appId,groupId,status,instanceId);
      ApplicationHolder.persistApplication(application);
      ApplicationsEventPublisher.sendGroupInstanceTerminatedEvent(appId,groupId,instanceId);
    }
 else {
      log.warn("String_Node_Str" + groupId + "String_Node_Str"+ instanceId+ "String_Node_Str"+ context.getStatus()+ "String_Node_Str"+ status);
    }
  }
 else {
    log.warn("String_Node_Str" + groupId + "String_Node_Str"+ instanceId);
  }
}
Program: 116130
Project: 116130
Buggy source:
public VMClusterContext(String clusterId,String serviceId,AutoscalePolicy autoscalePolicy,DeploymentPolicy deploymentPolicy){
  super(clusterId,serviceId);
  this.deploymentPolicy=deploymentPolicy;
  this.networkPartitionCtxts=new HashMap<String,ClusterLevelNetworkPartitionContext>();
  this.autoscalePolicy=autoscalePolicy;
}

Fixed version (ground truth):
public VMClusterContext(String clusterId,String serviceId,AutoscalePolicy autoscalePolicy,DeploymentPolicy deploymentPolicy){
  super(clusterId,serviceId);
  this.deploymentPolicy=deploymentPolicy;
  this.networkPartitionCtxts=new ConcurrentHashMap<String,ClusterLevelNetworkPartitionContext>();
  this.autoscalePolicy=autoscalePolicy;
}
Program: 116131
Project: 116131
Buggy source:
public void movePendingTerminationMemberToObsoleteMembers(String memberId){
  log.info("String_Node_Str" + memberId);
  if (memberId == null) {
    return;
  }
  Iterator<MemberContext> iterator=terminationPendingMembers.listIterator();
  while (iterator.hasNext()) {
    MemberContext terminationPendingMember=iterator.next();
    if (terminationPendingMember == null) {
      iterator.remove();
      continue;
    }
    if (memberId.equals(terminationPendingMember.getMemberId())) {
      log.info("String_Node_Str" + memberId + "String_Node_Str");
      iterator.remove();
      this.obsoletedMembers.put(memberId,terminationPendingMember);
      terminationPendingStartedTime.put(memberId,System.currentTimeMillis());
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str" + "String_Node_Str",memberId));
      }
      break;
    }
  }
}

Fixed version (ground truth):
public void movePendingTerminationMemberToObsoleteMembers(String memberId){
  log.info("String_Node_Str" + memberId);
  if (memberId == null) {
    return;
  }
  Iterator<MemberContext> iterator=terminationPendingMembers.listIterator();
  while (iterator.hasNext()) {
    MemberContext terminationPendingMember=iterator.next();
    if (terminationPendingMember == null) {
      iterator.remove();
      continue;
    }
    if (memberId.equals(terminationPendingMember.getMemberId())) {
      log.info("String_Node_Str" + memberId + "String_Node_Str");
      iterator.remove();
      this.obsoletedMembers.put(memberId,terminationPendingMember);
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str" + "String_Node_Str",memberId));
      }
      break;
    }
  }
}
Program: 116132
Project: 116132
Buggy source:
public void moveActiveMemberToTerminationPendingMembers(String memberId){
  if (memberId == null) {
    return;
  }
synchronized (activeMembers) {
    Iterator<MemberContext> iterator=activeMembers.listIterator();
    while (iterator.hasNext()) {
      MemberContext activeMember=iterator.next();
      if (activeMember == null) {
        iterator.remove();
        continue;
      }
      if (memberId.equals(activeMember.getMemberId())) {
        iterator.remove();
        this.terminationPendingMembers.add(activeMember);
        if (log.isDebugEnabled()) {
          log.debug(String.format("String_Node_Str" + "String_Node_Str",memberId));
        }
        break;
      }
    }
  }
}

Fixed version (ground truth):
public void moveActiveMemberToTerminationPendingMembers(String memberId){
  if (memberId == null) {
    return;
  }
synchronized (activeMembers) {
    Iterator<MemberContext> iterator=activeMembers.listIterator();
    while (iterator.hasNext()) {
      MemberContext activeMember=iterator.next();
      if (activeMember == null) {
        iterator.remove();
        continue;
      }
      if (memberId.equals(activeMember.getMemberId())) {
        iterator.remove();
        this.terminationPendingMembers.add(activeMember);
        terminationPendingStartedTime.put(memberId,System.currentTimeMillis());
        if (log.isDebugEnabled()) {
          log.debug(String.format("String_Node_Str" + "String_Node_Str",memberId));
        }
        break;
      }
    }
  }
}
Program: 116133
Project: 116133
Buggy source:
public void notifyParentMonitor(ClusterStatus status,String instanceId){
  ClusterInstance instance=(ClusterInstance)this.instanceIdToInstanceMap.get(instanceId);
  if (instance == null) {
    log.warn("String_Node_Str" + instanceId + "String_Node_Str");
  }
 else {
    MonitorStatusEventBuilder.handleClusterStatusEvent(this.parent,status,this.clusterId,instanceId);
  }
}

Fixed version (ground truth):
public void notifyParentMonitor(ClusterStatus status,String instanceId){
  ClusterInstance instance=(ClusterInstance)this.instanceIdToInstanceMap.get(instanceId);
  if (instance == null) {
    log.warn("String_Node_Str" + instanceId + "String_Node_Str");
  }
 else {
    if (instance.getStatus() != status) {
      instance.setStatus(status);
    }
    MonitorStatusEventBuilder.handleClusterStatusEvent(this.parent,status,this.clusterId,instanceId);
  }
}
Program: 116134
Project: 116134
Buggy source:
public void run(){
  ClusterInstanceContext instanceContext=getAllNetworkPartitionCtxts().get(networkPartitionId).getClusterInstanceContext(instanceId);
  for (  ClusterLevelPartitionContext partitionContext : instanceContext.getPartitionCtxts()) {
    log.info("String_Node_Str" + getClusterId() + "String_Node_Str"+ instanceContext.getNetworkPartitionId()+ "String_Node_Str"+ partitionContext.getPartitionId()+ "String_Node_Str");
    for (    MemberContext activeMemberCtxt : partitionContext.getActiveMembers()) {
      log.info("String_Node_Str" + activeMemberCtxt.getMemberId());
      terminateMember(activeMemberCtxt.getMemberId());
    }
    for (    MemberContext pendingMemberCtxt : partitionContext.getPendingMembers()) {
      log.info("String_Node_Str" + pendingMemberCtxt.getMemberId());
      terminateMember(pendingMemberCtxt.getMemberId());
    }
    for (    String obsoleteMemberId : partitionContext.getObsoletedMembers().keySet()) {
      log.info("String_Node_Str" + obsoleteMemberId);
      terminateMember(obsoleteMemberId);
    }
  }
}

Fixed version (ground truth):
public void run(){
  ClusterInstanceContext instanceContext=getAllNetworkPartitionCtxts().get(networkPartitionId).getClusterInstanceContext(instanceId);
  for (  ClusterLevelPartitionContext partitionContext : instanceContext.getPartitionCtxts()) {
    log.info("String_Node_Str" + getClusterId() + "String_Node_Str"+ instanceContext.getNetworkPartitionId()+ "String_Node_Str"+ partitionContext.getPartitionId()+ "String_Node_Str");
    Iterator<MemberContext> iterator=partitionContext.getActiveMembers().listIterator();
    while (iterator.hasNext()) {
      MemberContext activeMemberCtxt=iterator.next();
      String memberId=activeMemberCtxt.getMemberId();
      log.info("String_Node_Str" + memberId);
      partitionContext.moveActiveMemberToTerminationPendingMembers(memberId);
      InstanceNotificationPublisher.sendInstanceCleanupEventForMember(memberId);
    }
    Iterator<MemberContext> pendingIterator=partitionContext.getPendingMembers().listIterator();
    while (pendingIterator.hasNext()) {
      MemberContext pendingMemberCtxt=pendingIterator.next();
      String memeberId=pendingMemberCtxt.getMemberId();
      log.info("String_Node_Str" + memeberId + "String_Node_Str");
      partitionContext.movePendingMemberToObsoleteMembers(memeberId);
    }
  }
}
Program: 116135
Project: 116135
Buggy source:
@Override public void terminateAllMembers(final String instanceId,final String networkPartitionId){
  Thread memberTerminator=new Thread(new Runnable(){
    public void run(){
      ClusterInstanceContext instanceContext=getAllNetworkPartitionCtxts().get(networkPartitionId).getClusterInstanceContext(instanceId);
      for (      ClusterLevelPartitionContext partitionContext : instanceContext.getPartitionCtxts()) {
        log.info("String_Node_Str" + getClusterId() + "String_Node_Str"+ instanceContext.getNetworkPartitionId()+ "String_Node_Str"+ partitionContext.getPartitionId()+ "String_Node_Str");
        for (        MemberContext activeMemberCtxt : partitionContext.getActiveMembers()) {
          log.info("String_Node_Str" + activeMemberCtxt.getMemberId());
          terminateMember(activeMemberCtxt.getMemberId());
        }
        for (        MemberContext pendingMemberCtxt : partitionContext.getPendingMembers()) {
          log.info("String_Node_Str" + pendingMemberCtxt.getMemberId());
          terminateMember(pendingMemberCtxt.getMemberId());
        }
        for (        String obsoleteMemberId : partitionContext.getObsoletedMembers().keySet()) {
          log.info("String_Node_Str" + obsoleteMemberId);
          terminateMember(obsoleteMemberId);
        }
      }
    }
  }
,"String_Node_Str" + getClusterId());
  memberTerminator.start();
}

Fixed version (ground truth):
@Override public void terminateAllMembers(final String instanceId,final String networkPartitionId){
  Thread memberTerminator=new Thread(new Runnable(){
    public void run(){
      ClusterInstanceContext instanceContext=getAllNetworkPartitionCtxts().get(networkPartitionId).getClusterInstanceContext(instanceId);
      for (      ClusterLevelPartitionContext partitionContext : instanceContext.getPartitionCtxts()) {
        log.info("String_Node_Str" + getClusterId() + "String_Node_Str"+ instanceContext.getNetworkPartitionId()+ "String_Node_Str"+ partitionContext.getPartitionId()+ "String_Node_Str");
        Iterator<MemberContext> iterator=partitionContext.getActiveMembers().listIterator();
        while (iterator.hasNext()) {
          MemberContext activeMemberCtxt=iterator.next();
          String memberId=activeMemberCtxt.getMemberId();
          log.info("String_Node_Str" + memberId);
          partitionContext.moveActiveMemberToTerminationPendingMembers(memberId);
          InstanceNotificationPublisher.sendInstanceCleanupEventForMember(memberId);
        }
        Iterator<MemberContext> pendingIterator=partitionContext.getPendingMembers().listIterator();
        while (pendingIterator.hasNext()) {
          MemberContext pendingMemberCtxt=pendingIterator.next();
          String memeberId=pendingMemberCtxt.getMemberId();
          log.info("String_Node_Str" + memeberId + "String_Node_Str");
          partitionContext.movePendingMemberToObsoleteMembers(memeberId);
        }
      }
    }
  }
,"String_Node_Str" + getClusterId());
  memberTerminator.start();
}
Program: 116137
Project: 116137
Buggy source:
private static void createClusterInstance(String serviceType,String clusterId,String alias,String instanceId,String partitionId,String networkPartitionId){
  CloudControllerClient.getInstance().createClusterInstance(serviceType,clusterId,alias,instanceId,partitionId,networkPartitionId);
}

Fixed version (ground truth):
public void createClusterInstance(List<String> parentInstanceIds,Cluster cluster) throws PolicyValidationException, PartitionValidationException {
  for (  String parentInstanceId : parentInstanceIds) {
    createInstance(parentInstanceId,cluster);
  }
}