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

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