Program: 116541
Project: 116541
Buggy source:
@Override public MemberContext startContainers(MemberContext memberContext) throws UnregisteredCartridgeException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
  if (memberContext == null) {
    String msg="String_Node_Str";
    log.error(msg);
    throw new IllegalArgumentException(msg);
  }
  String clusterId=memberContext.getClusterId();
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + memberContext.toString());
  }
  ClusterContext ctxt=dataHolder.getClusterContext(clusterId);
  if (ctxt == null) {
    String msg="String_Node_Str" + memberContext.toString();
    log.error(msg);
    throw new IllegalArgumentException(msg);
  }
  String cartridgeType=ctxt.getCartridgeType();
  Cartridge cartridge=dataHolder.getCartridge(cartridgeType);
  if (cartridge == null) {
    String msg="String_Node_Str" + cartridgeType + "String_Node_Str"+ memberContext.toString();
    log.error(msg);
    throw new UnregisteredCartridgeException(msg);
  }
  memberContext.setCartridgeType(cartridgeType);
  try {
    String memberID=generateMemberId(clusterId);
    memberContext.setMemberId(memberID);
    String kubernetesClusterId=CloudControllerUtil.getProperty(ctxt.getProperties(),StratosConstants.KUBERNETES_CLUSTER_ID);
    if (kubernetesClusterId == null) {
      String msg="String_Node_Str" + StratosConstants.KUBERNETES_CLUSTER_ID + "String_Node_Str"+ ctxt;
      log.error(msg);
      throw new IllegalArgumentException(msg);
    }
    String kubernetesMasterIp=CloudControllerUtil.getProperty(memberContext.getProperties(),StratosConstants.KUBERNETES_MASTER_IP);
    if (kubernetesMasterIp == null) {
      String msg="String_Node_Str" + StratosConstants.KUBERNETES_MASTER_IP + "String_Node_Str"+ memberContext;
      log.error(msg);
      throw new IllegalArgumentException(msg);
    }
    String kubernetesPortRange=CloudControllerUtil.getProperty(memberContext.getProperties(),StratosConstants.KUBERNETES_PORT_RANGE);
    if (kubernetesPortRange == null) {
      String msg="String_Node_Str" + StratosConstants.KUBERNETES_PORT_RANGE + "String_Node_Str"+ memberContext;
      log.error(msg);
      throw new IllegalArgumentException(msg);
    }
    KubernetesClusterContext kubClusterContext=getKubernetesClusterContext(kubernetesClusterId,kubernetesMasterIp,kubernetesPortRange);
    if (kubClusterContext == null) {
      String msg="String_Node_Str" + memberContext;
      log.error(msg);
      throw new IllegalArgumentException(msg);
    }
    KubernetesApiClient kubApi=kubClusterContext.getKubApi();
    MemberContextToReplicationController controllerFunction=new MemberContextToReplicationController();
    ReplicationController controller=controllerFunction.apply(memberContext);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + controller + "String_Node_Str"+ memberContext+ "String_Node_Str");
    }
    kubApi.createReplicationController(controller);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + controller + "String_Node_Str");
    }
    MemberContextToKubernetesService serviceFunction=new MemberContextToKubernetesService();
    Service service=serviceFunction.apply(memberContext);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + service + "String_Node_Str"+ memberContext+ "String_Node_Str");
    }
    kubApi.createService(service);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + controller + "String_Node_Str");
    }
    memberContext.setPublicIpAddress(kubernetesMasterIp);
    memberContext.setPrivateIpAddress(kubernetesMasterIp);
    dataHolder.addMemberContext(memberContext);
    persist();
    TopologyBuilder.handleMemberSpawned(cartridgeType,clusterId,null,kubernetesMasterIp,kubernetesMasterIp,memberContext);
    log.info("String_Node_Str" + memberContext.toString());
    return memberContext;
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + memberContext.toString() + "String_Node_Str"+ e.getMessage();
    log.error(msg,e);
    throw new IllegalStateException(msg,e);
  }
}

Fixed version (ground truth):
@Override public MemberContext startContainers(MemberContext memberContext) throws UnregisteredCartridgeException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
  if (memberContext == null) {
    String msg="String_Node_Str";
    log.error(msg);
    throw new IllegalArgumentException(msg);
  }
  String clusterId=memberContext.getClusterId();
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + memberContext.toString());
  }
  ClusterContext ctxt=dataHolder.getClusterContext(clusterId);
  if (ctxt == null) {
    String msg="String_Node_Str" + memberContext.toString();
    log.error(msg);
    throw new IllegalArgumentException(msg);
  }
  String cartridgeType=ctxt.getCartridgeType();
  Cartridge cartridge=dataHolder.getCartridge(cartridgeType);
  if (cartridge == null) {
    String msg="String_Node_Str" + cartridgeType + "String_Node_Str"+ memberContext.toString();
    log.error(msg);
    throw new UnregisteredCartridgeException(msg);
  }
  memberContext.setCartridgeType(cartridgeType);
  try {
    String memberID=generateMemberId(clusterId);
    memberContext.setMemberId(memberID);
    String kubernetesClusterId=CloudControllerUtil.getProperty(ctxt.getProperties(),StratosConstants.KUBERNETES_CLUSTER_ID);
    if (kubernetesClusterId == null) {
      String msg="String_Node_Str" + StratosConstants.KUBERNETES_CLUSTER_ID + "String_Node_Str"+ ctxt;
      log.error(msg);
      throw new IllegalArgumentException(msg);
    }
    String kubernetesMasterIp=CloudControllerUtil.getProperty(memberContext.getProperties(),StratosConstants.KUBERNETES_MASTER_IP);
    if (kubernetesMasterIp == null) {
      String msg="String_Node_Str" + StratosConstants.KUBERNETES_MASTER_IP + "String_Node_Str"+ memberContext;
      log.error(msg);
      throw new IllegalArgumentException(msg);
    }
    String kubernetesPortRange=CloudControllerUtil.getProperty(memberContext.getProperties(),StratosConstants.KUBERNETES_PORT_RANGE);
    if (kubernetesPortRange == null) {
      String msg="String_Node_Str" + StratosConstants.KUBERNETES_PORT_RANGE + "String_Node_Str"+ memberContext;
      log.error(msg);
      throw new IllegalArgumentException(msg);
    }
    KubernetesClusterContext kubClusterContext=getKubernetesClusterContext(kubernetesClusterId,kubernetesMasterIp,kubernetesPortRange);
    KubernetesApiClient kubApi=kubClusterContext.getKubApi();
    MemberContextToReplicationController controllerFunction=new MemberContextToReplicationController();
    ReplicationController controller=controllerFunction.apply(memberContext);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + controller + "String_Node_Str"+ memberContext+ "String_Node_Str");
    }
    kubApi.createReplicationController(controller);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + controller + "String_Node_Str");
    }
    MemberContextToKubernetesService serviceFunction=new MemberContextToKubernetesService();
    Service service=serviceFunction.apply(memberContext);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + service + "String_Node_Str"+ memberContext+ "String_Node_Str");
    }
    kubApi.createService(service);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + controller + "String_Node_Str");
    }
    memberContext.setPublicIpAddress(kubernetesMasterIp);
    memberContext.setPrivateIpAddress(kubernetesMasterIp);
    dataHolder.addMemberContext(memberContext);
    persist();
    TopologyBuilder.handleMemberSpawned(cartridgeType,clusterId,null,kubernetesMasterIp,kubernetesMasterIp,memberContext);
    log.info("String_Node_Str" + memberContext.toString());
    return memberContext;
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + memberContext.toString() + "String_Node_Str"+ e.getMessage();
    log.error(msg,e);
    throw new IllegalStateException(msg,e);
  }
}