nus-yam/ex-repair huggingface dataset:
Program: 27490
Project: 27490
Buggy source:
/** 
 * Returns whether the given property can possibly be set on the given type.
 */
public boolean canPropertyBeDefined(JSType type,String propertyName){
  if (type.isStruct()) {
    return type.hasProperty(propertyName);
  }
 else {
    if (typesIndexedByProperty.containsKey(propertyName)) {
      for (      JSType alt : typesIndexedByProperty.get(propertyName).getAlternates()) {
        JSType greatestSubtype=alt.getGreatestSubtype(type);
        if (!greatestSubtype.isEmptyType()) {
          RecordType maybeRecordType=greatestSubtype.toMaybeRecordType();
          if (maybeRecordType != null && maybeRecordType.isSynthetic()) {
            continue;
          }
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns whether the given property can possibly be set on the given type.
 */
public boolean canPropertyBeDefined(JSType type,String propertyName){
  if (type.isStruct()) {
    return type.hasProperty(propertyName);
  }
 else {
    if (!type.isEmptyType() && !type.isUnknownType() && type.hasProperty(propertyName)) {
      return true;
    }
    if (typesIndexedByProperty.containsKey(propertyName)) {
      for (      JSType alt : typesIndexedByProperty.get(propertyName).getAlternates()) {
        JSType greatestSubtype=alt.getGreatestSubtype(type);
        if (!greatestSubtype.isEmptyType()) {
          RecordType maybeRecordType=greatestSubtype.toMaybeRecordType();
          if (maybeRecordType != null && maybeRecordType.isSynthetic()) {
            continue;
          }
          return true;
        }
      }
    }
  }
  return false;
}
Program: 27491
Project: 27491
Buggy source:
public void testIObject14() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject14() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27492
Project: 27492
Buggy source:
public void testIObject13() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject13() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27493
Project: 27493
Buggy source:
public void testIObject12() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject12() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27494
Project: 27494
Buggy source:
public void testIObject11() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject11() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27495
Project: 27495
Buggy source:
public void testIObject10() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject10() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27496
Project: 27496
Buggy source:
public void testIArrayLike13() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IARRAYLIKE_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIArrayLike13() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IARRAYLIKE_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27497
Project: 27497
Buggy source:
public void testIArrayLike12() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IARRAYLIKE_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIArrayLike12() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IARRAYLIKE_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27498
Project: 27498
Buggy source:
public void testIArrayLike11() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IARRAYLIKE_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIArrayLike11() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IARRAYLIKE_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27499
Project: 27499
Buggy source:
public void testIArrayLike10() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IARRAYLIKE_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIArrayLike10() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IARRAYLIKE_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27500
Project: 27500
Buggy source:
public void testIObject9() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject9() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27501
Project: 27501
Buggy source:
public void testIObject8() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject8() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27502
Project: 27502
Buggy source:
public void testIObject7() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject7() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27503
Project: 27503
Buggy source:
public void testIObject6() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject6() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27504
Project: 27504
Buggy source:
public void testIObject1() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject1() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"));
}
Program: 27505
Project: 27505
Buggy source:
public void testIObject5() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject5() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27506
Project: 27506
Buggy source:
public void testIObject4() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject4() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27507
Project: 27507
Buggy source:
public void testIObject3() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject3() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27508
Project: 27508
Buggy source:
public void testIObject2() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIObject2() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IOBJECT_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"));
}
Program: 27509
Project: 27509
Buggy source:
public void testIArrayLike9() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IARRAYLIKE_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIArrayLike9() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IARRAYLIKE_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27510
Project: 27510
Buggy source:
public void testIArrayLike8() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IARRAYLIKE_DECLS,lineJoiner.join("String_Node_Str","String_Node_Str"),lineJoiner.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testIArrayLike8() throws Exception {
  testTypesWithExtraExterns(EXTERNS_WITH_IARRAYLIKE_DECLS,LINE_JOINER.join("String_Node_Str","String_Node_Str"),LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27512
Project: 27512
Buggy source:
public void testParam(){
  builder.recordParameter("String_Node_Str",new JSTypeExpression(JsDocInfoParser.parseTypeString("String_Node_Str"),"String_Node_Str"));
  builder.recordParameter("String_Node_Str",new JSTypeExpression(JsDocInfoParser.parseTypeString("String_Node_Str"),"String_Node_Str"));
  JSDocInfo info=builder.buildAndReset();
  assertEquals("String_Node_Str",JSDocInfoPrinter.print(info));
  builder.recordParameter("String_Node_Str",new JSTypeExpression(new Node(Token.EQUALS,IR.string("String_Node_Str")),"String_Node_Str"));
  info=builder.buildAndReset();
  assertEquals("String_Node_Str",JSDocInfoPrinter.print(info));
  builder.recordParameter("String_Node_Str",new JSTypeExpression(new Node(Token.ELLIPSIS,IR.string("String_Node_Str")),"String_Node_Str"));
  info=builder.buildAndReset();
  assertEquals("String_Node_Str",JSDocInfoPrinter.print(info));
}

Fixed version (ground truth):
public void testParam(){
  builder.recordParameter("String_Node_Str",new JSTypeExpression(JsDocInfoParser.parseTypeString("String_Node_Str"),"String_Node_Str"));
  builder.recordParameter("String_Node_Str",new JSTypeExpression(JsDocInfoParser.parseTypeString("String_Node_Str"),"String_Node_Str"));
  JSDocInfo info=builder.buildAndReset();
  assertEquals("String_Node_Str",JSDocInfoPrinter.print(info));
  builder.recordParameter("String_Node_Str",new JSTypeExpression(new Node(Token.EQUALS,IR.string("String_Node_Str")),"String_Node_Str"));
  info=builder.buildAndReset();
  assertEquals("String_Node_Str",JSDocInfoPrinter.print(info));
  builder.recordParameter("String_Node_Str",new JSTypeExpression(new Node(Token.ELLIPSIS,IR.string("String_Node_Str")),"String_Node_Str"));
  info=builder.buildAndReset();
  assertEquals("String_Node_Str",JSDocInfoPrinter.print(info));
  builder.recordParameter("String_Node_Str",null);
  info=builder.buildAndReset();
  assertEquals("String_Node_Str",JSDocInfoPrinter.print(info));
}
Program: 27514
Project: 27514
Buggy source:
public void testRedeclare(){
  assertRedeclare("String_Node_Str");
  assertRedeclare("String_Node_Str");
}

Fixed version (ground truth):
public void testRedeclare(){
  assertRedeclare("String_Node_Str");
  assertRedeclare("String_Node_Str");
  assertRedeclare("String_Node_Str");
}
Program: 27516
Project: 27516
Buggy source:
public void testArrowFunction(){
  languageMode=LanguageMode.ECMASCRIPT6;
  assertPrintSame("String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
  assertPrintSame("String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
  assertPrintSame("String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void testArrowFunction(){
  languageMode=LanguageMode.ECMASCRIPT6;
  assertPrintSame("String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
  assertPrintSame("String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
  assertPrintSame("String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
  assertPrintSame("String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
}
Program: 27517
Project: 27517
Buggy source:
/** 
 * If any of the variables are well-defined and alias other variables, mark them as aliasing candidates.
 */
private void collectAliasCandidates(NodeTraversal t,ReferenceMap referenceMap){
  if (mode != Mode.CONSTANTS_ONLY) {
    for (Iterator<Var> it=t.getScope().getVars(); it.hasNext(); ) {
      Var v=it.next();
      ReferenceCollection referenceInfo=referenceMap.getReferences(v);
      if (referenceInfo != null && referenceInfo.references.size() >= 2 && referenceInfo.isWellDefined() && referenceInfo.isAssignedOnceInLifetime()) {
        Reference init=referenceInfo.getInitializingReference();
        Node value=init.getAssignedValue();
        if (value != null && value.isName()) {
          aliasCandidates.put(value,new AliasCandidate(v,referenceInfo));
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * If any of the variables are well-defined and alias other variables, mark them as aliasing candidates.
 */
private void collectAliasCandidates(NodeTraversal t,ReferenceMap referenceMap){
  if (mode != Mode.CONSTANTS_ONLY) {
    for (Iterator<Var> it=t.getScope().getVars(); it.hasNext(); ) {
      Var v=it.next();
      ReferenceCollection referenceInfo=referenceMap.getReferences(v);
      if (referenceInfo != null && referenceInfo.references.size() >= 2 && referenceInfo.isWellDefined() && referenceInfo.isAssignedOnceInLifetime()) {
        Reference init=referenceInfo.getInitializingReference();
        Node value=init.getAssignedValue();
        if (value != null && value.isName() && !value.getString().equals(v.getName())) {
          aliasCandidates.put(value,new AliasCandidate(v,referenceInfo));
        }
      }
    }
  }
}
Program: 27518
Project: 27518
Buggy source:
private void visitPrototypePropertyDeclaration(Node getProp){
  Preconditions.checkArgument(getProp.isGetProp());
  Node parent=getProp.getParent();
  Node initializer=parent.isAssign() ? parent.getLastChild() : null;
  Node ctorNameNode=NodeUtil.getPrototypeClassName(getProp);
  QualifiedName ctorQname=QualifiedName.fromNode(ctorNameNode);
  RawNominalType rawType=currentScope.getNominalType(ctorQname);
  if (rawType == null) {
    if (initializer != null && initializer.isFunction()) {
      visitFunctionLate(initializer,null);
    }
    return;
  }
  if (initializer != null && initializer.isFunction()) {
    parent.putBooleanProp(Node.ANALYZED_DURING_GTI,true);
  }
  if (!currentScope.isDefined(ctorNameNode)) {
    warnings.add(JSError.make(getProp,CTOR_IN_DIFFERENT_SCOPE));
    if (initializer != null && initializer.isFunction()) {
      visitFunctionLate(initializer,rawType);
    }
    return;
  }
  mayWarnAboutInterfacePropInit(rawType,initializer);
  String pname=NodeUtil.getPrototypePropertyName(getProp);
  mayAddPropToPrototype(rawType,pname,getProp,initializer);
}

Fixed version (ground truth):
private void visitPrototypePropertyDeclaration(Node getProp){
  Preconditions.checkArgument(getProp.isGetProp());
  Node parent=getProp.getParent();
  Node initializer=parent.isAssign() ? parent.getLastChild() : null;
  Node ctorNameNode=NodeUtil.getPrototypeClassName(getProp);
  QualifiedName ctorQname=QualifiedName.fromNode(ctorNameNode);
  RawNominalType rawType=currentScope.getNominalType(ctorQname);
  if (rawType == null) {
    if (initializer != null && initializer.isFunction()) {
      visitFunctionLate(initializer,null);
    }
    return;
  }
  if (initializer != null && initializer.isFunction()) {
    parent.putBooleanProp(Node.ANALYZED_DURING_GTI,true);
  }
  if (!currentScope.isDefined(ctorNameNode)) {
    warnings.add(JSError.make(getProp,CTOR_IN_DIFFERENT_SCOPE));
    if (initializer != null && initializer.isFunction()) {
      visitFunctionLate(initializer,rawType);
    }
    return;
  }
  mayWarnAboutInterfacePropInit(rawType,initializer);
  mayAddPropToPrototype(rawType,getProp.getLastChild().getString(),getProp,initializer);
}
Program: 27519
Project: 27519
Buggy source:
private static boolean isAllowedToNotReturn(Scope methodScope){
  Node fn=methodScope.getRoot();
  if (fn.isFromExterns()) {
    return true;
  }
  if (!NodeUtil.isPrototypeMethod(fn)) {
    return false;
  }
  String typeName=NodeUtil.getRootOfQualifiedName(fn.getParent().getFirstChild()).getString();
  JSType t=methodScope.getDeclaredTypeOf(typeName);
  return t != null && t.isInterfaceDefinition();
}

Fixed version (ground truth):
private static boolean isAllowedToNotReturn(Scope methodScope){
  Node fn=methodScope.getRoot();
  if (fn.isFromExterns()) {
    return true;
  }
  if (!NodeUtil.isPrototypeMethod(fn)) {
    return false;
  }
  JSType maybeInterface;
  Node ntQnameNode=NodeUtil.getPrototypeClassName(fn.getParent().getFirstChild());
  if (ntQnameNode.isName()) {
    maybeInterface=methodScope.getDeclaredTypeOf(ntQnameNode.getString());
  }
 else {
    QualifiedName ntQname=QualifiedName.fromNode(ntQnameNode);
    JSType rootNamespace=methodScope.getDeclaredTypeOf(ntQname.getLeftmostName());
    maybeInterface=rootNamespace == null ? null : rootNamespace.getProp(ntQname.getAllButLeftmost());
  }
  return maybeInterface != null && maybeInterface.isInterfaceDefinition();
}
Program: 27520
Project: 27520
Buggy source:
private boolean matchesNodeShape(Node template,Node ast){
  if (isTemplateParameterNode(template)) {
    return !NodeUtil.isStatement(ast);
  }
 else   if (isTemplateLocalNameNode(template)) {
    if (!ast.isName()) {
      return false;
    }
  }
 else   if (!template.isEquivalentToShallow(ast)) {
    return false;
  }
  Node templateChild=template.getFirstChild();
  Node astChild=ast.getFirstChild();
  while (templateChild != null) {
    if (!matchesNodeShape(templateChild,astChild)) {
      return false;
    }
    templateChild=templateChild.getNext();
    astChild=astChild.getNext();
  }
  return true;
}

Fixed version (ground truth):
private boolean matchesNodeShape(Node template,Node ast){
  if (isTemplateParameterNode(template)) {
    return !NodeUtil.isStatement(ast);
  }
 else   if (isTemplateLocalNameNode(template)) {
    if (!ast.isName()) {
      return false;
    }
  }
 else   if (template.isCall()) {
    if (ast == null || !ast.isCall() || ast.getChildCount() != template.getChildCount()) {
      return false;
    }
  }
 else   if (!template.isEquivalentToShallow(ast)) {
    return false;
  }
  Node templateChild=template.getFirstChild();
  Node astChild=ast.getFirstChild();
  while (templateChild != null) {
    if (!matchesNodeShape(templateChild,astChild)) {
      return false;
    }
    templateChild=templateChild.getNext();
    astChild=astChild.getNext();
  }
  return true;
}
Program: 27521
Project: 27521
Buggy source:
/** 
 * Transforms the template node to a replacement node by mapping the template names to the ones that were matched against in the JsSourceMatcher.
 */
private Node transformNode(Node templateNode,Map<String,Node> templateNodeToMatchMap){
  Node clone=templateNode.cloneNode();
  if (templateNode.isName()) {
    String name=templateNode.getString();
    if (templateNodeToMatchMap.containsKey(name)) {
      Node templateMatch=templateNodeToMatchMap.get(name);
      Preconditions.checkNotNull(templateMatch,"String_Node_Str",name);
      if (templateNode.getParent().isVar()) {
        clone.setString(templateMatch.getString());
      }
 else {
        return templateMatch.cloneTree();
      }
    }
  }
  for (  Node child : templateNode.children()) {
    clone.addChildToBack(transformNode(child,templateNodeToMatchMap));
  }
  return clone;
}

Fixed version (ground truth):
/** 
 * Transforms the template node to a replacement node by mapping the template names to the ones that were matched against in the JsSourceMatcher.
 */
private Node transformNode(Node templateNode,Map<String,Node> templateNodeToMatchMap){
  Node clone=templateNode.cloneNode();
  if (templateNode.isName()) {
    String name=templateNode.getString();
    if (templateNodeToMatchMap.containsKey(name)) {
      Node templateMatch=templateNodeToMatchMap.get(name);
      Preconditions.checkNotNull(templateMatch,"String_Node_Str",name);
      if (templateNode.getParent().isVar()) {
        clone.setString(templateMatch.getString());
      }
 else {
        return templateMatch.cloneTree();
      }
    }
  }
 else   if (templateNode.isCall() && templateNode.getBooleanProp(Node.FREE_CALL) && templateNode.getFirstChild().isName()) {
    String name=templateNode.getFirstChild().getString();
    if (templateNodeToMatchMap.containsKey(name)) {
      clone.putBooleanProp(Node.FREE_CALL,false);
    }
  }
  for (  Node child : templateNode.children()) {
    clone.addChildToBack(transformNode(child,templateNodeToMatchMap));
  }
  return clone;
}
Program: 27522
Project: 27522
Buggy source:
private void visitOtherPropertyDeclaration(Node getProp){
  Preconditions.checkArgument(getProp.isGetProp());
  if (isAnnotatedAsConst(getProp)) {
    warnings.add(JSError.make(getProp,MISPLACED_CONST_ANNOTATION));
  }
  RawNominalType rawType=getRawTypeFromJSType(simpleInferExprType(getProp.getFirstChild()));
  if (rawType == null) {
    return;
  }
  String pname=getProp.getLastChild().getString();
  JSType declType=getDeclaredTypeOfNode(NodeUtil.getBestJSDocInfo(getProp),currentScope);
  if (declType != null) {
    declType=declType.substituteGenericsWithUnknown();
    if (mayWarnAboutExistingProp(rawType,pname,getProp,declType)) {
      return;
    }
    rawType.addPropertyWhichMayNotBeOnAllInstances(pname,declType);
  }
 else   if (!rawType.mayHaveProp(pname)) {
    rawType.addPropertyWhichMayNotBeOnAllInstances(pname,null);
  }
}

Fixed version (ground truth):
private void visitOtherPropertyDeclaration(Node getProp){
  Preconditions.checkArgument(getProp.isGetProp());
  if (isAnnotatedAsConst(getProp)) {
    warnings.add(JSError.make(getProp,MISPLACED_CONST_ANNOTATION));
  }
  JSType recvType=simpleInferExprType(getProp.getFirstChild());
  if (recvType == null) {
    return;
  }
  NominalType nt=recvType.getNominalTypeIfSingletonObj();
  if (nt == null || nt.equals(commonTypes.getObjectType())) {
    return;
  }
  RawNominalType rawType=nt.getRawNominalType();
  String pname=getProp.getLastChild().getString();
  JSType declType=getDeclaredTypeOfNode(NodeUtil.getBestJSDocInfo(getProp),currentScope);
  if (declType != null) {
    declType=declType.substituteGenericsWithUnknown();
    if (mayWarnAboutExistingProp(rawType,pname,getProp,declType)) {
      return;
    }
    rawType.addPropertyWhichMayNotBeOnAllInstances(pname,declType);
  }
 else   if (!rawType.mayHaveProp(pname)) {
    rawType.addPropertyWhichMayNotBeOnAllInstances(pname,null);
  }
}
Program: 27523
Project: 27523
Buggy source:
public NominalType getNominalType(){
  return nominalType;
}

Fixed version (ground truth):
NominalType getNominalType(){
  return this.nominalType == null ? ObjectType.builtinObject : this.nominalType;
}
Program: 27524
Project: 27524
Buggy source:
public void testInvalidThisReference(){
  typeCheck("String_Node_Str",CheckGlobalThis.GLOBAL_THIS);
  typeCheck("String_Node_Str");
  typeCheck("String_Node_Str");
  typeCheck("String_Node_Str",CheckGlobalThis.GLOBAL_THIS);
  typeCheck("String_Node_Str",CheckGlobalThis.GLOBAL_THIS);
  typeCheck("String_Node_Str",CheckGlobalThis.GLOBAL_THIS);
  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"),CheckGlobalThis.GLOBAL_THIS);
}

Fixed version (ground truth):
public void testInvalidThisReference(){
  typeCheck("String_Node_Str",CheckGlobalThis.GLOBAL_THIS);
  typeCheck("String_Node_Str");
  typeCheck("String_Node_Str");
  typeCheck("String_Node_Str",CheckGlobalThis.GLOBAL_THIS);
  typeCheck("String_Node_Str",CheckGlobalThis.GLOBAL_THIS);
  typeCheck("String_Node_Str",CheckGlobalThis.GLOBAL_THIS);
  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"),CheckGlobalThis.GLOBAL_THIS);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27526
Project: 27526
Buggy source:
private RawNominalType(Node defSite,String name,ImmutableList<String> typeParameters,boolean isInterface,ObjectKind objectKind){
  Preconditions.checkNotNull(objectKind);
  Preconditions.checkState(defSite == null || defSite.isFunction());
  if (typeParameters == null) {
    typeParameters=ImmutableList.of();
  }
  this.name=name;
  this.defSite=defSite;
  this.typeParameters=typeParameters;
  this.isInterface=isInterface;
  this.objectKind=objectKind;
  this.wrappedAsNominal=new NominalType(ImmutableMap.<String,JSType>of(),this);
  ObjectType objInstance="String_Node_Str".equals(name) ? ObjectType.fromFunction(FunctionType.TOP_FUNCTION,this.wrappedAsNominal) : ObjectType.fromNominalType(this.wrappedAsNominal);
  this.wrappedAsJSType=JSType.fromObjectType(objInstance);
  this.wrappedAsNullableJSType=JSType.join(JSType.NULL,this.wrappedAsJSType);
}

Fixed version (ground truth):
private RawNominalType(Node defSite,String name,ImmutableList<String> typeParameters,boolean isInterface,ObjectKind objectKind){
  Preconditions.checkNotNull(objectKind);
  Preconditions.checkState(defSite == null || defSite.isFunction());
  if (typeParameters == null) {
    typeParameters=ImmutableList.of();
  }
  this.name=name;
  this.defSite=defSite;
  this.typeParameters=typeParameters;
  this.isInterface=isInterface;
  this.objectKind=objectKind;
  this.wrappedAsNominal=new NominalType(ImmutableMap.<String,JSType>of(),this);
  ObjectType objInstance;
switch (name) {
case "String_Node_Str":
    objInstance=ObjectType.fromFunction(FunctionType.TOP_FUNCTION,this.wrappedAsNominal);
  break;
case "String_Node_Str":
objInstance=ObjectType.TOP_OBJECT;
break;
default :
objInstance=ObjectType.fromNominalType(this.wrappedAsNominal);
}
this.wrappedAsJSType=JSType.fromObjectType(objInstance);
this.wrappedAsNullableJSType=JSType.join(JSType.NULL,this.wrappedAsJSType);
}
Program: 27527
Project: 27527
Buggy source:
public void testObjectType(){
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
}

Fixed version (ground truth):
public void testObjectType(){
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"));
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  typeCheck("String_Node_Str");
}
Program: 27528
Project: 27528
Buggy source:
private DeclaredFunctionType getDeclaredFunctionTypeFromContext(String functionName,Node declNode,Scope parentScope){
  Node parent=declNode.getParent();
  if (NodeUtil.isFunctionBind(parent) && !NodeUtil.isGoogPartial(parent)) {
    Node call=parent.isCall() ? parent : parent.getParent();
    Bind bindComponents=convention.describeFunctionBind(call,true,false);
    JSType recvType=simpleInferExprType(bindComponents.thisValue);
    if (recvType == null) {
      return null;
    }
    DeclaredFunctionType allButRecvType=typeParser.getFunctionType(null,functionName,declNode,null,null,parentScope);
    DeclaredFunctionType onlyHasRecvType=(new FunctionTypeBuilder()).addReceiverType(recvType.getNominalTypeIfSingletonObj()).buildDeclaration();
    return onlyHasRecvType.withTypeInfoFromSuper(allButRecvType,true);
  }
  if (parent.isCall() && declNode != parent.getFirstChild()) {
    DeclaredFunctionType calleeDeclType=getDeclaredFunctionTypeOfCalleeIfAny(parent.getFirstChild(),parentScope);
    if (calleeDeclType != null && !calleeDeclType.isGeneric()) {
      int index=parent.getIndexOfChild(declNode) - 1;
      JSType declTypeFromCallee=calleeDeclType.getFormalType(index);
      if (declTypeFromCallee != null) {
        DeclaredFunctionType t=computeFnDeclaredTypeFromCallee(declNode,declTypeFromCallee);
        if (t != null) {
          return t;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private DeclaredFunctionType getDeclaredFunctionTypeFromContext(String functionName,Node declNode,Scope parentScope){
  Node parent=declNode.getParent();
  Node maybeBind=parent.isCall() ? parent.getFirstChild() : parent;
  if (NodeUtil.isFunctionBind(maybeBind) && !NodeUtil.isGoogPartial(maybeBind)) {
    Node call=maybeBind.getParent();
    Bind bindComponents=convention.describeFunctionBind(call,true,false);
    JSType recvType=simpleInferExprType(bindComponents.thisValue);
    if (recvType == null) {
      return null;
    }
    DeclaredFunctionType allButRecvType=typeParser.getFunctionType(null,functionName,declNode,null,null,parentScope);
    DeclaredFunctionType onlyHasRecvType=(new FunctionTypeBuilder()).addReceiverType(recvType.getNominalTypeIfSingletonObj()).buildDeclaration();
    return onlyHasRecvType.withTypeInfoFromSuper(allButRecvType,true);
  }
  if (parent.isCall() && declNode != parent.getFirstChild()) {
    DeclaredFunctionType calleeDeclType=getDeclaredFunctionTypeOfCalleeIfAny(parent.getFirstChild(),parentScope);
    if (calleeDeclType != null && !calleeDeclType.isGeneric()) {
      int index=parent.getIndexOfChild(declNode) - 1;
      JSType declTypeFromCallee=calleeDeclType.getFormalType(index);
      if (declTypeFromCallee != null) {
        DeclaredFunctionType t=computeFnDeclaredTypeFromCallee(declNode,declTypeFromCallee);
        if (t != null) {
          return t;
        }
      }
    }
  }
  return null;
}
Program: 27530
Project: 27530
Buggy source:
static boolean isGoogPartial(Node n){
  return n.isCall() && n.getFirstChild().isQualifiedName() && n.getFirstChild().matchesQualifiedName("String_Node_Str");
}

Fixed version (ground truth):
static boolean isGoogPartial(Node n){
  return n.isGetProp() && n.matchesQualifiedName("String_Node_Str");
}
Program: 27531
Project: 27531
Buggy source:
static boolean isGoogBind(Node n){
  return n.isCall() && n.getFirstChild().isQualifiedName() && n.getFirstChild().matchesQualifiedName("String_Node_Str");
}

Fixed version (ground truth):
static boolean isGoogBind(Node n){
  return n.isGetProp() && n.matchesQualifiedName("String_Node_Str");
}
Program: 27532
Project: 27532
Buggy source:
static boolean isFunctionBind(Node expr){
  if (expr.isCall()) {
    expr=expr.getFirstChild();
  }
  if (!expr.isGetProp()) {
    return false;
  }
  if (isGoogBind(expr.getParent()) || isGoogPartial(expr.getParent())) {
    return true;
  }
  return expr.getFirstChild().isFunction() && expr.getLastChild().getString().equals("String_Node_Str");
}

Fixed version (ground truth):
static boolean isFunctionBind(Node expr){
  if (!expr.isGetProp()) {
    return false;
  }
  if (isGoogBind(expr) || isGoogPartial(expr)) {
    return true;
  }
  return expr.getFirstChild().isFunction() && expr.getLastChild().getString().equals("String_Node_Str");
}
Program: 27533
Project: 27533
Buggy source:
public void addPropertyWhichMayNotBeOnAllInstances(String pname,JSType type){
  Preconditions.checkState(!isFinalized);
  Preconditions.checkState(!this.classProps.containsKey(pname));
  Preconditions.checkState(!this.protoProps.containsKey(pname));
  if (this.objectKind == ObjectKind.UNRESTRICTED) {
    this.randomProps=this.randomProps.with(pname,Property.make(type == null ? JSType.UNKNOWN : type,type));
  }
}

Fixed version (ground truth):
public void addPropertyWhichMayNotBeOnAllInstances(String pname,JSType type){
  Preconditions.checkState(!isFinalized);
  if (this.classProps.containsKey(pname) || this.protoProps.containsKey(pname)) {
    return;
  }
  if (this.objectKind == ObjectKind.UNRESTRICTED) {
    this.randomProps=this.randomProps.with(pname,Property.make(type == null ? JSType.UNKNOWN : type,type));
  }
}
Program: 27534
Project: 27534
Buggy source:
public void testClosureStyleFunctionBind(){
  typeCheck("String_Node_Str",NewTypeInference.GOOG_BIND_EXPECTS_FUNCTION);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),TypeCheck.WRONG_ARGUMENT_COUNT);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),TypeCheck.WRONG_ARGUMENT_COUNT);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_THIS_TYPE_IN_BIND);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  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"),NewTypeInference.INVALID_OPERAND_TYPE);
  typeCheck("String_Node_Str");
}

Fixed version (ground truth):
public void testClosureStyleFunctionBind(){
  typeCheck("String_Node_Str",NewTypeInference.GOOG_BIND_EXPECTS_FUNCTION);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),TypeCheck.WRONG_ARGUMENT_COUNT);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),TypeCheck.WRONG_ARGUMENT_COUNT);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_THIS_TYPE_IN_BIND);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  typeCheck(Joiner.on('\n').join("String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  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"),NewTypeInference.INVALID_OPERAND_TYPE);
  typeCheck("String_Node_Str");
  typeCheck("String_Node_Str");
}
Program: 27536
Project: 27536
Buggy source:
private void visitYieldExpression(Node n){
  if (n.getParent().isExprResult()) {
    return;
  }
  if (decomposer.canExposeExpression(n) != ExpressionDecomposer.DecompositionType.UNDECOMPOSABLE) {
    decomposer.exposeExpression(n);
    compiler.reportCodeChange();
  }
 else {
    compiler.report(JSError.make(currentStatement,Es6ToEs3Converter.CANNOT_CONVERT,"String_Node_Str"));
  }
}

Fixed version (ground truth):
private void visitYieldExpression(Node n){
  if (n.getParent().isExprResult()) {
    return;
  }
  if (decomposer.canExposeExpression(n) != ExpressionDecomposer.DecompositionType.UNDECOMPOSABLE) {
    decomposer.exposeExpression(n);
    compiler.reportCodeChange();
  }
 else {
    compiler.report(JSError.make(n,Es6ToEs3Converter.CANNOT_CONVERT,"String_Node_Str"));
  }
}
Program: 27537
Project: 27537
Buggy source:
/** 
 * Replaces a CALL node with an inlined message value. <p> The call tree looks something like: <pre> call |-- getprop |   |-- name 'goog' |   +-- string 'getMsg' | |-- string 'Hi {$userName}! Welcome to {$product}.' +-- objlit |-- string 'userName' |-- name 'someUserName' |-- string 'product' +-- call +-- name 'getProductName' <pre> <p> For that example, we'd return: <pre> add |-- string 'Hi ' +-- add |-- name someUserName +-- add |-- string '! Welcome to ' +-- add |-- call |   +-- name 'getProductName' +-- string '.' </pre>
 * @param message  a message
 * @param callNode  the message's original CALL value node
 * @return a STRING node, or an ADD node that does string concatenation, ifthe message has one or more placeholders
 * @throws MalformedException if the passed node's subtree structure isnot as expected
 */
private Node replaceCallNode(JsMessage message,Node callNode) throws MalformedException {
  checkNode(callNode,Token.CALL);
  Node getPropNode=callNode.getFirstChild();
  checkNode(getPropNode,Token.GETPROP);
  Node stringExprNode=getPropNode.getNext();
  checkStringExprNode(stringExprNode);
  Node objLitNode=stringExprNode.getNext();
  return constructStringExprNode(message.parts().iterator(),objLitNode);
}

Fixed version (ground truth):
/** 
 * Replaces a CALL node with an inlined message value. <p> The call tree looks something like: <pre> call |-- getprop |   |-- name 'goog' |   +-- string 'getMsg' | |-- string 'Hi {$userName}! Welcome to {$product}.' +-- objlit |-- string 'userName' |-- name 'someUserName' |-- string 'product' +-- call +-- name 'getProductName' <pre> <p> For that example, we'd return: <pre> add |-- string 'Hi ' +-- add |-- name someUserName +-- add |-- string '! Welcome to ' +-- add |-- call |   +-- name 'getProductName' +-- string '.' </pre>
 * @param message  a message
 * @param callNode  the message's original CALL value node
 * @return a STRING node, or an ADD node that does string concatenation, ifthe message has one or more placeholders
 * @throws MalformedException if the passed node's subtree structure isnot as expected
 */
private Node replaceCallNode(JsMessage message,Node callNode) throws MalformedException {
  checkNode(callNode,Token.CALL);
  Node getPropNode=callNode.getFirstChild();
  checkNode(getPropNode,Token.GETPROP);
  Node stringExprNode=getPropNode.getNext();
  checkStringExprNode(stringExprNode);
  Node objLitNode=stringExprNode.getNext();
  return constructStringExprNode(message.parts().iterator(),objLitNode,callNode);
}
Program: 27538
Project: 27538
Buggy source:
/** 
 * Creates a parse tree corresponding to the remaining message parts in an iteration. The result consists of one or more STRING nodes, placeholder replacement value nodes (which can be arbitrary expressions), and ADD nodes.
 * @param parts  an iterator over message parts
 * @param objLitNode  an OBJLIT node mapping placeholder names to values
 * @return the root of the constructed parse tree
 * @throws MalformedException if {@code parts} contains a placeholderreference that does not correspond to a valid placeholder name
 */
private static Node constructStringExprNode(Iterator<CharSequence> parts,Node objLitNode) throws MalformedException {
  CharSequence part=parts.next();
  Node partNode=null;
  if (part instanceof JsMessage.PlaceholderReference) {
    JsMessage.PlaceholderReference phRef=(JsMessage.PlaceholderReference)part;
    if (objLitNode == null) {
      throw new MalformedException("String_Node_Str" + "String_Node_Str",objLitNode);
    }
    for (Node key=objLitNode.getFirstChild(); key != null; key=key.getNext()) {
      if (key.getString().equals(phRef.getName())) {
        Node valueNode=key.getFirstChild();
        partNode=valueNode.cloneTree();
      }
    }
    if (partNode == null) {
      throw new MalformedException("String_Node_Str" + phRef.getName(),objLitNode);
    }
  }
 else {
    partNode=IR.string(part.toString());
  }
  if (parts.hasNext()) {
    return IR.add(partNode,constructStringExprNode(parts,objLitNode));
  }
 else {
    return partNode;
  }
}

Fixed version (ground truth):
/** 
 * Creates a parse tree corresponding to the remaining message parts in an iteration. The result consists of one or more STRING nodes, placeholder replacement value nodes (which can be arbitrary expressions), and ADD nodes.
 * @param parts  an iterator over message parts
 * @param objLitNode  an OBJLIT node mapping placeholder names to values
 * @return the root of the constructed parse tree
 * @throws MalformedException if {@code parts} contains a placeholderreference that does not correspond to a valid placeholder name
 */
private static Node constructStringExprNode(Iterator<CharSequence> parts,Node objLitNode,Node refNode) throws MalformedException {
  Preconditions.checkNotNull(refNode);
  CharSequence part=parts.next();
  Node partNode=null;
  if (part instanceof JsMessage.PlaceholderReference) {
    JsMessage.PlaceholderReference phRef=(JsMessage.PlaceholderReference)part;
    if (objLitNode == null) {
      throw new MalformedException("String_Node_Str" + "String_Node_Str",refNode);
    }
    for (Node key=objLitNode.getFirstChild(); key != null; key=key.getNext()) {
      if (key.getString().equals(phRef.getName())) {
        Node valueNode=key.getFirstChild();
        partNode=valueNode.cloneTree();
      }
    }
    if (partNode == null) {
      throw new MalformedException("String_Node_Str" + phRef.getName(),objLitNode);
    }
  }
 else {
    partNode=IR.string(part.toString());
  }
  if (parts.hasNext()) {
    return IR.add(partNode,constructStringExprNode(parts,objLitNode,refNode));
  }
 else {
    return partNode;
  }
}
Program: 27540
Project: 27540
Buggy source:
private void visitPrototypePropertyDeclaration(Node getProp){
  Preconditions.checkArgument(getProp.isGetProp());
  Node parent=getProp.getParent();
  Node initializer=parent.isAssign() ? parent.getLastChild() : null;
  Node ctorNameNode=NodeUtil.getPrototypeClassName(getProp);
  QualifiedName ctorQname=QualifiedName.fromNode(ctorNameNode);
  RawNominalType rawType=currentScope.getNominalType(ctorQname);
  if (rawType == null) {
    if (initializer != null && initializer.isFunction()) {
      visitFunctionLate(initializer,null);
    }
    return;
  }
  if (!currentScope.isDefined(ctorNameNode)) {
    warnings.add(JSError.make(getProp,CTOR_IN_DIFFERENT_SCOPE));
    if (initializer != null && initializer.isFunction()) {
      visitFunctionLate(initializer,rawType);
    }
    return;
  }
  mayWarnAboutInterfacePropInit(rawType,initializer);
  String pname=NodeUtil.getPrototypePropertyName(getProp);
  mayAddPropToPrototype(rawType,pname,getProp,initializer);
}

Fixed version (ground truth):
private void visitPrototypePropertyDeclaration(Node getProp){
  Preconditions.checkArgument(getProp.isGetProp());
  Node parent=getProp.getParent();
  Node initializer=parent.isAssign() ? parent.getLastChild() : null;
  Node ctorNameNode=NodeUtil.getPrototypeClassName(getProp);
  QualifiedName ctorQname=QualifiedName.fromNode(ctorNameNode);
  RawNominalType rawType=currentScope.getNominalType(ctorQname);
  if (rawType == null) {
    if (initializer != null && initializer.isFunction()) {
      visitFunctionLate(initializer,null);
    }
    return;
  }
  if (initializer != null && initializer.isFunction()) {
    parent.putBooleanProp(Node.ANALYZED_DURING_GTI,true);
  }
  if (!currentScope.isDefined(ctorNameNode)) {
    warnings.add(JSError.make(getProp,CTOR_IN_DIFFERENT_SCOPE));
    if (initializer != null && initializer.isFunction()) {
      visitFunctionLate(initializer,rawType);
    }
    return;
  }
  mayWarnAboutInterfacePropInit(rawType,initializer);
  String pname=NodeUtil.getPrototypePropertyName(getProp);
  mayAddPropToPrototype(rawType,pname,getProp,initializer);
}
Program: 27542
Project: 27542
Buggy source:
boolean isSubtypeOf(NominalType other){
  RawNominalType thisRaw=this.rawType;
  if (thisRaw == other.rawType) {
    return areTypeParametersSubtypes(other);
  }
  if (other.isInterface()) {
    for (    NominalType i : thisRaw.getInterfaces()) {
      if (i.instantiateGenerics(this.typeMap).isSubtypeOf(other)) {
        return true;
      }
    }
  }
  return isClass() && thisRaw.superClass != null && thisRaw.superClass.instantiateGenerics(this.typeMap).isSubtypeOf(other);
}

Fixed version (ground truth):
boolean isSubtypeOf(NominalType other){
  RawNominalType thisRaw=this.rawType;
  if (thisRaw == other.rawType) {
    return areTypeMapsCompatible(other);
  }
  if (other.isInterface()) {
    for (    NominalType i : thisRaw.getInterfaces()) {
      if (i.instantiateGenerics(this.typeMap).isSubtypeOf(other)) {
        return true;
      }
    }
  }
  return isClass() && thisRaw.superClass != null && thisRaw.superClass.instantiateGenerics(this.typeMap).isSubtypeOf(other);
}