Program: 116153
Project: 116153
Buggy source:
private boolean validateDeploymentPolicy(DeploymentPolicy deploymentPolicy){
  for (  ChildPolicy childPolicy : deploymentPolicy.getChildPolicies()) {
    String alias=childPolicy.getId();
    ApplicationHolder.acquireReadLock();
    List<Partition> partitionList=new ArrayList<Partition>();
    for (    ChildLevelNetworkPartition networkPartition : childPolicy.getChildLevelNetworkPartitions()) {
      Partition[] partitions=deploymentPolicy.getApplicationLevelNetworkPartition(networkPartition.getId()).getPartitions();
      for (      Partition partition : partitions) {
        partitionList.add(partition);
      }
    }
    try {
      Application application=ApplicationHolder.getApplications().getApplication(deploymentPolicy.getApplicationId());
      Partition[] partitions=new Partition[partitionList.size()];
      Group group=application.getGroupRecursively(alias);
      if (group != null) {
        Set<ClusterDataHolder> clusterDataHolders=group.getClusterDataHoldersOfGroup();
        for (        ClusterDataHolder clusterDataHolder : clusterDataHolders) {
          CloudControllerClient.getInstance().validateDeploymentPolicy(clusterDataHolder.getServiceType(),partitionList.toArray(partitions));
        }
      }
 else {
        ClusterDataHolder clusterDataHolder=application.getClusterDataHolderRecursivelyByAlias(alias);
        if (clusterDataHolder != null) {
          CloudControllerClient.getInstance().validateDeploymentPolicy(clusterDataHolder.getServiceType(),partitionList.toArray(partitions));
        }
      }
    }
 catch (    PartitionValidationException e) {
      log.error("String_Node_Str",e);
    }
 finally {
      ApplicationHolder.releaseReadLock();
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean validateDeploymentPolicy(DeploymentPolicy deploymentPolicy){
  for (  ChildPolicy childPolicy : deploymentPolicy.getChildPolicies()) {
    String alias=childPolicy.getId();
    ApplicationHolder.acquireReadLock();
    List<Partition> partitionList=new ArrayList<Partition>();
    for (    ChildLevelNetworkPartition networkPartition : childPolicy.getChildLevelNetworkPartitions()) {
      Partition[] partitions=deploymentPolicy.getApplicationLevelNetworkPartition(networkPartition.getId()).getPartitions();
      for (      Partition partition : partitions) {
        partitionList.add(partition);
      }
    }
    try {
      Application application=ApplicationHolder.getApplications().getApplication(deploymentPolicy.getApplicationId());
      Partition[] partitions=new Partition[partitionList.size()];
      if (application != null) {
        Group group=application.getGroupRecursively(alias);
        if (group != null) {
          Set<ClusterDataHolder> clusterDataHolders=group.getClusterDataHoldersOfGroup();
          for (          ClusterDataHolder clusterDataHolder : clusterDataHolders) {
            CloudControllerClient.getInstance().validateDeploymentPolicy(clusterDataHolder.getServiceType(),partitionList.toArray(partitions));
          }
        }
 else {
          ClusterDataHolder clusterDataHolder=application.getClusterDataHolderRecursivelyByAlias(alias);
          if (clusterDataHolder != null) {
            CloudControllerClient.getInstance().validateDeploymentPolicy(clusterDataHolder.getServiceType(),partitionList.toArray(partitions));
          }
 else {
            String msg="String_Node_Str" + "String_Node_Str" + alias;
            log.error(msg);
            throw new TopologyInConsistentException(msg);
          }
        }
      }
 else {
        String msg="String_Node_Str" + deploymentPolicy.getApplicationId();
        log.error(msg);
        throw new TopologyInConsistentException(msg);
      }
    }
 catch (    PartitionValidationException e) {
      log.error("String_Node_Str",e);
    }
catch (    TopologyInConsistentException e) {
      log.error("String_Node_Str",e);
    }
 finally {
      ApplicationHolder.releaseReadLock();
    }
  }
  return true;
}