Program: 14090
Project: 14090
Buggy source:
public SignalResourceResponseType signalResource(SignalResourceType request) throws CloudFormationException {
  SignalResourceResponseType reply=request.getReply();
  try {
    final Context ctx=Contexts.lookup();
    final User user=ctx.getUser();
    final String userId=user.getUserId();
    final String accountId=user.getAccountNumber();
    final String accountAlias=ctx.getAccountAlias();
    final String stackName=request.getStackName();
    final String logicalResourceId=request.getLogicalResourceId();
    final String status=request.getStatus();
    final String uniqueId=request.getUniqueId();
    if (stackName == null) {
      throw new ValidationErrorException("String_Node_Str");
    }
    if (logicalResourceId == null) {
      throw new ValidationErrorException("String_Node_Str");
    }
    if (uniqueId == null) {
      throw new ValidationErrorException("String_Node_Str");
    }
    if (status == null) {
      throw new ValidationErrorException("String_Node_Str");
    }
    if (!"String_Node_Str".equals(status) && !"String_Node_Str".equals(status)) {
      throw new ValidationErrorException("String_Node_Str");
    }
    checkStackPermission(ctx,stackName,accountId);
    final StackEntity stackEntity=StackEntityManager.getNonDeletedStackByNameOrId(stackName,accountId);
    if (stackEntity == null) {
      throw new ValidationErrorException("String_Node_Str" + stackName + "String_Node_Str");
    }
    final String stackId=stackEntity.getStackId();
    if (stackEntity.getStackStatus() != Status.CREATE_IN_PROGRESS && stackEntity.getStackStatus() != Status.UPDATE_IN_PROGRESS && stackEntity.getStackStatus() != Status.UPDATE_ROLLBACK_IN_PROGRESS) {
      throw new ValidationErrorException("String_Node_Str" + stackId + "String_Node_Str"+ stackEntity.getStackStatus().toString()+ "String_Node_Str");
    }
    final StackResourceEntity stackResourceEntity=StackResourceEntityManager.getStackResource(stackId,accountId,logicalResourceId,stackEntity.getStackVersion());
    if (stackResourceEntity == null) {
      throw new ValidationErrorException("String_Node_Str" + logicalResourceId + "String_Node_Str"+ stackName);
    }
    ResourceInfo resourceInfo=StackResourceEntityManager.getResourceInfo(stackResourceEntity);
    if (!resourceInfo.supportsSignals()) {
      throw new ValidationErrorException("String_Node_Str" + logicalResourceId + "String_Node_Str"+ resourceInfo.getType()+ "String_Node_Str");
    }
    if (stackResourceEntity.getResourceStatus() != Status.CREATE_IN_PROGRESS && stackResourceEntity.getResourceStatus() != Status.UPDATE_IN_PROGRESS) {
      throw new ValidationErrorException("String_Node_Str" + logicalResourceId + "String_Node_Str"+ stackEntity.getStackStatus().toString()+ "String_Node_Str");
    }
    SignalEntity signal=SignalEntityManager.getSignal(stackId,accountId,logicalResourceId,stackResourceEntity.getResourceVersion(),uniqueId);
    if (signal != null && !"String_Node_Str".equals(status)) {
      throw new ValidationErrorException("String_Node_Str" + uniqueId + "String_Node_Str"+ logicalResourceId+ "String_Node_Str");
    }
    if (signal != null) {
      signal.setStatus(SignalEntity.Status.valueOf(status));
      signal.setProcessed(false);
      SignalEntityManager.updateSignal(signal);
    }
 else {
      signal=new SignalEntity();
      signal.setStackId(stackId);
      signal.setAccountId(accountId);
      signal.setLogicalResourceId(logicalResourceId);
      signal.setResourceVersion(stackResourceEntity.getResourceVersion());
      signal.setUniqueId(uniqueId);
      signal.setStatus(SignalEntity.Status.valueOf(status));
      SignalEntityManager.addSignal(signal);
    }
    SignalResourceResult signalResourceResult=new SignalResourceResult();
    reply.setSignalResourceResult(signalResourceResult);
  }
 catch (  Exception ex) {
    handleException(ex);
  }
  return reply;
}

Fixed version (ground truth):
public SignalResourceResponseType signalResource(SignalResourceType request) throws CloudFormationException {
  SignalResourceResponseType reply=request.getReply();
  try {
    final Context ctx=Contexts.lookup();
    final User user=ctx.getUser();
    final String userId=user.getUserId();
    final String accountId=user.getAccountNumber();
    final String accountAlias=ctx.getAccountAlias();
    final String stackName=request.getStackName();
    final String logicalResourceId=request.getLogicalResourceId();
    final String status=request.getStatus();
    final String uniqueId=request.getUniqueId();
    if (stackName == null) {
      throw new ValidationErrorException("String_Node_Str");
    }
    if (logicalResourceId == null) {
      throw new ValidationErrorException("String_Node_Str");
    }
    if (uniqueId == null) {
      throw new ValidationErrorException("String_Node_Str");
    }
    if (status == null) {
      throw new ValidationErrorException("String_Node_Str");
    }
    if (!"String_Node_Str".equals(status) && !"String_Node_Str".equals(status)) {
      throw new ValidationErrorException("String_Node_Str");
    }
    checkStackPermission(ctx,stackName,accountId);
    final StackEntity stackEntity=StackEntityManager.getNonDeletedStackByNameOrId(stackName,accountId);
    if (stackEntity == null) {
      throw new ValidationErrorException("String_Node_Str" + stackName + "String_Node_Str");
    }
    final String stackId=stackEntity.getStackId();
    if (stackEntity.getStackStatus() != Status.CREATE_IN_PROGRESS && stackEntity.getStackStatus() != Status.UPDATE_IN_PROGRESS && stackEntity.getStackStatus() != Status.UPDATE_ROLLBACK_IN_PROGRESS) {
      throw new ValidationErrorException("String_Node_Str" + stackId + "String_Node_Str"+ stackEntity.getStackStatus().toString()+ "String_Node_Str");
    }
    final StackResourceEntity stackResourceEntity=StackResourceEntityManager.getStackResource(stackId,accountId,logicalResourceId,stackEntity.getStackVersion());
    if (stackResourceEntity == null) {
      throw new ValidationErrorException("String_Node_Str" + logicalResourceId + "String_Node_Str"+ stackName);
    }
    ResourceInfo resourceInfo=StackResourceEntityManager.getResourceInfo(stackResourceEntity);
    if (!resourceInfo.supportsSignals()) {
      throw new ValidationErrorException("String_Node_Str" + logicalResourceId + "String_Node_Str"+ resourceInfo.getType()+ "String_Node_Str");
    }
    if (stackResourceEntity.getResourceStatus() != Status.CREATE_IN_PROGRESS && stackResourceEntity.getResourceStatus() != Status.UPDATE_IN_PROGRESS) {
      throw new ValidationErrorException("String_Node_Str" + logicalResourceId + "String_Node_Str"+ stackResourceEntity.getResourceStatus().toString()+ "String_Node_Str");
    }
    SignalEntity signal=SignalEntityManager.getSignal(stackId,accountId,logicalResourceId,stackResourceEntity.getResourceVersion(),uniqueId);
    if (signal != null && !"String_Node_Str".equals(status)) {
      throw new ValidationErrorException("String_Node_Str" + uniqueId + "String_Node_Str"+ logicalResourceId+ "String_Node_Str");
    }
    if (signal != null) {
      signal.setStatus(SignalEntity.Status.valueOf(status));
      signal.setProcessed(false);
      SignalEntityManager.updateSignal(signal);
    }
 else {
      signal=new SignalEntity();
      signal.setStackId(stackId);
      signal.setAccountId(accountId);
      signal.setLogicalResourceId(logicalResourceId);
      signal.setResourceVersion(stackResourceEntity.getResourceVersion());
      signal.setUniqueId(uniqueId);
      signal.setStatus(SignalEntity.Status.valueOf(status));
      SignalEntityManager.addSignal(signal);
    }
    SignalResourceResult signalResourceResult=new SignalResourceResult();
    reply.setSignalResourceResult(signalResourceResult);
  }
 catch (  Exception ex) {
    handleException(ex);
  }
  return reply;
}