Program: 27369
Project: 27369
Buggy source:
/** 
 * Returns whether two nodes are equivalent, taking into account the template parameters that were provided to this matcher. If the template comparison node is a parameter node, then only the types of the node must match. Otherwise, the node must be equal and the child nodes must be equivalent according to the same function. This differs from the built in Node equivalence function with the special comparison.
 */
private boolean matchesNode(Node template,Node ast){
  if (isTemplateParameterNode(template)) {
    int paramIndex=(int)(template.getDouble());
    Node previousMatch=paramNodeMatches.get(paramIndex);
    if (previousMatch != null) {
      return ast.isEquivalentTo(previousMatch);
    }
    JSType templateType=template.getJSType();
    Preconditions.checkNotNull(templateType,"String_Node_Str");
    if (templateType.isNoResolvedType()) {
      return false;
    }
    MatchResult matchResult=typeMatchingStrategy.match(templateType,ast.getJSType());
    isLooseMatch=matchResult.isLooseMatch();
    boolean isMatch=matchResult.isMatch();
    if (isMatch && previousMatch == null) {
      paramNodeMatches.set(paramIndex,ast);
    }
    return isMatch;
  }
 else   if (isTemplateLocalNameNode(template)) {
    int paramIndex=(int)(template.getDouble());
    boolean previouslyMatched=this.localVarMatches.get(paramIndex) != null;
    if (previouslyMatched) {
      return ast.getString().equals(this.localVarMatches.get(paramIndex));
    }
 else {
      this.localVarMatches.set(paramIndex,ast.getString());
    }
  }
  Node templateChild=template.getFirstChild();
  Node astChild=ast.getFirstChild();
  while (templateChild != null) {
    if (!matchesNode(templateChild,astChild)) {
      return false;
    }
    templateChild=templateChild.getNext();
    astChild=astChild.getNext();
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Returns whether two nodes are equivalent, taking into account the template parameters that were provided to this matcher. If the template comparison node is a parameter node, then only the types of the node must match. Otherwise, the node must be equal and the child nodes must be equivalent according to the same function. This differs from the built in Node equivalence function with the special comparison.
 */
private boolean matchesNode(Node template,Node ast){
  if (isTemplateParameterNode(template)) {
    int paramIndex=(int)(template.getDouble());
    Node previousMatch=paramNodeMatches.get(paramIndex);
    if (previousMatch != null) {
      return ast.isEquivalentTo(previousMatch);
    }
    JSType templateType=template.getJSType();
    Preconditions.checkNotNull(templateType,"String_Node_Str");
    if (isUnresolvedType(templateType)) {
      return false;
    }
    MatchResult matchResult=typeMatchingStrategy.match(templateType,ast.getJSType());
    isLooseMatch=matchResult.isLooseMatch();
    boolean isMatch=matchResult.isMatch();
    if (isMatch && previousMatch == null) {
      paramNodeMatches.set(paramIndex,ast);
    }
    return isMatch;
  }
 else   if (isTemplateLocalNameNode(template)) {
    int paramIndex=(int)(template.getDouble());
    boolean previouslyMatched=this.localVarMatches.get(paramIndex) != null;
    if (previouslyMatched) {
      return ast.getString().equals(this.localVarMatches.get(paramIndex));
    }
 else {
      this.localVarMatches.set(paramIndex,ast.getString());
    }
  }
  Node templateChild=template.getFirstChild();
  Node astChild=ast.getFirstChild();
  while (templateChild != null) {
    if (!matchesNode(templateChild,astChild)) {
      return false;
    }
    templateChild=templateChild.getNext();
    astChild=astChild.getNext();
  }
  return true;
}