Program: 115552
Project: 115552
Buggy source:
/** 
 * Validate whether all the deployment policies used in the application are using the same network partitions of Application policy
 */
private static boolean isAppUsingNetworkPartitionId(String applicationId,String networkPartitionId){
  if (applicationId == null || StringUtils.isBlank(applicationId) || networkPartitionId == null || StringUtils.isBlank(networkPartitionId)) {
    return false;
  }
  List<String> deploymentPolicyIdsReferredInApplication=AutoscalerUtil.getDeploymentPolicyIdsReferredInApplication(applicationId);
  if (deploymentPolicyIdsReferredInApplication == null) {
    return false;
  }
  int referencesOfNetworkPartition=0;
  for (  String deploymentPolicyIDReferredInApp : deploymentPolicyIdsReferredInApplication) {
    try {
      DeploymentPolicy deploymentPolicyInApp=PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyIDReferredInApp);
      if (deploymentPolicyInApp != null) {
        for (        NetworkPartitionRef networkPartitionOfDeploymentPolicy : deploymentPolicyInApp.getNetworkPartitionRefs()) {
          if (networkPartitionOfDeploymentPolicy != null) {
            if (networkPartitionOfDeploymentPolicy != null && networkPartitionOfDeploymentPolicy.getUuid().equals(networkPartitionId)) {
              referencesOfNetworkPartition++;
            }
          }
        }
      }
    }
 catch (    Exception e) {
      String msg=String.format("String_Node_Str",deploymentPolicyIDReferredInApp);
      log.error(msg,e);
      throw new AutoScalerException(msg,e);
    }
  }
  if (deploymentPolicyIdsReferredInApplication.size() == referencesOfNetworkPartition) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Validate whether all the deployment policies used in the application are using the same network partitions of Application policy
 */
private static boolean isAppUsingNetworkPartitionId(String applicationUuid,String networkPartitionUuid){
  if (applicationUuid == null || StringUtils.isBlank(applicationUuid) || networkPartitionUuid == null || StringUtils.isBlank(networkPartitionUuid)) {
    return false;
  }
  List<String> deploymentPolicyIdsReferredInApplication=AutoscalerUtil.getDeploymentPolicyIdsReferredInApplication(applicationUuid);
  if (deploymentPolicyIdsReferredInApplication == null) {
    return false;
  }
  int referencesOfNetworkPartition=0;
  for (  String deploymentPolicyIDReferredInApp : deploymentPolicyIdsReferredInApplication) {
    try {
      DeploymentPolicy deploymentPolicyInApp=PolicyManager.getInstance().getDeploymentPolicy(deploymentPolicyIDReferredInApp);
      if (deploymentPolicyInApp != null) {
        for (        NetworkPartitionRef networkPartitionOfDeploymentPolicy : deploymentPolicyInApp.getNetworkPartitionRefs()) {
          if (networkPartitionOfDeploymentPolicy != null) {
            if (networkPartitionOfDeploymentPolicy != null && networkPartitionOfDeploymentPolicy.getUuid().equals(networkPartitionUuid)) {
              referencesOfNetworkPartition++;
            }
          }
        }
      }
    }
 catch (    Exception e) {
      String msg=String.format("String_Node_Str",deploymentPolicyIDReferredInApp);
      log.error(msg,e);
      throw new AutoScalerException(msg,e);
    }
  }
  if (deploymentPolicyIdsReferredInApplication.size() == referencesOfNetworkPartition) {
    return true;
  }
  return false;
}