Program: 115464
Project: 115464
Buggy source:
/** 
 * Create application clusters in cloud controller and send application created event.
 * @param application        the application
 * @param appClusterContexts the clusters in the application
 */
public static synchronized void handleApplicationDeployment(Application application,ApplicationClusterContext[] appClusterContexts){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + application.getUniqueIdentifier());
  }
  ApplicationHolder.persistApplication(application);
  for (  ApplicationClusterContext appClusterContext : appClusterContexts) {
    DeploymentPolicy deploymentPolicy=PolicyManager.getInstance().getDeploymentPolicy(appClusterContext.getDeploymentPolicyName());
    if (deploymentPolicy == null) {
      throw new AutoScalerException(String.format("String_Node_Str" + "String_Node_Str",application.getUniqueIdentifier(),appClusterContext.getDeploymentPolicyName()));
    }
    StringBuilder stringBuilder=new StringBuilder();
    for (    NetworkPartitionRef networkPartitionRef : deploymentPolicy.getNetworkPartitionRefs()) {
      if (stringBuilder.length() > 0) {
        stringBuilder.append("String_Node_Str");
      }
      stringBuilder.append(networkPartitionRef.getId());
    }
    Property npIdListProperty=new Property(AutoscalerConstants.NETWORK_PARTITION_ID_LIST,stringBuilder.toString());
    appClusterContext.getProperties().addProperty(npIdListProperty);
  }
  AutoscalerCloudControllerClient.getInstance().createApplicationClusters(application.getUniqueIdentifier(),appClusterContexts);
}

Fixed version (ground truth):
/** 
 * Create application clusters in cloud controller and send application created event.
 * @param application        the application
 * @param appClusterContexts the clusters in the application
 */
public static synchronized void handleApplicationDeployment(Application application,ApplicationClusterContext[] appClusterContexts){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + application.getUniqueIdentifier());
  }
  ApplicationHolder.persistApplication(application);
  for (  ApplicationClusterContext appClusterContext : appClusterContexts) {
    String deploymentPolicyName=appClusterContext.getDeploymentPolicyName();
    if (StringUtils.isEmpty(deploymentPolicyName)) {
      deploymentPolicyName=AutoscalerUtil.getDeploymentPolicyIdByAlias(application.getUniqueIdentifier(),AutoscalerUtil.getAliasFromClusterId(appClusterContext.getClusterId()));
    }
    if (StringUtils.isEmpty(deploymentPolicyName)) {
      throw new AutoScalerException(String.format("String_Node_Str" + "String_Node_Str",application.getUniqueIdentifier(),appClusterContext.getClusterId()));
    }
    DeploymentPolicy deploymentPolicy=PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyName);
    if (deploymentPolicy == null) {
      throw new AutoScalerException(String.format("String_Node_Str" + "String_Node_Str",application.getUniqueIdentifier(),appClusterContext.getClusterId(),appClusterContext.getDeploymentPolicyName()));
    }
    StringBuilder stringBuilder=new StringBuilder();
    for (    NetworkPartitionRef networkPartitionRef : deploymentPolicy.getNetworkPartitionRefs()) {
      if (stringBuilder.length() > 0) {
        stringBuilder.append("String_Node_Str");
      }
      stringBuilder.append(networkPartitionRef.getId());
    }
    Property npIdListProperty=new Property(AutoscalerConstants.NETWORK_PARTITION_ID_LIST,stringBuilder.toString());
    appClusterContext.getProperties().addProperty(npIdListProperty);
  }
  AutoscalerCloudControllerClient.getInstance().createApplicationClusters(application.getUniqueIdentifier(),appClusterContexts);
}