Program: 19156
Project: 19156
Buggy source:
/** 
 * Declares all of a function's parameters inside the function's scope. 
 */
void declareParameters(){
  Node functionNode=currentScope.getRootNode();
  Node astParameters=functionNode.getSecondChild();
  Node iifeArgumentNode=null;
  if (NodeUtil.isInvocationTarget(functionNode)) {
    iifeArgumentNode=functionNode.getNext();
  }
  FunctionType functionType=JSType.toMaybeFunctionType(functionNode.getJSType());
  if (functionType != null) {
    Node jsDocParameters=functionType.getParametersNode();
    if (jsDocParameters != null) {
      Node jsDocParameter=jsDocParameters.getFirstChild();
      for (      Node astParameter : astParameters.children()) {
        JSType declaredType=jsDocParameter == null ? unknownType : jsDocParameter.getJSType();
        declareNamesInPositionalParameter(astParameter,declaredType,iifeArgumentNode);
        if (jsDocParameter != null) {
          jsDocParameter=jsDocParameter.getNext();
        }
        if (iifeArgumentNode != null) {
          iifeArgumentNode=iifeArgumentNode.getNext();
        }
      }
    }
    JSDocInfo info=NodeUtil.getBestJSDocInfo(functionNode);
    if (info != null) {
      Iterable<String> templateNames=Iterables.concat(info.getTemplateTypeNames(),info.getTypeTransformations().keySet());
      if (!Iterables.isEmpty(templateNames)) {
        CompilerInput input=getCompilerInput();
        JSType voidType=typeRegistry.getNativeType(VOID_TYPE);
        for (        String name : templateNames) {
          if (!currentScope.canDeclare(name)) {
            validator.expectUndeclaredVariable(NodeUtil.getSourceName(functionNode),input,functionNode,functionNode.getParent(),currentScope.getVar(name),name,voidType);
          }
          currentScope.declare(name,functionNode,voidType,input,false);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Declares all of a function's parameters inside the function's scope. 
 */
void declareParameters(){
  Node functionNode=currentScope.getRootNode();
  Node astParameters=functionNode.getSecondChild();
  Node iifeArgumentNode=null;
  if (NodeUtil.isInvocationTarget(functionNode)) {
    iifeArgumentNode=functionNode.getNext();
  }
  FunctionType functionType=JSType.toMaybeFunctionType(functionNode.getJSType());
  if (functionType != null) {
    Node jsDocParameters=functionType.getParametersNode();
    if (jsDocParameters != null) {
      Node jsDocParameter=jsDocParameters.getFirstChild();
      for (      Node astParameter : astParameters.children()) {
        if (iifeArgumentNode != null && iifeArgumentNode.isSpread()) {
          iifeArgumentNode=null;
        }
        JSType declaredType=jsDocParameter == null ? unknownType : jsDocParameter.getJSType();
        declareNamesInPositionalParameter(astParameter,declaredType,iifeArgumentNode);
        if (jsDocParameter != null) {
          jsDocParameter=jsDocParameter.getNext();
        }
        if (iifeArgumentNode != null) {
          iifeArgumentNode=iifeArgumentNode.getNext();
        }
      }
    }
    JSDocInfo info=NodeUtil.getBestJSDocInfo(functionNode);
    if (info != null) {
      Iterable<String> templateNames=Iterables.concat(info.getTemplateTypeNames(),info.getTypeTransformations().keySet());
      if (!Iterables.isEmpty(templateNames)) {
        CompilerInput input=getCompilerInput();
        JSType voidType=typeRegistry.getNativeType(VOID_TYPE);
        for (        String name : templateNames) {
          if (!currentScope.canDeclare(name)) {
            validator.expectUndeclaredVariable(NodeUtil.getSourceName(functionNode),input,functionNode,functionNode.getParent(),currentScope.getVar(name),name,voidType);
          }
          currentScope.declare(name,functionNode,voidType,input,false);
        }
      }
    }
  }
}