Program: 14219
Project: 14219
Buggy source:
public DescribeStackResourcesResponseType describeStackResources(DescribeStackResourcesType request) throws CloudFormationException {
  DescribeStackResourcesResponseType reply=request.getReply();
  try {
    final Context ctx=Contexts.lookup();
    checkActionPermission(PolicySpec.CLOUDFORMATION_DESCRIBESTACKRESOURCES,ctx);
    User user=ctx.getUser();
    String userId=user.getUserId();
    String accountId=user.getAccount().getAccountNumber();
    String stackName=request.getStackName();
    String logicalResourceId=request.getLogicalResourceId();
    String physicalResourceId=request.getPhysicalResourceId();
    if (stackName != null && logicalResourceId != null) {
      throw new ValidationErrorException("String_Node_Str");
    }
    if (stackName == null && logicalResourceId == null) {
      throw new ValidationErrorException("String_Node_Str");
    }
    ArrayList<StackResource> stackResourceList=Lists.newArrayList();
    List<StackResourceEntity> stackResourceEntityList=StackResourceEntityManager.describeStackResources(accountId,stackName,physicalResourceId,logicalResourceId);
    if (stackResourceEntityList != null) {
      for (      StackResourceEntity stackResourceEntity : stackResourceEntityList) {
        StackResource stackResource=new StackResource();
        stackResource.setDescription(stackResourceEntity.getDescription());
        stackResource.setLogicalResourceId(stackResourceEntity.getLogicalResourceId());
        stackResource.setPhysicalResourceId(stackResourceEntity.getPhysicalResourceId());
        stackResource.setResourceStatus(stackResourceEntity.getResourceStatus().toString());
        stackResource.setResourceStatusReason(stackResourceEntity.getResourceStatusReason());
        stackResource.setResourceType(stackResourceEntity.getResourceType());
        stackResource.setStackId(stackResourceEntity.getStackId());
        stackResource.setStackName(stackResourceEntity.getStackName());
        stackResource.setTimestamp(stackResourceEntity.getLastUpdateTimestamp());
        stackResourceList.add(stackResource);
      }
    }
    DescribeStackResourcesResult describeStackResourcesResult=new DescribeStackResourcesResult();
    StackResources stackResources=new StackResources();
    stackResources.setMember(stackResourceList);
    describeStackResourcesResult.setStackResources(stackResources);
    reply.setDescribeStackResourcesResult(describeStackResourcesResult);
  }
 catch (  Exception ex) {
    handleException(ex);
  }
  return reply;
}

Fixed version (ground truth):
public DescribeStackResourcesResponseType describeStackResources(DescribeStackResourcesType request) throws CloudFormationException {
  DescribeStackResourcesResponseType reply=request.getReply();
  try {
    final Context ctx=Contexts.lookup();
    checkActionPermission(PolicySpec.CLOUDFORMATION_DESCRIBESTACKRESOURCES,ctx);
    User user=ctx.getUser();
    String userId=user.getUserId();
    String accountId=user.getAccount().getAccountNumber();
    String stackName=request.getStackName();
    String logicalResourceId=request.getLogicalResourceId();
    String physicalResourceId=request.getPhysicalResourceId();
    if (stackName != null && logicalResourceId != null) {
      throw new ValidationErrorException("String_Node_Str");
    }
    if (stackName == null && logicalResourceId == null) {
      throw new ValidationErrorException("String_Node_Str");
    }
    ArrayList<StackResource> stackResourceList=Lists.newArrayList();
    List<StackResourceEntity> stackResourceEntityList=StackResourceEntityManager.describeStackResources(accountId,stackName,physicalResourceId,logicalResourceId);
    if (stackResourceEntityList != null) {
      for (      StackResourceEntity stackResourceEntity : stackResourceEntityList) {
        StackResource stackResource=new StackResource();
        stackResource.setDescription(stackResourceEntity.getDescription());
        stackResource.setLogicalResourceId(stackResourceEntity.getLogicalResourceId());
        stackResource.setPhysicalResourceId(stackResourceEntity.getPhysicalResourceId());
        stackResource.setResourceStatus(stackResourceEntity.getResourceStatus().toString());
        stackResource.setResourceStatusReason(stackResourceEntity.getResourceStatusReason());
        stackResource.setResourceType(stackResourceEntity.getResourceType());
        stackResource.setStackId(stackResourceEntity.getStackId());
        stackResource.setStackName(stackResourceEntity.getStackName());
        stackResource.setTimestamp(stackResourceEntity.getLastUpdateTimestamp());
        stackResourceList.add(stackResource);
      }
    }
    DescribeStackResourcesResult describeStackResourcesResult=new DescribeStackResourcesResult();
    StackResources stackResources=new StackResources();
    stackResources.setMember(stackResourceList);
    describeStackResourcesResult.setStackResources(stackResources);
    reply.setDescribeStackResourcesResult(describeStackResourcesResult);
  }
 catch (  Exception ex) {
    LOG.error(ex,ex);
    handleException(ex);
  }
  return reply;
}