nus-yam/ex-repair huggingface dataset:
Program: 27453
Project: 27453
Buggy source:
public void testVarDefinitionsInExterns(){
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str");
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str");
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str");
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str");
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str");
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str",NewTypeInference.INVALID_OPERAND_TYPE);
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str");
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str",NewTypeInference.MISTYPED_ASSIGN_RHS);
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str",Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
}

Fixed version (ground truth):
public void testVarDefinitionsInExterns(){
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str");
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str");
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str");
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str");
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str",NewTypeInference.INVALID_OPERAND_TYPE);
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str",NewTypeInference.INVALID_OPERAND_TYPE);
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str");
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str","String_Node_Str",NewTypeInference.MISTYPED_ASSIGN_RHS);
  typeCheckCustomExterns(DEFAULT_EXTERNS + "String_Node_Str",Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
}
Program: 27454
Project: 27454
Buggy source:
public static SuggestedFix getFixForJsError(JSError error,AbstractCompiler compiler){
switch (error.getType().key) {
case "String_Node_Str":
    return getFixForDebuggerStatement(error);
case "String_Node_Str":
  return getFixForInexistentProperty(error);
case "String_Node_Str":
return getFixForMissingRequire(error,compiler);
case "String_Node_Str":
case "String_Node_Str":
return getFixForExtraRequire(error,compiler);
case "String_Node_Str":
return getFixForUnnecessaryCast(error,compiler);
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Creates a SuggestedFix for the given error. Note that some errors have multiple fixes so getFixesForJsError should often be used instead of this.
 */
public static SuggestedFix getFixForJsError(JSError error,AbstractCompiler compiler){
switch (error.getType().key) {
case "String_Node_Str":
    return getFixForDebuggerStatement(error);
case "String_Node_Str":
  return getFixForInexistentProperty(error);
case "String_Node_Str":
return getFixForMissingRequire(error,compiler);
case "String_Node_Str":
case "String_Node_Str":
return getFixForExtraRequire(error,compiler);
case "String_Node_Str":
return getFixForUnnecessaryCast(error,compiler);
default :
return null;
}
}
Program: 27455
Project: 27455
Buggy source:
private JSType fromReceiverToFirstFormal(){
  if (this.receiverType == null) {
    return JSType.UNKNOWN;
  }
  NominalType nt=this.receiverType.getNominalTypeIfSingletonObj();
  if (nt == null) {
    return this.receiverType;
  }
  if (nt.isGeneric()) {
    return nt.instantiateGenerics(JSType.MAP_TO_UNKNOWN).getInstanceAsJSType();
  }
  return nt.getInstanceAsJSType();
}

Fixed version (ground truth):
private JSType fromReceiverToFirstFormal(){
  if (this.receiverType == null) {
    return JSType.UNKNOWN;
  }
  NominalType nt=this.receiverType.getNominalTypeIfSingletonObj();
  if (nt == null || nt.isBuiltinObject()) {
    return this.receiverType;
  }
  if (nt.isGeneric()) {
    return nt.instantiateGenerics(JSType.MAP_TO_UNKNOWN).getInstanceAsJSType();
  }
  return nt.getInstanceAsJSType();
}
Program: 27456
Project: 27456
Buggy source:
boolean isClassy(){
  return !isFunction() && !isObject();
}

Fixed version (ground truth):
boolean isClassy(){
  return !isFunction() && !isBuiltinObject();
}
Program: 27457
Project: 27457
Buggy source:
public void testThisOverridesPrototype(){
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testThisOverridesPrototype(){
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
}
Program: 27458
Project: 27458
Buggy source:
private void visitAssign(Node n){
  if (classNames.contains(n.getLastChild().getQualifiedName())) {
    String maybeAlias=n.getFirstChild().getQualifiedName();
    if (maybeAlias != null) {
      classNames.add(maybeAlias);
      staticMethods.putAll(maybeAlias,staticMethods.get(n.getLastChild().getQualifiedName()));
    }
  }
 else   if (n.getFirstChild().isGetProp()) {
    Node getProp=n.getFirstChild();
    String maybeClassName=getProp.getFirstChild().getQualifiedName();
    if (classNames.contains(maybeClassName)) {
      staticMethods.put(maybeClassName,n);
    }
  }
}

Fixed version (ground truth):
private void visitAssign(Node n){
  String existingClassQname=n.getLastChild().getQualifiedName();
  if (classNames.contains(existingClassQname)) {
    String maybeAlias=n.getFirstChild().getQualifiedName();
    if (maybeAlias != null) {
      classNames.add(maybeAlias);
      staticMethods.put(maybeAlias,getSet(staticMethods,existingClassQname));
    }
  }
 else   if (n.getFirstChild().isGetProp()) {
    Node getProp=n.getFirstChild();
    String maybeClassName=getProp.getFirstChild().getQualifiedName();
    if (classNames.contains(maybeClassName)) {
      getSet(staticMethods,maybeClassName).add(n);
    }
  }
}
Program: 27459
Project: 27459
Buggy source:
private void copyStaticMethod(Node staticMember,Node superclassNameNode,Node subclassNameNode,Node insertionPoint){
  Preconditions.checkState(staticMember.isAssign(),staticMember);
  String memberName=staticMember.getFirstChild().getLastChild().getString();
  for (  Node subclassMember : staticMethods.get(subclassNameNode.getQualifiedName())) {
    Preconditions.checkState(subclassMember.isAssign(),subclassMember);
    if (subclassMember.getFirstChild().getLastChild().getString().equals(memberName)) {
      return;
    }
  }
  JSDocInfoBuilder info=JSDocInfoBuilder.maybeCopyFrom(staticMember.getJSDocInfo());
  Node assign=IR.assign(IR.getprop(subclassNameNode.cloneTree(),IR.string(memberName)),IR.getprop(superclassNameNode.cloneTree(),IR.string(memberName)));
  info.addSuppression("String_Node_Str");
  assign.setJSDocInfo(info.build());
  Node exprResult=IR.exprResult(assign);
  exprResult.useSourceInfoIfMissingFromForTree(superclassNameNode);
  insertionPoint.getParent().addChildAfter(exprResult,insertionPoint);
  staticMethods.put(subclassNameNode.getQualifiedName(),assign);
  compiler.reportCodeChange();
}

Fixed version (ground truth):
private void copyStaticMethod(Node staticMember,Node superclassNameNode,Node subclassNameNode,String subclassQname,Node insertionPoint){
  Preconditions.checkState(staticMember.isAssign(),staticMember);
  String memberName=staticMember.getFirstChild().getLastChild().getString();
  LinkedHashSet<Node> subclassMethods=getSet(staticMethods,subclassQname);
  for (  Node subclassMember : subclassMethods) {
    Preconditions.checkState(subclassMember.isAssign(),subclassMember);
    if (subclassMember.getFirstChild().getLastChild().getString().equals(memberName)) {
      return;
    }
  }
  JSDocInfoBuilder info=JSDocInfoBuilder.maybeCopyFrom(staticMember.getJSDocInfo());
  Node assign=IR.assign(IR.getprop(subclassNameNode.cloneTree(),IR.string(memberName)),IR.getprop(superclassNameNode.cloneTree(),IR.string(memberName)));
  info.addSuppression("String_Node_Str");
  assign.setJSDocInfo(info.build());
  Node exprResult=IR.exprResult(assign);
  exprResult.useSourceInfoIfMissingFromForTree(superclassNameNode);
  insertionPoint.getParent().addChildAfter(exprResult,insertionPoint);
  subclassMethods.add(assign);
  compiler.reportCodeChange();
}
Program: 27460
Project: 27460
Buggy source:
private void processInherits(List<Node> inheritsCalls){
  for (  Node n : inheritsCalls) {
    Node parent=n.getParent();
    Node superclassNameNode=n.getLastChild();
    Node subclassNameNode=n.getChildBefore(superclassNameNode);
    if (multiplyDefinedClasses.contains(superclassNameNode.getQualifiedName())) {
      compiler.report(JSError.make(n,DUPLICATE_CLASS));
      return;
    }
    for (    Node staticMethod : staticMethods.get(superclassNameNode.getQualifiedName())) {
      copyStaticMethod(staticMethod,superclassNameNode,subclassNameNode,parent);
    }
    for (    Node staticProperty : staticProperties.get(superclassNameNode.getQualifiedName())) {
      Preconditions.checkState(staticProperty.isGetProp(),staticProperty);
      String memberName=staticProperty.getLastChild().getString();
      Node getprop=IR.getprop(subclassNameNode.cloneTree(),IR.string(memberName));
      JSDocInfoBuilder info=JSDocInfoBuilder.maybeCopyFrom(staticProperty.getJSDocInfo());
      JSTypeExpression unknown=new JSTypeExpression(new Node(Token.QMARK),"String_Node_Str");
      info.recordType(unknown);
      info.addSuppression("String_Node_Str");
      getprop.setJSDocInfo(info.build());
      Node declaration=IR.exprResult(getprop);
      declaration.useSourceInfoIfMissingFromForTree(n);
      parent.getParent().addChildAfter(declaration,parent);
      staticProperties.put(subclassNameNode.getQualifiedName(),staticProperty);
      compiler.reportCodeChange();
    }
  }
}

Fixed version (ground truth):
private void processInherits(List<Node> inheritsCalls){
  for (  Node n : inheritsCalls) {
    Node parent=n.getParent();
    Node superclassNameNode=n.getLastChild();
    String superclassQname=superclassNameNode.getQualifiedName();
    Node subclassNameNode=n.getChildBefore(superclassNameNode);
    String subclassQname=subclassNameNode.getQualifiedName();
    if (multiplyDefinedClasses.contains(superclassQname)) {
      compiler.report(JSError.make(n,DUPLICATE_CLASS));
      return;
    }
    for (    Node staticMethod : getSet(staticMethods,superclassQname)) {
      copyStaticMethod(staticMethod,superclassNameNode,subclassNameNode,subclassQname,parent);
    }
    for (    Node staticProperty : getSet(staticProperties,superclassQname)) {
      copyStaticProperty(staticProperty,subclassNameNode,subclassQname,n);
    }
  }
}
Program: 27461
Project: 27461
Buggy source:
private void visitGetProp(Node n){
  String className=n.getFirstChild().getQualifiedName();
  if (classNames.contains(className)) {
    staticProperties.put(className,n);
  }
}

Fixed version (ground truth):
private void visitGetProp(Node n){
  String className=n.getFirstChild().getQualifiedName();
  if (classNames.contains(className)) {
    getSet(staticProperties,className).add(n);
  }
}
Program: 27462
Project: 27462
Buggy source:
private void visitVar(Node n){
  Node child=n.getFirstChild();
  if (!child.hasChildren()) {
    return;
  }
  String maybeOriginalName=child.getFirstChild().getQualifiedName();
  if (classNames.contains(maybeOriginalName)) {
    String maybeAlias=child.getQualifiedName();
    if (maybeAlias != null) {
      classNames.add(maybeAlias);
      staticMethods.putAll(maybeAlias,staticMethods.get(maybeOriginalName));
    }
  }
}

Fixed version (ground truth):
private void visitVar(Node n){
  Node child=n.getFirstChild();
  if (!child.hasChildren()) {
    return;
  }
  String maybeOriginalName=child.getFirstChild().getQualifiedName();
  if (classNames.contains(maybeOriginalName)) {
    String maybeAlias=child.getQualifiedName();
    if (maybeAlias != null) {
      classNames.add(maybeAlias);
      staticMethods.put(maybeAlias,getSet(staticMethods,maybeOriginalName));
    }
  }
}
Program: 27463
Project: 27463
Buggy source:
public void testOverride(){
  test(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testOverride(){
  testSame(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  testSame(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27464
Project: 27464
Buggy source:
private static JSType pickReqObjType(Node expr){
  int exprKind=expr.getType();
switch (exprKind) {
case Token.GETPROP:
    return JSType.TOP_STRUCT;
case Token.GETELEM:
case Token.IN:
  return JSType.TOP_DICT;
case Token.FOR:
Preconditions.checkState(NodeUtil.isForIn(expr));
return JSType.TOP_DICT;
case Token.OBJECTLIT:
{
JSDocInfo jsdoc=expr.getJSDocInfo();
if (jsdoc != null && jsdoc.makesStructs()) {
return JSType.TOP_STRUCT;
}
if (jsdoc != null && jsdoc.makesDicts()) {
return JSType.TOP_DICT;
}
return JSType.TOP_OBJECT;
}
default :
throw new RuntimeException("String_Node_Str" + Token.name(exprKind));
}
}

Fixed version (ground truth):
private static JSType pickReqObjType(Node expr){
  int exprKind=expr.getType();
switch (exprKind) {
case Token.GETPROP:
    return JSType.TOP_STRUCT;
case Token.GETELEM:
  return JSType.TOP_DICT;
case Token.OBJECTLIT:
{
  JSDocInfo jsdoc=expr.getJSDocInfo();
  if (jsdoc != null && jsdoc.makesStructs()) {
    return JSType.TOP_STRUCT;
  }
  if (jsdoc != null && jsdoc.makesDicts()) {
    return JSType.TOP_DICT;
  }
  return JSType.TOP_OBJECT;
}
case Token.FOR:
Preconditions.checkState(NodeUtil.isForIn(expr));
return JSType.TOP_OBJECT;
case Token.IN:
return JSType.TOP_OBJECT;
default :
throw new RuntimeException("String_Node_Str" + Token.name(exprKind));
}
}
Program: 27465
Project: 27465
Buggy source:
/** 
 * Generates JavaScript source code for an AST.
 */
private String toSource(Node n,SourceMap sourceMap,boolean firstOutput){
  CodePrinter.Builder builder=new CodePrinter.Builder(n);
  builder.setCompilerOptions(options);
  builder.setSourceMap(sourceMap);
  builder.setTagAsStrict(firstOutput && options.getLanguageOut().isStrict());
  return builder.build();
}

Fixed version (ground truth):
/** 
 * Generates JavaScript source code for an AST.
 */
private String toSource(Node n,SourceMap sourceMap,boolean firstOutput){
  CodePrinter.Builder builder=new CodePrinter.Builder(n);
  builder.setTypeRegistry(this.typeRegistry);
  builder.setCompilerOptions(options);
  builder.setSourceMap(sourceMap);
  builder.setTagAsStrict(firstOutput && options.getLanguageOut().isStrict());
  return builder.build();
}
Program: 27466
Project: 27466
Buggy source:
boolean isSubtypeOf(ObjectKind other){
  return mask == (mask & other.mask);
}

Fixed version (ground truth):
boolean isSubtypeOf(ObjectKind other){
  return this.mask == (this.mask & other.mask);
}
Program: 27467
Project: 27467
Buggy source:
boolean isDict(){
  return (mask & DICT_MASK) != 0;
}

Fixed version (ground truth):
boolean isDict(){
  return (this.mask & DICT_MASK) != 0;
}
Program: 27468
Project: 27468
Buggy source:
boolean isStruct(){
  return (mask & STRUCT_MASK) != 0;
}

Fixed version (ground truth):
boolean isStruct(){
  return (this.mask & STRUCT_MASK) != 0;
}
Program: 27469
Project: 27469
Buggy source:
ObjectType specialize(ObjectType other){
  Preconditions.checkState(areRelatedClasses(this.nominalType,other.nominalType));
  if (this == TOP_OBJECT) {
    return other;
  }
  NominalType resultNomType=NominalType.pickSubclass(this.nominalType,other.nominalType);
  ObjectKind ok=ObjectKind.meet(this.objectKind,other.objectKind);
  if (resultNomType != null && resultNomType.isClassy()) {
    Preconditions.checkState(this.fn == null && other.fn == null);
    PersistentMap<String,Property> newProps=meetPropsHelper(true,resultNomType,this.props,other.props);
    if (newProps == BOTTOM_MAP) {
      return BOTTOM_OBJECT;
    }
    return new ObjectType(resultNomType,newProps,null,false,ok);
  }
  FunctionType thisFn=this.fn;
  boolean isLoose=this.isLoose;
  if (resultNomType != null && resultNomType.isFunction() && this.fn == null) {
    thisFn=other.fn;
    isLoose=other.fn.isLoose();
  }
  PersistentMap<String,Property> newProps=meetPropsHelper(true,resultNomType,this.props,other.props);
  if (newProps == BOTTOM_MAP) {
    return BOTTOM_OBJECT;
  }
  FunctionType newFn=thisFn == null ? null : thisFn.specialize(other.fn);
  if (!FunctionType.isInhabitable(newFn)) {
    return BOTTOM_OBJECT;
  }
  return new ObjectType(resultNomType,newProps,newFn,isLoose,ok);
}

Fixed version (ground truth):
ObjectType specialize(ObjectType other){
  Preconditions.checkState(areRelatedClasses(this.nominalType,other.nominalType));
  if (this == TOP_OBJECT && other.objectKind.isUnrestricted()) {
    return other;
  }
  NominalType resultNomType=NominalType.pickSubclass(this.nominalType,other.nominalType);
  ObjectKind ok=ObjectKind.meet(this.objectKind,other.objectKind);
  if (resultNomType != null && resultNomType.isClassy()) {
    Preconditions.checkState(this.fn == null && other.fn == null);
    PersistentMap<String,Property> newProps=meetPropsHelper(true,resultNomType,this.props,other.props);
    if (newProps == BOTTOM_MAP) {
      return BOTTOM_OBJECT;
    }
    return new ObjectType(resultNomType,newProps,null,false,ok);
  }
  FunctionType thisFn=this.fn;
  boolean isLoose=this.isLoose;
  if (resultNomType != null && resultNomType.isFunction() && this.fn == null) {
    thisFn=other.fn;
    isLoose=other.fn.isLoose();
  }
  PersistentMap<String,Property> newProps=meetPropsHelper(true,resultNomType,this.props,other.props);
  if (newProps == BOTTOM_MAP) {
    return BOTTOM_OBJECT;
  }
  FunctionType newFn=thisFn == null ? null : thisFn.specialize(other.fn);
  if (!FunctionType.isInhabitable(newFn)) {
    return BOTTOM_OBJECT;
  }
  return new ObjectType(resultNomType,newProps,newFn,isLoose,ok);
}
Program: 27470
Project: 27470
Buggy source:
public void testDictPropAccess(){
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck("String_Node_Str",NewTypeInference.ILLEGAL_OBJLIT_KEY);
  typeCheck("String_Node_Str",NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck("String_Node_Str",NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
}

Fixed version (ground truth):
public void testDictPropAccess(){
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck("String_Node_Str",NewTypeInference.ILLEGAL_OBJLIT_KEY);
  typeCheck("String_Node_Str",NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck("String_Node_Str",NewTypeInference.ILLEGAL_PROPERTY_ACCESS);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27471
Project: 27471
Buggy source:
boolean hasAnyTemplateTypesInternal(){
  for (  JSType templateValue : templateValues) {
    if (templateValue.hasAnyTemplateTypes()) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
boolean hasAnyTemplateTypesInternal(){
  for (  JSType templateValue : addUnknownValues().resolvedTemplateValues) {
    if (templateValue.hasAnyTemplateTypes()) {
      return true;
    }
  }
  return false;
}
Program: 27472
Project: 27472
Buggy source:
private void reportUnused(NodeTraversal t){
  for (  Node n : candidates) {
    String propName=getPropName(n);
    if (!used.contains(propName)) {
      t.report(n,UNUSED_PRIVATE_PROPERTY);
    }
  }
}

Fixed version (ground truth):
private void reportUnused(NodeTraversal t){
  for (  Node n : candidates) {
    String propName=getPropName(n);
    if (!used.contains(propName)) {
      t.report(n,UNUSED_PRIVATE_PROPERTY,propName);
    }
  }
}
Program: 27473
Project: 27473
Buggy source:
private ParseTree parseObjectPatternField(PatternKind kind){
  SourcePosition start=getTreeStartLocation();
  if (peekType() == TokenType.OPEN_SQUARE) {
    ParseTree key=parseComputedPropertyName();
    eat(TokenType.COLON);
    ParseTree value=parseObjectPatternFieldTail(kind);
    return new ComputedPropertyDefinitionTree(getTreeLocation(start),key,value);
  }
  Token name;
  if (peekId() || Keywords.isKeyword(peekType())) {
    name=eatIdOrKeywordAsId();
    if (!peek(TokenType.COLON)) {
      IdentifierToken idToken=(IdentifierToken)name;
      if (Keywords.isKeyword(idToken.value)) {
        reportError("String_Node_Str" + name + "String_Node_Str");
      }
      if (peek(TokenType.EQUAL)) {
        IdentifierExpressionTree idTree=new IdentifierExpressionTree(getTreeLocation(start),idToken);
        eat(TokenType.EQUAL);
        ParseTree defaultValue=parseAssignmentExpression();
        return new DefaultParameterTree(getTreeLocation(start),idTree,defaultValue);
      }
      return new PropertyNameAssignmentTree(getTreeLocation(start),name,null);
    }
  }
 else {
    name=parseLiteralExpression().literalToken;
  }
  eat(TokenType.COLON);
  ParseTree value=parseObjectPatternFieldTail(kind);
  return new PropertyNameAssignmentTree(getTreeLocation(start),name,value);
}

Fixed version (ground truth):
private ParseTree parseObjectPatternField(PatternKind kind){
  SourcePosition start=getTreeStartLocation();
  if (peekType() == TokenType.OPEN_SQUARE) {
    ParseTree key=parseComputedPropertyName();
    eat(TokenType.COLON);
    ParseTree value=parseObjectPatternFieldTail(kind);
    return new ComputedPropertyDefinitionTree(getTreeLocation(start),key,value);
  }
  Token name;
  if (peekId() || Keywords.isKeyword(peekType())) {
    name=eatIdOrKeywordAsId();
    if (!peek(TokenType.COLON)) {
      IdentifierToken idToken=(IdentifierToken)name;
      if (Keywords.isKeyword(idToken.value) && !Keywords.isTypeScriptSpecificKeyword(idToken.value)) {
        reportError("String_Node_Str" + name + "String_Node_Str");
      }
      if (peek(TokenType.EQUAL)) {
        IdentifierExpressionTree idTree=new IdentifierExpressionTree(getTreeLocation(start),idToken);
        eat(TokenType.EQUAL);
        ParseTree defaultValue=parseAssignmentExpression();
        return new DefaultParameterTree(getTreeLocation(start),idTree,defaultValue);
      }
      return new PropertyNameAssignmentTree(getTreeLocation(start),name,null);
    }
  }
 else {
    name=parseLiteralExpression().literalToken;
  }
  eat(TokenType.COLON);
  ParseTree value=parseObjectPatternFieldTail(kind);
  return new PropertyNameAssignmentTree(getTreeLocation(start),name,value);
}
Program: 27474
Project: 27474
Buggy source:
private ParseTree parsePropertyNameAssignment(){
  SourcePosition start=getTreeStartLocation();
  Token name=eatObjectLiteralPropertyName();
  Token colon=eatOpt(TokenType.COLON);
  if (colon == null) {
    if (name.type != TokenType.IDENTIFIER) {
      reportExpectedError(peekToken(),TokenType.COLON);
    }
 else     if (Keywords.isKeyword(name.asIdentifier().value)) {
      reportError(name,"String_Node_Str");
    }
  }
  ParseTree value=colon == null ? null : parseAssignmentExpression();
  return new PropertyNameAssignmentTree(getTreeLocation(start),name,value);
}

Fixed version (ground truth):
private ParseTree parsePropertyNameAssignment(){
  SourcePosition start=getTreeStartLocation();
  Token name=eatObjectLiteralPropertyName();
  Token colon=eatOpt(TokenType.COLON);
  if (colon == null) {
    if (name.type != TokenType.IDENTIFIER) {
      reportExpectedError(peekToken(),TokenType.COLON);
    }
 else     if (Keywords.isKeyword(name.asIdentifier().value) && !Keywords.isTypeScriptSpecificKeyword(name.asIdentifier().value)) {
      reportError(name,"String_Node_Str");
    }
  }
  ParseTree value=colon == null ? null : parseAssignmentExpression();
  return new PropertyNameAssignmentTree(getTreeLocation(start),name,value);
}
Program: 27475
Project: 27475
Buggy source:
public void testObjectDestructuringKeywordKeys(){
  mode=LanguageMode.ECMASCRIPT6;
  parse("String_Node_Str");
  parse("String_Node_Str");
  parseError("String_Node_Str","String_Node_Str");
  parseError("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void testObjectDestructuringKeywordKeys(){
  mode=LanguageMode.ECMASCRIPT6;
  parse("String_Node_Str");
  parse("String_Node_Str");
  parse("String_Node_Str");
  parse("String_Node_Str");
  parse("String_Node_Str");
  parse("String_Node_Str");
  parseError("String_Node_Str","String_Node_Str");
  parseError("String_Node_Str","String_Node_Str");
}
Program: 27476
Project: 27476
Buggy source:
/** 
 * Add node to the list of injectables.
 * @param n node to add.
 * @param t node traversal instance.
 */
private void addNode(Node n,NodeTraversal t){
  Node target=null;
  Node fn=null;
  String name=null;
switch (n.getType()) {
case Token.ASSIGN:
    name=n.getFirstChild().getQualifiedName();
  fn=n;
while (fn.isAssign()) {
  fn=fn.getLastChild();
}
target=n.getParent();
break;
case Token.FUNCTION:
name=NodeUtil.getFunctionName(n);
fn=n;
target=n;
break;
case Token.VAR:
case Token.LET:
case Token.CONST:
name=n.getFirstChild().getString();
fn=getDeclarationRValue(n);
target=n;
break;
case Token.MEMBER_FUNCTION_DEF:
Node parent=n.getParent();
if (parent.isClassMembers()) {
Node classNode=parent.getParent();
String midPart=n.isStaticMember() ? "String_Node_Str" : "String_Node_Str";
name=NodeUtil.getClassName(classNode) + midPart + n.getString();
if (n.getString().equals("String_Node_Str")) {
name=NodeUtil.getClassName(classNode);
}
fn=n.getFirstChild();
if (classNode.getParent().isAssign()) {
target=classNode.getParent().getParent();
}
 else {
target=classNode;
}
}
break;
}
if (fn == null || !fn.isFunction()) {
compiler.report(t.makeError(n,INJECT_NON_FUNCTION_ERROR));
return;
}
if (!target.getParent().isScript() && !target.getParent().isBlock()) {
compiler.report(t.makeError(n,INJECT_IN_NON_GLOBAL_OR_BLOCK_ERROR));
return;
}
Preconditions.checkNotNull(name);
injectables.add(new NodeContext(name,n,fn,target));
}

Fixed version (ground truth):
/** 
 * Add node to the list of injectables.
 * @param n node to add.
 * @param t node traversal instance.
 */
private void addNode(Node n,NodeTraversal t){
  Node target=null;
  Node fn=null;
  String name=null;
switch (n.getType()) {
case Token.ASSIGN:
    name=n.getFirstChild().getQualifiedName();
  fn=n;
while (fn.isAssign()) {
  fn=fn.getLastChild();
}
target=n.getParent();
break;
case Token.FUNCTION:
name=NodeUtil.getFunctionName(n);
fn=n;
target=n;
break;
case Token.VAR:
case Token.LET:
case Token.CONST:
name=n.getFirstChild().getString();
fn=getDeclarationRValue(n);
target=n;
break;
case Token.MEMBER_FUNCTION_DEF:
Node parent=n.getParent();
if (parent.isClassMembers()) {
Node classNode=parent.getParent();
String midPart=n.isStaticMember() ? "String_Node_Str" : "String_Node_Str";
name=NodeUtil.getClassName(classNode) + midPart + n.getString();
if (n.getString().equals("String_Node_Str")) {
name=NodeUtil.getClassName(classNode);
}
fn=n.getFirstChild();
if (classNode.getParent().isAssign() || classNode.getParent().isName()) {
target=classNode.getParent().getParent();
}
 else {
target=classNode;
}
}
break;
}
if (fn == null || !fn.isFunction()) {
compiler.report(t.makeError(n,INJECT_NON_FUNCTION_ERROR));
return;
}
if (!target.getParent().isScript() && !target.getParent().isBlock()) {
compiler.report(t.makeError(n,INJECT_IN_NON_GLOBAL_OR_BLOCK_ERROR));
return;
}
Preconditions.checkNotNull(name);
injectables.add(new NodeContext(name,n,fn,target));
}
Program: 27477
Project: 27477
Buggy source:
/** 
 * @return True if our parameter spec is equal to {@code that}'s parameter spec.
 */
boolean hasEqualParameters(ArrowType that,EquivalenceMethod eqMethod){
  Node thisParam=parameters.getFirstChild();
  Node otherParam=that.parameters.getFirstChild();
  while (thisParam != null && otherParam != null) {
    JSType thisParamType=thisParam.getJSType();
    JSType otherParamType=otherParam.getJSType();
    if (thisParamType != null) {
      if (otherParamType != null && !thisParamType.checkEquivalenceHelper(otherParamType,eqMethod)) {
        return false;
      }
    }
 else {
      if (otherParamType != null) {
        return false;
      }
    }
    if (thisParam.isOptionalArg() != otherParam.isOptionalArg()) {
      return false;
    }
    if (thisParam.isVarArgs() != otherParam.isVarArgs()) {
      return false;
    }
    thisParam=thisParam.getNext();
    otherParam=otherParam.getNext();
  }
  return thisParam == otherParam;
}

Fixed version (ground truth):
/** 
 * @return True if our parameter spec is equal to {@code that}'s parameter spec.
 */
boolean hasEqualParameters(ArrowType that,EquivalenceMethod eqMethod,EqCache eqCache){
  Node thisParam=parameters.getFirstChild();
  Node otherParam=that.parameters.getFirstChild();
  while (thisParam != null && otherParam != null) {
    JSType thisParamType=thisParam.getJSType();
    JSType otherParamType=otherParam.getJSType();
    if (thisParamType != null) {
      if (otherParamType != null && !thisParamType.checkEquivalenceHelper(otherParamType,eqMethod,eqCache)) {
        return false;
      }
    }
 else {
      if (otherParamType != null) {
        return false;
      }
    }
    if (thisParam.isOptionalArg() != otherParam.isOptionalArg()) {
      return false;
    }
    if (thisParam.isVarArgs() != otherParam.isVarArgs()) {
      return false;
    }
    thisParam=thisParam.getNext();
    otherParam=otherParam.getNext();
  }
  return thisParam == otherParam;
}
Program: 27478
Project: 27478
Buggy source:
boolean checkArrowEquivalenceHelper(ArrowType that,EquivalenceMethod eqMethod,EqCache eqCache){
  if (!returnType.checkEquivalenceHelper(that.returnType,eqMethod,eqCache)) {
    return false;
  }
  return hasEqualParameters(that,eqMethod);
}

Fixed version (ground truth):
boolean checkArrowEquivalenceHelper(ArrowType that,EquivalenceMethod eqMethod,EqCache eqCache){
  if (!returnType.checkEquivalenceHelper(that.returnType,eqMethod,eqCache)) {
    return false;
  }
  return hasEqualParameters(that,eqMethod,eqCache);
}
Program: 27479
Project: 27479
Buggy source:
/** 
 * Try to get the sup/inf of two functions by looking at the piecewise components.
 */
private FunctionType tryMergeFunctionPiecewise(FunctionType other,boolean leastSuper){
  Node newParamsNode=null;
  if (call.hasEqualParameters(other.call,EquivalenceMethod.IDENTITY)) {
    newParamsNode=call.parameters;
  }
 else {
    return null;
  }
  JSType newReturnType=leastSuper ? call.returnType.getLeastSupertype(other.call.returnType) : call.returnType.getGreatestSubtype(other.call.returnType);
  JSType newTypeOfThis=null;
  if (isEquivalent(typeOfThis,other.typeOfThis)) {
    newTypeOfThis=typeOfThis;
  }
 else {
    JSType maybeNewTypeOfThis=leastSuper ? typeOfThis.getLeastSupertype(other.typeOfThis) : typeOfThis.getGreatestSubtype(other.typeOfThis);
    newTypeOfThis=maybeNewTypeOfThis;
  }
  boolean newReturnTypeInferred=call.returnTypeInferred || other.call.returnTypeInferred;
  return new FunctionType(registry,null,null,new ArrowType(registry,newParamsNode,newReturnType,newReturnTypeInferred),newTypeOfThis,null,false,false);
}

Fixed version (ground truth):
/** 
 * Try to get the sup/inf of two functions by looking at the piecewise components.
 */
private FunctionType tryMergeFunctionPiecewise(FunctionType other,boolean leastSuper){
  Node newParamsNode=null;
  if (call.hasEqualParameters(other.call,EquivalenceMethod.IDENTITY,EqCache.create())) {
    newParamsNode=call.parameters;
  }
 else {
    return null;
  }
  JSType newReturnType=leastSuper ? call.returnType.getLeastSupertype(other.call.returnType) : call.returnType.getGreatestSubtype(other.call.returnType);
  JSType newTypeOfThis=null;
  if (isEquivalent(typeOfThis,other.typeOfThis)) {
    newTypeOfThis=typeOfThis;
  }
 else {
    JSType maybeNewTypeOfThis=leastSuper ? typeOfThis.getLeastSupertype(other.typeOfThis) : typeOfThis.getGreatestSubtype(other.typeOfThis);
    newTypeOfThis=maybeNewTypeOfThis;
  }
  boolean newReturnTypeInferred=call.returnTypeInferred || other.call.returnTypeInferred;
  return new FunctionType(registry,null,null,new ArrowType(registry,newParamsNode,newReturnType,newReturnTypeInferred),newTypeOfThis,null,false,false);
}
Program: 27480
Project: 27480
Buggy source:
@Override public void visit(NodeTraversal t,Node n,Node parent){
switch (n.getType()) {
case Token.FUNCTION:
    Node grandparent=parent.getParent();
  if (grandparent == null || !isPrototypePropertyDeclaration(grandparent)) {
    visitFunctionLate(n,null);
  }
break;
case Token.NAME:
{
String name=n.getString();
if (name == null || "String_Node_Str".equals(name) || parent.isFunction()) {
  return;
}
if (parent.isVar() || parent.isCatch()) {
  visitVar(n,parent);
}
 else if (currentScope.isOuterVarEarly(name)) {
  currentScope.addOuterVar(name);
}
 else if (currentScope.getTypedef(name) != null || !name.equals(currentScope.getName()) && !currentScope.isDefinedLocally(name,false)) {
}
break;
}
case Token.GETPROP:
if (parent.isExprResult() && n.isQualifiedName()) {
visitPropertyDeclaration(n);
}
break;
case Token.ASSIGN:
{
Node lvalue=n.getFirstChild();
if (lvalue.isGetProp() && lvalue.isQualifiedName() && parent.isExprResult()) {
visitPropertyDeclaration(lvalue);
}
break;
}
case Token.CAST:
castTypes.put(n,getDeclaredTypeOfNode(n.getJSDocInfo(),currentScope));
break;
case Token.OBJECTLIT:
visitObjectLit(n,parent);
break;
case Token.CALL:
visitCall(n);
break;
}
}

Fixed version (ground truth):
@Override public void visit(NodeTraversal t,Node n,Node parent){
switch (n.getType()) {
case Token.FUNCTION:
    Node grandparent=parent.getParent();
  if (grandparent == null || !isPrototypePropertyDeclaration(grandparent)) {
    RawNominalType ownerType=maybeGetOwnerType(n,parent);
    visitFunctionLate(n,ownerType);
  }
break;
case Token.NAME:
{
String name=n.getString();
if (name == null || "String_Node_Str".equals(name) || parent.isFunction()) {
  return;
}
if (parent.isVar() || parent.isCatch()) {
  visitVar(n,parent);
}
 else if (currentScope.isOuterVarEarly(name)) {
  currentScope.addOuterVar(name);
}
 else if (currentScope.getTypedef(name) != null || !name.equals(currentScope.getName()) && !currentScope.isDefinedLocally(name,false)) {
}
break;
}
case Token.GETPROP:
if (parent.isExprResult() && n.isQualifiedName()) {
visitPropertyDeclaration(n);
}
break;
case Token.ASSIGN:
{
Node lvalue=n.getFirstChild();
if (lvalue.isGetProp() && lvalue.isQualifiedName() && parent.isExprResult()) {
visitPropertyDeclaration(lvalue);
}
break;
}
case Token.CAST:
castTypes.put(n,getDeclaredTypeOfNode(n.getJSDocInfo(),currentScope));
break;
case Token.OBJECTLIT:
visitObjectLit(n,parent);
break;
case Token.CALL:
visitCall(n);
break;
}
}
Program: 27483
Project: 27483
Buggy source:
private void addExtern(){
  Node name=IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME,true);
  Node var=IR.var(name);
  JSDocInfoBuilder builder=new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build());
  CompilerInput input=compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}

Fixed version (ground truth):
private void addExtern(){
  Node name=IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME,true);
  Node var=IR.var(name);
  JSDocInfoBuilder builder=new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build());
  CompilerInput input=compiler.getSynthesizedExternsInput();
  name.setStaticSourceFile(input.getSourceFile());
  var.setStaticSourceFile(input.getSourceFile());
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
Program: 27484
Project: 27484
Buggy source:
void add(JSError warning){
  if (getFileWhereWarningOccurred(warning).startsWith("String_Node_Str") || JSType.mockToString) {
    return;
  }
  compiler.report(warning);
}

Fixed version (ground truth):
void add(JSError warning){
  String filename=warning.node.getSourceFileName();
  if (filename != null && filename.startsWith("String_Node_Str") || JSType.mockToString) {
    return;
  }
  compiler.report(warning);
}
Program: 27485
Project: 27485
Buggy source:
Node processSetAccessor(SetAccessorTree tree){
  Node key=processObjectLitKeyAsString(tree.propertyName);
  key.setType(Token.SETTER_DEF);
  Node body=transform(tree.body);
  Node dummyName=IR.name("String_Node_Str");
  setSourceInfo(dummyName,tree.propertyName);
  Node paramList=IR.paramList(safeProcessName(tree.parameter));
  setSourceInfo(paramList,tree.parameter);
  Node value=IR.function(dummyName,paramList,body);
  setSourceInfo(value,tree.body);
  key.addChildToFront(value);
  key.setStaticMember(tree.isStatic);
  return key;
}

Fixed version (ground truth):
Node processSetAccessor(SetAccessorTree tree){
  Node key=processObjectLitKeyAsString(tree.propertyName);
  key.setType(Token.SETTER_DEF);
  Node body=transform(tree.body);
  Node dummyName=IR.name("String_Node_Str");
  setSourceInfo(dummyName,tree.propertyName);
  Node paramList=IR.paramList(safeProcessName(tree.parameter));
  setSourceInfo(paramList,tree.parameter);
  Node value=newNode(Token.FUNCTION,dummyName,paramList,body);
  setSourceInfo(value,tree.body);
  key.addChildToFront(value);
  key.setStaticMember(tree.isStatic);
  return key;
}
Program: 27486
Project: 27486
Buggy source:
Node processGetAccessor(GetAccessorTree tree){
  Node key=processObjectLitKeyAsString(tree.propertyName);
  key.setType(Token.GETTER_DEF);
  Node body=transform(tree.body);
  Node dummyName=IR.name("String_Node_Str");
  setSourceInfo(dummyName,tree.body);
  Node paramList=IR.paramList();
  setSourceInfo(paramList,tree.body);
  Node value=IR.function(dummyName,paramList,body);
  setSourceInfo(value,tree.body);
  key.addChildToFront(value);
  key.setStaticMember(tree.isStatic);
  return key;
}

Fixed version (ground truth):
Node processGetAccessor(GetAccessorTree tree){
  Node key=processObjectLitKeyAsString(tree.propertyName);
  key.setType(Token.GETTER_DEF);
  Node body=transform(tree.body);
  Node dummyName=IR.name("String_Node_Str");
  setSourceInfo(dummyName,tree.body);
  Node paramList=IR.paramList();
  setSourceInfo(paramList,tree.body);
  Node value=newNode(Token.FUNCTION,dummyName,paramList,body);
  setSourceInfo(value,tree.body);
  key.addChildToFront(value);
  key.setStaticMember(tree.isStatic);
  return key;
}
Program: 27487
Project: 27487
Buggy source:
private final void typeCheck(String externs,String js,DiagnosticType... warningKinds){
  parseAndTypeCheck(externs,js);
  JSError[] warnings=compiler.getWarnings();
  JSError[] errors=compiler.getErrors();
  String errorMessage="String_Node_Str" + "String_Node_Str" + Arrays.toString(warningKinds) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ Arrays.toString(warnings)+ "String_Node_Str"+ "String_Node_Str";
  assertEquals(errorMessage + "String_Node_Str",warningKinds.length,warnings.length + errors.length);
  for (  JSError warning : warnings) {
    assertTrue("String_Node_Str" + errorMessage,Arrays.asList(warningKinds).contains(warning.getType()));
  }
  for (  JSError error : errors) {
    assertTrue("String_Node_Str" + errorMessage,Arrays.asList(warningKinds).contains(error.getType()));
  }
}

Fixed version (ground truth):
private final void typeCheck(String externs,String js,DiagnosticType... warningKinds){
  parseAndTypeCheck(externs,js);
  JSError[] warnings=compiler.getWarnings();
  JSError[] errors=compiler.getErrors();
  String errorMessage="String_Node_Str" + "String_Node_Str" + Arrays.toString(warningKinds) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ Arrays.toString(errors)+ Arrays.toString(warnings)+ "String_Node_Str"+ "String_Node_Str";
  assertEquals(errorMessage + "String_Node_Str",warningKinds.length,warnings.length + errors.length);
  for (  JSError warning : warnings) {
    assertTrue("String_Node_Str" + errorMessage,Arrays.asList(warningKinds).contains(warning.getType()));
  }
  for (  JSError error : errors) {
    assertTrue("String_Node_Str" + errorMessage,Arrays.asList(warningKinds).contains(error.getType()));
  }
}
Program: 27488
Project: 27488
Buggy source:
protected final void parseAndTypeCheck(String externs,String js){
  setUp();
  final CompilerOptions options=compiler.getOptions();
  options.setClosurePass(true);
  options.setWarningLevel(DiagnosticGroups.NEW_CHECK_TYPES_ALL_CHECKS,CheckLevel.WARNING);
  compiler.init(ImmutableList.of(SourceFile.fromCode("String_Node_Str",externs)),ImmutableList.of(SourceFile.fromCode("String_Node_Str",js)),options);
  Node externsRoot=IR.block();
  externsRoot.setIsSyntheticBlock(true);
  externsRoot.addChildToFront(compiler.getInput(new InputId("String_Node_Str")).getAstRoot(compiler));
  Node astRoot=IR.block();
  astRoot.setIsSyntheticBlock(true);
  astRoot.addChildToFront(compiler.getInput(new InputId("String_Node_Str")).getAstRoot(compiler));
  assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getErrors()),0,compiler.getErrorCount());
  assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getWarnings()),0,compiler.getWarningCount());
  Node block=IR.block(externsRoot,astRoot);
  block.setIsSyntheticBlock(true);
  (new AstValidator(compiler)).validateRoot(block);
  GlobalTypeInfo symbolTable=new GlobalTypeInfo(compiler);
  passes.add(makePassFactory("String_Node_Str",symbolTable));
  compiler.setSymbolTable(symbolTable);
  passes.add(makePassFactory("String_Node_Str",new NewTypeInference(compiler,options.closurePass)));
  PhaseOptimizer phaseopt=new PhaseOptimizer(compiler,null,null);
  phaseopt.consume(passes);
  phaseopt.process(externsRoot,astRoot);
}

Fixed version (ground truth):
private final void parseAndTypeCheck(String externs,String js){
  setUp();
  final CompilerOptions options=compiler.getOptions();
  options.setClosurePass(true);
  options.setWarningLevel(DiagnosticGroups.NEW_CHECK_TYPES_ALL_CHECKS,CheckLevel.WARNING);
  compiler.init(ImmutableList.of(SourceFile.fromCode("String_Node_Str",externs)),ImmutableList.of(SourceFile.fromCode("String_Node_Str",js)),options);
  Node externsRoot=IR.block();
  externsRoot.setIsSyntheticBlock(true);
  externsRoot.addChildToFront(compiler.getInput(new InputId("String_Node_Str")).getAstRoot(compiler));
  Node astRoot=IR.block();
  astRoot.setIsSyntheticBlock(true);
  astRoot.addChildToFront(compiler.getInput(new InputId("String_Node_Str")).getAstRoot(compiler));
  assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getErrors()),0,compiler.getErrorCount());
  assertEquals("String_Node_Str" + Joiner.on("String_Node_Str").join(compiler.getWarnings()),0,compiler.getWarningCount());
  Node block=IR.block(externsRoot,astRoot);
  block.setIsSyntheticBlock(true);
  (new AstValidator(compiler)).validateRoot(block);
  GlobalTypeInfo symbolTable=new GlobalTypeInfo(compiler);
  passes.add(makePassFactory("String_Node_Str",symbolTable));
  compiler.setSymbolTable(symbolTable);
  passes.add(makePassFactory("String_Node_Str",new NewTypeInference(compiler,options.closurePass)));
  PhaseOptimizer phaseopt=new PhaseOptimizer(compiler,null,null);
  phaseopt.consume(passes);
  phaseopt.process(externsRoot,astRoot);
}
Program: 27489
Project: 27489
Buggy source:
/** 
 * Returns the qualified name node of the function whose scope we're in, or null if it cannot be found.
 */
private static Node getEnclosingDeclNameNode(Node n){
  Node fn=NodeUtil.getEnclosingFunction(n);
  return fn == null ? null : NodeUtil.getFunctionNameNode(enclosingFunction);
}

Fixed version (ground truth):
/** 
 * Returns the qualified name node of the function whose scope we're in, or null if it cannot be found.
 */
private static Node getEnclosingDeclNameNode(Node n){
  Node fn=NodeUtil.getEnclosingFunction(n);
  return fn == null ? null : NodeUtil.getFunctionNameNode(fn);
}