Program: 14204
Project: 14204
Buggy source:
private void conditionDependencyCrawl(String originalConditionName,JsonNode currentNode,DependencyManager conditionDependencyManager,Template template,Set<String> resourceReferences,Set<String> unresolvedConditionDependencies) throws CloudFormationException {
  if (currentNode == null)   return;
  if (currentNode.isArray()) {
    for (int i=0; i < currentNode.size(); i++) {
      conditionDependencyCrawl(originalConditionName,currentNode.get(i),conditionDependencyManager,template,resourceReferences,unresolvedConditionDependencies);
    }
  }
 else   if (!currentNode.isObject()) {
    return;
  }
  IntrinsicFunction.MatchResult ifMatcher=IntrinsicFunctions.IF.evaluateMatch(currentNode);
  if (ifMatcher.isMatch()) {
    IntrinsicFunctions.IF.validateArgTypesWherePossible(ifMatcher);
    String conditionName=currentNode.get(FunctionEvaluation.FN_IF).get(0).textValue();
    if (!conditionDependencyManager.containsNode(conditionName)) {
      unresolvedConditionDependencies.add(conditionName);
    }
 else {
      conditionDependencyManager.addDependency(originalConditionName,conditionName);
    }
    return;
  }
  IntrinsicFunction.MatchResult conditionMatcher=IntrinsicFunctions.CONDITION.evaluateMatch(currentNode);
  if (conditionMatcher.isMatch()) {
    IntrinsicFunctions.CONDITION.validateArgTypesWherePossible(conditionMatcher);
    String conditionName=currentNode.get(FunctionEvaluation.CONDITION_STR).textValue();
    if (!conditionDependencyManager.containsNode(conditionName)) {
      unresolvedConditionDependencies.add(conditionName);
    }
 else {
      conditionDependencyManager.addDependency(originalConditionName,conditionName);
    }
    return;
  }
  IntrinsicFunction.MatchResult refMatcher=IntrinsicFunctions.REF.evaluateMatch(currentNode);
  if (refMatcher.isMatch()) {
    IntrinsicFunctions.REF.validateArgTypesWherePossible(refMatcher);
    String refName=currentNode.get(FunctionEvaluation.REF_STR).textValue();
    Map<String,String> pseudoParameterMap=StackEntityHelper.jsonToPseudoParameterMap(template.getStackEntity().getPseudoParameterMapJson());
    Map<String,StackEntity.Parameter> parameterMap=StackEntityHelper.jsonToParameterMap(template.getStackEntity().getParametersJson());
    if (!pseudoParameterMap.containsKey(refName) && !parameterMap.containsKey(refName)) {
      resourceReferences.add(refName);
    }
    return;
  }
  IntrinsicFunction.MatchResult fnAttMatcher=IntrinsicFunctions.GET_ATT.evaluateMatch(currentNode);
  if (fnAttMatcher.isMatch()) {
    IntrinsicFunctions.GET_ATT.validateArgTypesWherePossible(refMatcher);
    String refName=currentNode.get(FunctionEvaluation.FN_GET_ATT).get(0).textValue();
    String attName=currentNode.get(FunctionEvaluation.FN_GET_ATT).get(1).textValue();
    if (template.getResourceInfoMap().containsKey(refName)) {
      ResourceInfo resourceInfo=template.getResourceInfoMap().get(refName);
      if (resourceInfo.canCheckAttributes() && !ResourceAttributeResolver.resourceHasAttribute(resourceInfo,attName)) {
        throw new ValidationErrorException("String_Node_Str" + refName + "String_Node_Str"+ attName+ "String_Node_Str");
      }
 else {
        resourceReferences.add(refName);
      }
    }
    return;
  }
  List<String> fieldNames=Lists.newArrayList(currentNode.fieldNames());
  for (  String fieldName : fieldNames) {
    conditionDependencyCrawl(originalConditionName,currentNode.get(fieldName),conditionDependencyManager,template,resourceReferences,unresolvedConditionDependencies);
  }
}

Fixed version (ground truth):
private void conditionDependencyCrawl(String originalConditionName,JsonNode currentNode,DependencyManager conditionDependencyManager,Template template,Set<String> resourceReferences,Set<String> unresolvedConditionDependencies) throws CloudFormationException {
  if (currentNode == null)   return;
  if (currentNode.isArray()) {
    for (int i=0; i < currentNode.size(); i++) {
      conditionDependencyCrawl(originalConditionName,currentNode.get(i),conditionDependencyManager,template,resourceReferences,unresolvedConditionDependencies);
    }
  }
 else   if (!currentNode.isObject()) {
    return;
  }
  IntrinsicFunction.MatchResult ifMatcher=IntrinsicFunctions.IF.evaluateMatch(currentNode);
  if (ifMatcher.isMatch()) {
    IntrinsicFunctions.IF.validateArgTypesWherePossible(ifMatcher);
    String conditionName=currentNode.get(FunctionEvaluation.FN_IF).get(0).textValue();
    if (!conditionDependencyManager.containsNode(conditionName)) {
      unresolvedConditionDependencies.add(conditionName);
    }
 else {
      conditionDependencyManager.addDependency(originalConditionName,conditionName);
    }
    return;
  }
  IntrinsicFunction.MatchResult conditionMatcher=IntrinsicFunctions.CONDITION.evaluateMatch(currentNode);
  if (conditionMatcher.isMatch()) {
    IntrinsicFunctions.CONDITION.validateArgTypesWherePossible(conditionMatcher);
    String conditionName=currentNode.get(FunctionEvaluation.CONDITION_STR).textValue();
    if (!conditionDependencyManager.containsNode(conditionName)) {
      unresolvedConditionDependencies.add(conditionName);
    }
 else {
      conditionDependencyManager.addDependency(originalConditionName,conditionName);
    }
    return;
  }
  IntrinsicFunction.MatchResult refMatcher=IntrinsicFunctions.REF.evaluateMatch(currentNode);
  if (refMatcher.isMatch()) {
    IntrinsicFunctions.REF.validateArgTypesWherePossible(refMatcher);
    String refName=currentNode.get(FunctionEvaluation.REF_STR).textValue();
    Map<String,String> pseudoParameterMap=StackEntityHelper.jsonToPseudoParameterMap(template.getStackEntity().getPseudoParameterMapJson());
    Map<String,StackEntity.Parameter> parameterMap=StackEntityHelper.jsonToParameterMap(template.getStackEntity().getParametersJson());
    if (!pseudoParameterMap.containsKey(refName) && !parameterMap.containsKey(refName)) {
      resourceReferences.add(refName);
    }
    return;
  }
  IntrinsicFunction.MatchResult fnAttMatcher=IntrinsicFunctions.GET_ATT.evaluateMatch(currentNode);
  if (fnAttMatcher.isMatch()) {
    IntrinsicFunctions.GET_ATT.validateArgTypesWherePossible(fnAttMatcher);
    String refName=currentNode.get(FunctionEvaluation.FN_GET_ATT).get(0).textValue();
    String attName=currentNode.get(FunctionEvaluation.FN_GET_ATT).get(1).textValue();
    if (template.getResourceInfoMap().containsKey(refName)) {
      ResourceInfo resourceInfo=template.getResourceInfoMap().get(refName);
      if (resourceInfo.canCheckAttributes() && !ResourceAttributeResolver.resourceHasAttribute(resourceInfo,attName)) {
        throw new ValidationErrorException("String_Node_Str" + refName + "String_Node_Str"+ attName+ "String_Node_Str");
      }
 else {
        resourceReferences.add(refName);
      }
    }
    return;
  }
  List<String> fieldNames=Lists.newArrayList(currentNode.fieldNames());
  for (  String fieldName : fieldNames) {
    conditionDependencyCrawl(originalConditionName,currentNode.get(fieldName),conditionDependencyManager,template,resourceReferences,unresolvedConditionDependencies);
  }
}