nus-yam/ex-repair huggingface dataset:
Program: 27166
Project: 27166
Buggy source:
public void testForOfWithDestructuring(){
  inFunction(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  inFunction(lines("String_Node_Str","String_Node_Str","String_Node_Str"),lines("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testForOfWithDestructuring(){
  inFunction(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  inFunction(lines("String_Node_Str","String_Node_Str","String_Node_Str"));
  inFunction("String_Node_Str");
  inFunction("String_Node_Str");
  inFunction("String_Node_Str","String_Node_Str");
}
Program: 27168
Project: 27168
Buggy source:
/** 
 * For each node, update the block stack and reference collection as appropriate.
 */
@Override public void visit(NodeTraversal t,Node n,Node parent){
  if (n.isName() || n.isImportStar() || (n.isStringKey() && !n.hasChildren())) {
    Var v=t.getScope().getVar(n.getString());
    if (v != null) {
      if (varFilter.apply(v)) {
        addReference(v,new Reference(n,t,peek(blockStack)));
      }
      if (v.getParentNode() != null && NodeUtil.isHoistedFunctionDeclaration(v.getParentNode()) && (narrowScope == null || narrowScope.getDepth() <= v.getScope().getDepth())) {
        outOfBandTraversal(v);
      }
    }
  }
  if (isBlockBoundary(n,parent)) {
    pop(blockStack);
  }
}

Fixed version (ground truth):
/** 
 * For each node, update the block stack and reference collection as appropriate.
 */
@Override public void visit(NodeTraversal t,Node n,Node parent){
  if (n.isName() || n.isImportStar() || (n.isStringKey() && !n.hasChildren())) {
    if ((parent.isImportSpec() && n != parent.getLastChild()) || (parent.isExportSpec() && n != parent.getFirstChild())) {
      return;
    }
    Var v=t.getScope().getVar(n.getString());
    if (v != null) {
      if (varFilter.apply(v)) {
        addReference(v,new Reference(n,t,peek(blockStack)));
      }
      if (v.getParentNode() != null && NodeUtil.isHoistedFunctionDeclaration(v.getParentNode()) && (narrowScope == null || narrowScope.getDepth() <= v.getScope().getDepth())) {
        outOfBandTraversal(v);
      }
    }
  }
  if (isBlockBoundary(n,parent)) {
    pop(blockStack);
  }
}
Program: 27169
Project: 27169
Buggy source:
public void testFailModule(){
  testError("String_Node_Str",EXTRA_REQUIRE_WARNING);
  testError(lines("String_Node_Str","String_Node_Str","String_Node_Str"),EXTRA_REQUIRE_WARNING);
}

Fixed version (ground truth):
public void testFailModule(){
  testError("String_Node_Str",EXTRA_REQUIRE_WARNING);
  testError("String_Node_Str",EXTRA_REQUIRE_WARNING);
  testError("String_Node_Str",EXTRA_REQUIRE_WARNING);
  testError(lines("String_Node_Str","String_Node_Str","String_Node_Str"),EXTRA_REQUIRE_WARNING);
}
Program: 27170
Project: 27170
Buggy source:
public void testES6ModuleWithDestructuringRequire(){
  testError(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),EXTRA_REQUIRE_WARNING);
}

Fixed version (ground truth):
public void testES6ModuleWithDestructuringRequire(){
  testError(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),EXTRA_REQUIRE_WARNING);
  testError(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),EXTRA_REQUIRE_WARNING);
  testError(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),EXTRA_REQUIRE_WARNING);
}
Program: 27171
Project: 27171
Buggy source:
public void testRedeclareVariableFromImport(){
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  testSame("String_Node_Str");
}

Fixed version (ground truth):
public void testRedeclareVariableFromImport(){
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  assertRedeclareError("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
}
Program: 27172
Project: 27172
Buggy source:
public void testES6Module_destructuring(){
  enableUnusedLocalAssignmentCheck=true;
  assertNoWarning("String_Node_Str");
}

Fixed version (ground truth):
public void testES6Module_destructuring(){
  enableUnusedLocalAssignmentCheck=true;
  assertNoWarning("String_Node_Str");
  assertNoWarning("String_Node_Str");
  assertNoWarning("String_Node_Str");
}
Program: 27173
Project: 27173
Buggy source:
public NameDeclarationStatement(RemovableBuilder builder,Node declarationStatement){
  super(builder);
  this.declarationStatement=declarationStatement;
}

Fixed version (ground truth):
public NameDeclarationStatement(RemovableBuilder builder,Node declarationStatement){
  super(builder);
  checkArgument(NodeUtil.isNameDeclaration(declarationStatement),declarationStatement);
  this.declarationStatement=declarationStatement;
}
Program: 27174
Project: 27174
Buggy source:
Assign(RemovableBuilder builder,Node assignNode,Kind kind,@Nullable Node propertyNode){
  super(builder);
  checkState(NodeUtil.isAssignmentOp(assignNode));
  if (kind == Kind.VARIABLE) {
    checkArgument(propertyNode == null,"String_Node_Str",propertyNode);
  }
 else {
    checkArgument(propertyNode != null,"String_Node_Str");
    if (kind == Kind.NAMED_PROPERTY) {
      checkArgument(propertyNode.isString(),"String_Node_Str",propertyNode);
    }
  }
  this.assignNode=assignNode;
  this.kind=kind;
  this.propertyNode=propertyNode;
  this.maybeAliased=NodeUtil.isExpressionResultUsed(assignNode);
}

Fixed version (ground truth):
Assign(RemovableBuilder builder,Node assignNode,Kind kind,@Nullable Node propertyNode){
  super(builder);
  checkArgument(NodeUtil.isAssignmentOp(assignNode),assignNode);
  if (kind == Kind.VARIABLE) {
    checkArgument(propertyNode == null,"String_Node_Str",propertyNode);
  }
 else {
    checkArgument(propertyNode != null,"String_Node_Str");
    if (kind == Kind.NAMED_PROPERTY) {
      checkArgument(propertyNode.isString(),"String_Node_Str",propertyNode);
    }
  }
  this.assignNode=assignNode;
  this.kind=kind;
  this.propertyNode=propertyNode;
  this.maybeAliased=NodeUtil.isExpressionResultUsed(assignNode);
}
Program: 27175
Project: 27175
Buggy source:
private void addSyntheticConstructor(Node classNode){
  Node superClass=classNode.getSecondChild();
  Node classMembers=classNode.getLastChild();
  Node memberDef;
  if (superClass.isEmpty()) {
    Node function=NodeUtil.emptyFunction();
    compiler.reportChangeToChangeScope(function);
    memberDef=IR.memberFunctionDef("String_Node_Str",function);
  }
 else {
    if (!superClass.isQualifiedName()) {
      return;
    }
    Node body=IR.block();
    if (!classNode.isFromExterns() && !isInterface(classNode)) {
      Node exprResult=IR.exprResult(IR.call(IR.getprop(IR.superNode(),IR.string("String_Node_Str")),IR.thisNode(),IR.name("String_Node_Str")));
      body.addChildToFront(exprResult);
    }
    Node constructor=IR.function(IR.name("String_Node_Str"),IR.paramList(IR.name("String_Node_Str")),body);
    compiler.reportChangeToChangeScope(constructor);
    memberDef=IR.memberFunctionDef("String_Node_Str",constructor);
    JSDocInfoBuilder info=new JSDocInfoBuilder(false);
    info.recordParameter("String_Node_Str",new JSTypeExpression(new Node(Token.ELLIPSIS,new Node(Token.QMARK)),"String_Node_Str"));
    memberDef.setJSDocInfo(info.build());
  }
  memberDef.useSourceInfoIfMissingFromForTree(classNode);
  classMembers.addChildToFront(memberDef);
  compiler.reportChangeToEnclosingScope(memberDef);
}

Fixed version (ground truth):
private void addSyntheticConstructor(Node classNode){
  Node superClass=classNode.getSecondChild();
  Node classMembers=classNode.getLastChild();
  Node memberDef;
  if (superClass.isEmpty()) {
    Node function=NodeUtil.emptyFunction();
    compiler.reportChangeToChangeScope(function);
    memberDef=IR.memberFunctionDef("String_Node_Str",function);
  }
 else {
    if (!superClass.isQualifiedName()) {
      return;
    }
    Node body=IR.block();
    if (!classNode.isFromExterns() && !isInterface(classNode)) {
      Node exprResult=IR.exprResult(IR.call(IR.getprop(IR.superNode(),IR.string("String_Node_Str")),IR.thisNode(),IR.name("String_Node_Str")));
      body.addChildToFront(exprResult);
    }
    Node constructor=IR.function(IR.name("String_Node_Str"),IR.paramList(IR.name("String_Node_Str")),body);
    compiler.reportChangeToChangeScope(constructor);
    memberDef=IR.memberFunctionDef("String_Node_Str",constructor);
    JSDocInfoBuilder info=new JSDocInfoBuilder(false);
    info.recordParameter("String_Node_Str",new JSTypeExpression(new Node(Token.ELLIPSIS,new Node(Token.QMARK)),"String_Node_Str"));
    memberDef.setJSDocInfo(info.build());
  }
  memberDef.useSourceInfoIfMissingFromForTree(classNode);
  memberDef.makeNonIndexableRecursive();
  classMembers.addChildToFront(memberDef);
  compiler.reportChangeToEnclosingScope(memberDef);
}
Program: 27177
Project: 27177
Buggy source:
public void assertHasEncounteredAllErrors(){
  assertThat(errors).hasLength(errorsIndex);
}

Fixed version (ground truth):
public void assertHasEncounteredAllErrors(){
  if (errors.length != errorsIndex) {
    Assert.fail("String_Node_Str" + Arrays.asList(errors).subList(errorsIndex,errors.length));
  }
}
Program: 27178
Project: 27178
Buggy source:
public void assertHasEncounteredAllWarnings(){
  assertThat(warnings).hasLength(warningsIndex);
}

Fixed version (ground truth):
public void assertHasEncounteredAllWarnings(){
  if (warnings.length != warningsIndex) {
    Assert.fail("String_Node_Str" + Arrays.asList(warnings).subList(warningsIndex,warnings.length));
  }
}
Program: 27179
Project: 27179
Buggy source:
protected Compiler compile(CompilerOptions options,String[] original){
  Compiler compiler=useNoninjectingCompiler ? new NoninjectingCompiler() : new Compiler();
  lastCompiler=compiler;
  options.setErrorHandler(new BlackHoleErrorManager());
  compiler.compileModules(externs,ImmutableList.copyOf(CompilerTestCase.createModuleChain(ImmutableList.copyOf(original),inputFileNamePrefix,inputFileNameSuffix)),options);
  return compiler;
}

Fixed version (ground truth):
protected Compiler compile(CompilerOptions options,String[] original){
  Compiler compiler=useNoninjectingCompiler ? new NoninjectingCompiler(new BlackHoleErrorManager()) : new Compiler(new BlackHoleErrorManager());
  lastCompiler=compiler;
  compiler.compileModules(externs,ImmutableList.copyOf(CompilerTestCase.createModuleChain(ImmutableList.copyOf(original),inputFileNamePrefix,inputFileNameSuffix)),options);
  return compiler;
}
Program: 27180
Project: 27180
Buggy source:
@Override protected void setUp() throws Exception {
  super.setUp();
  options=new CompilerOptions();
  options.setErrorHandler(new BlackHoleErrorManager());
  options.setLanguageIn(LanguageMode.ECMASCRIPT_2017);
  options.setLanguageOut(LanguageMode.ECMASCRIPT5);
  options.setCodingConvention(new ClosureCodingConvention());
  CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
  WarningLevel.VERBOSE.setOptionsForWarningLevel(options);
  options.setChecksOnly(true);
  options.setPreserveDetailedSourceInfo(true);
  options.setContinueAfterErrors(true);
  options.setAllowHotswapReplaceScript(true);
  options.setParseJsDocDocumentation(INCLUDE_DESCRIPTIONS_NO_WHITESPACE);
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  super.setUp();
  options=new CompilerOptions();
  options.setLanguageIn(LanguageMode.ECMASCRIPT_2017);
  options.setLanguageOut(LanguageMode.ECMASCRIPT5);
  options.setCodingConvention(new ClosureCodingConvention());
  CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
  WarningLevel.VERBOSE.setOptionsForWarningLevel(options);
  options.setChecksOnly(true);
  options.setPreserveDetailedSourceInfo(true);
  options.setContinueAfterErrors(true);
  options.setAllowHotswapReplaceScript(true);
  options.setParseJsDocDocumentation(INCLUDE_DESCRIPTIONS_NO_WHITESPACE);
}
Program: 27181
Project: 27181
Buggy source:
private SymbolTable createSymbolTable(String input){
  List<SourceFile> inputs=ImmutableList.of(SourceFile.fromCode("String_Node_Str",input));
  List<SourceFile> externs=ImmutableList.of(SourceFile.fromCode("String_Node_Str",EXTERNS));
  Compiler compiler=new Compiler();
  compiler.compile(externs,inputs,options);
  return assertSymbolTableValid(compiler.buildKnownSymbolTable());
}

Fixed version (ground truth):
private SymbolTable createSymbolTable(String input){
  List<SourceFile> inputs=ImmutableList.of(SourceFile.fromCode("String_Node_Str",input));
  List<SourceFile> externs=ImmutableList.of(SourceFile.fromCode("String_Node_Str",EXTERNS));
  Compiler compiler=new Compiler(new BlackHoleErrorManager());
  compiler.compile(externs,inputs,options);
  return assertSymbolTableValid(compiler.buildKnownSymbolTable());
}
Program: 27182
Project: 27182
Buggy source:
private static Compiler getCompiler(String externs,String jsInput){
  Compiler compiler=new Compiler();
  compiler.disableThreads();
  CompilerOptions options=RefactoringDriver.getCompilerOptions();
  options.setErrorHandler(new BlackHoleErrorManager());
  compiler.compile(ImmutableList.of(SourceFile.fromCode("String_Node_Str",externs)),ImmutableList.of(SourceFile.fromCode("String_Node_Str",jsInput)),options);
  return compiler;
}

Fixed version (ground truth):
private static Compiler getCompiler(String externs,String jsInput){
  Compiler compiler=new Compiler(new BlackHoleErrorManager());
  compiler.disableThreads();
  CompilerOptions options=RefactoringDriver.getCompilerOptions();
  compiler.compile(ImmutableList.of(SourceFile.fromCode("String_Node_Str",externs)),ImmutableList.of(SourceFile.fromCode("String_Node_Str",jsInput)),options);
  return compiler;
}
Program: 27186
Project: 27186
Buggy source:
/** 
 * @param value The value to use when rewriting.
 * @param depth The chain depth.
 * @param newNodes Expression nodes that have been updated.
 * @param prop The property to rewrite with value.
 */
private void rewriteAliasProp(Node value,int depth,Set<AstChange> newNodes,Name prop){
  rewriteAliasProps(prop,value,depth + 1,newNodes);
  List<Ref> refs=new ArrayList<>(prop.getRefs());
  for (  Ref ref : refs) {
    Node target=ref.node;
    for (int i=0; i <= depth; i++) {
      if (target.isGetProp()) {
        target=target.getFirstChild();
      }
 else       if (NodeUtil.isObjectLitKey(target)) {
        Node gparent=target.getGrandparent();
        if (gparent.isAssign()) {
          target=gparent.getFirstChild();
        }
 else {
          checkState(NodeUtil.isObjectLitKey(gparent));
          target=gparent;
        }
      }
 else {
        throw new IllegalStateException("String_Node_Str" + target);
      }
    }
    checkState(target.isGetProp() || target.isName());
    Node newValue=value.cloneTree();
    target.replaceWith(newValue);
    compiler.reportChangeToEnclosingScope(newValue);
    prop.removeRef(ref);
    newNodes.add(new AstChange(ref.module,ref.scope,ref.node));
    codeChanged=true;
  }
}

Fixed version (ground truth):
/** 
 * @param value The value to use when rewriting.
 * @param depth The chain depth.
 * @param newNodes Expression nodes that have been updated.
 * @param prop The property to rewrite with value.
 */
private void rewriteAliasProp(Node value,int depth,Set<AstChange> newNodes,Name prop){
  rewriteAliasProps(prop,value,depth + 1,newNodes);
  List<Ref> refs=new ArrayList<>(prop.getRefs());
  for (  Ref ref : refs) {
    Node target=ref.node;
    for (int i=0; i <= depth; i++) {
      if (target.isGetProp()) {
        target=target.getFirstChild();
      }
 else       if (NodeUtil.isObjectLitKey(target)) {
        Node gparent=target.getGrandparent();
        if (gparent.isAssign()) {
          target=gparent.getFirstChild();
        }
 else {
          checkState(NodeUtil.isObjectLitKey(gparent));
          target=gparent;
        }
      }
 else {
        throw new IllegalStateException("String_Node_Str" + target);
      }
    }
    checkState(target.isGetProp() || target.isName());
    Node newValue=value.cloneTree();
    target.replaceWith(newValue);
    compiler.reportChangeToEnclosingScope(newValue);
    prop.removeRef(ref);
    newNodes.add(new AstChange(ref.module,ref.scope,ref.node));
  }
}
Program: 27189
Project: 27189
Buggy source:
/** 
 * @param value The value to use when rewriting.
 * @param depth The chain depth.
 * @param newNodes Expression nodes that have been updated.
 * @param prop The property to rewrite with value.
 */
private void rewriteAliasProp(Node value,int depth,Set<AstChange> newNodes,Name prop){
  rewriteAliasProps(prop,value,depth + 1,newNodes);
  List<Ref> refs=new ArrayList<>(prop.getRefs());
  for (  Ref ref : refs) {
    Node target=ref.node;
    for (int i=0; i <= depth; i++) {
      if (target.isGetProp()) {
        target=target.getFirstChild();
      }
 else       if (NodeUtil.isObjectLitKey(target)) {
        Node gparent=target.getGrandparent();
        if (gparent.isAssign()) {
          target=gparent.getFirstChild();
        }
 else {
          checkState(NodeUtil.isObjectLitKey(gparent));
          target=gparent;
        }
      }
 else {
        throw new IllegalStateException("String_Node_Str" + target);
      }
    }
    checkState(target.isGetProp() || target.isName());
    Node newValue=value.cloneTree();
    target.replaceWith(newValue);
    compiler.reportChangeToEnclosingScope(newValue);
    prop.removeRef(ref);
    newNodes.add(new AstChange(ref.module,ref.scope,ref.node));
  }
}

Fixed version (ground truth):
/** 
 * @param value The value to use when rewriting.
 * @param depth The chain depth.
 * @param newNodes Expression nodes that have been updated.
 * @param prop The property to rewrite with value.
 */
private void rewriteAliasProp(Node value,int depth,Set<AstChange> newNodes,Name prop){
  rewriteAliasProps(prop,value,depth + 1,newNodes);
  List<Ref> refs=new ArrayList<>(prop.getRefs());
  for (  Ref ref : refs) {
    Node target=ref.node;
    for (int i=0; i <= depth; i++) {
      if (target.isGetProp()) {
        target=target.getFirstChild();
      }
 else       if (NodeUtil.isObjectLitKey(target)) {
        Node gparent=target.getGrandparent();
        if (gparent.isAssign()) {
          target=gparent.getFirstChild();
        }
 else {
          checkState(NodeUtil.isObjectLitKey(gparent));
          target=gparent;
        }
      }
 else {
        throw new IllegalStateException("String_Node_Str" + target);
      }
    }
    checkState(target.isGetProp() || target.isName());
    Node newValue=value.cloneTree();
    target.replaceWith(newValue);
    compiler.reportChangeToEnclosingScope(newValue);
    prop.removeRef(ref);
    newNodes.add(new AstChange(ref.module,ref.scope,ref.node));
    codeChanged=true;
  }
}
Program: 27191
Project: 27191
Buggy source:
private void addNonUnionType(TypeI newType){
  if (skipAmbiguating || invalidatingTypes.isInvalidating(newType)) {
    skipAmbiguating=true;
    return;
  }
  if (!relatedTypes.get(getIntForType(newType))) {
    computeRelatedTypes(newType);
    relatedTypes.or(getRelatedTypesOnNonUnion(newType));
  }
}

Fixed version (ground truth):
private void addNonUnionType(TypeI newType){
  if (skipAmbiguating || invalidatingTypes.isInvalidating(newType)) {
    skipAmbiguating=true;
    return;
  }
  ObjectTypeI maybeObj=newType.toMaybeObjectType();
  if (maybeObj != null) {
    newType=maybeObj.withoutStrayProperties();
  }
  if (!relatedTypes.get(getIntForType(newType))) {
    computeRelatedTypes(newType);
    relatedTypes.or(getRelatedTypesOnNonUnion(newType));
  }
}
Program: 27192
Project: 27192
Buggy source:
@Override public ObjectTypeI withoutStrayProperties(){
  ObjectType obj=getObjTypeIfSingletonObj();
  NominalType nt=getNominalTypeIfSingletonObj();
  return nt.isLiteralObject() || obj.isPrototypeObject() || obj.isNamespace() ? this : nt.getInstanceAsJSType();
}

Fixed version (ground truth):
@Override public ObjectTypeI withoutStrayProperties(){
  ObjectType obj=getObjTypeIfSingletonObj();
  NominalType nt=getNominalTypeIfSingletonObj();
  if (nt.isLiteralObject()) {
    return this;
  }
  if (obj.isPrototypeObject()) {
    return obj.getOwnerFunction().getInstanceTypeOfCtor().getPrototypeObject();
  }
  if (obj.isNamespace()) {
    return obj.getNamespaceType();
  }
  return nt.getInstanceAsJSType();
}
Program: 27193
Project: 27193
Buggy source:
private static boolean canMergeObjectsInJoin(ObjectType obj1,ObjectType obj2){
  if (obj1.isTopObject() || obj2.isTopObject()) {
    return true;
  }
  NominalType nt1=obj1.nominalType;
  NominalType nt2=obj2.nominalType;
  if ((nt1.isBuiltinObject() || nt1.isLiteralObject()) && (nt2.isBuiltinObject() || nt2.isLiteralObject())) {
    return true;
  }
  if (nt1.isBuiltinObject()) {
    return obj1.isLoose && obj2.isSubtypeOf(obj1,SubtypeCache.create());
  }
  if (nt2.isBuiltinObject()) {
    return obj2.isLoose && obj1.isSubtypeOf(obj2,SubtypeCache.create());
  }
  return areRelatedNominalTypes(nt1,nt2) || NominalType.equalRawTypes(nt1,nt2);
}

Fixed version (ground truth):
private static boolean canMergeObjectsInJoin(ObjectType obj1,ObjectType obj2){
  if (obj1.isTopObject() || obj2.isTopObject() || obj1.equals(obj2)) {
    return true;
  }
  NominalType nt1=obj1.nominalType;
  NominalType nt2=obj2.nominalType;
  if (!obj1.isPrototypeObject() && (nt1.isBuiltinObject() || nt1.isLiteralObject()) && !obj2.isPrototypeObject()&& (nt2.isBuiltinObject() || nt2.isLiteralObject())) {
    return true;
  }
  if (nt1.isBuiltinObject()) {
    return obj1.isLoose && obj2.isSubtypeOf(obj1,SubtypeCache.create());
  }
  if (nt2.isBuiltinObject()) {
    return obj2.isLoose && obj1.isSubtypeOf(obj2,SubtypeCache.create());
  }
  return !obj1.isPrototypeObject() && !obj2.isPrototypeObject() && (areRelatedNominalTypes(nt1,nt2) || NominalType.equalRawTypes(nt1,nt2));
}
Program: 27194
Project: 27194
Buggy source:
Set<JSType> getSubtypesWithProperty(String pname){
  if (mayHaveProp(pname)) {
    if (this.protoProps.containsKey(pname)) {
      return ImmutableSet.of(this.protoObject);
    }
 else {
      return ImmutableSet.of(getInstanceAsJSType());
    }
  }
  HashSet<JSType> typesWithProp=new HashSet<>();
  for (  RawNominalType subtype : this.subtypes) {
    typesWithProp.addAll(subtype.getSubtypesWithProperty(pname));
  }
  return typesWithProp;
}

Fixed version (ground truth):
Set<JSType> getSubtypesWithProperty(String pname){
  if (mayHaveProp(pname)) {
    if (this.protoProps.containsKey(pname)) {
      return ImmutableSet.of(this.protoObject);
    }
    return ImmutableSet.of(getInstanceAsJSType());
  }
  HashSet<JSType> typesWithProp=new HashSet<>();
  for (  RawNominalType subtype : this.subtypes) {
    typesWithProp.addAll(subtype.getSubtypesWithProperty(pname));
  }
  return typesWithProp;
}
Program: 27195
Project: 27195
Buggy source:
public void testGetAllVars2(){
  String fnString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  Compiler compiler=new Compiler();
  compiler.setLifeCycleStage(LifeCycleStage.NORMALIZED);
  ScopeCreator scopeCreator=new Es6SyntacticScopeCreator(compiler);
  Node ast=parse(fnString);
  Node functionNode=getFunctionNode(fnString);
  Scope globalScope=Scope.createGlobalScope(ast);
  Scope functionScope=scopeCreator.createScope(functionNode,globalScope);
  Map<String,Var> allVariables=new HashMap<>();
  List<Var> orderedVars=new LinkedList<>();
  NodeUtil.getAllVarsDeclaredInFunction(allVariables,orderedVars,compiler,scopeCreator,functionScope);
  Set<String> keySet=new HashSet<>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  assertEquals(keySet,allVariables.keySet());
}

Fixed version (ground truth):
public void testGetAllVars2(){
  String fnString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  Compiler compiler=new Compiler();
  compiler.setLifeCycleStage(LifeCycleStage.NORMALIZED);
  ScopeCreator scopeCreator=new Es6SyntacticScopeCreator(compiler);
  Node ast=parse(fnString);
  Node functionNode=getFunctionNode(fnString);
  Scope globalScope=Scope.createGlobalScope(ast);
  Scope functionScope=scopeCreator.createScope(functionNode,globalScope);
  Map<String,Var> allVariables=new HashMap<>();
  List<Var> orderedVars=new ArrayList<>();
  NodeUtil.getAllVarsDeclaredInFunction(allVariables,orderedVars,compiler,scopeCreator,functionScope);
  Set<String> keySet=new HashSet<>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  assertEquals(keySet,allVariables.keySet());
}
Program: 27196
Project: 27196
Buggy source:
public void testGetAllVars1(){
  String fnString="String_Node_Str";
  Compiler compiler=new Compiler();
  compiler.setLifeCycleStage(LifeCycleStage.NORMALIZED);
  ScopeCreator scopeCreator=new Es6SyntacticScopeCreator(compiler);
  Node ast=parse(fnString);
  Node functionNode=getFunctionNode(fnString);
  Scope globalScope=Scope.createGlobalScope(ast);
  Scope functionScope=scopeCreator.createScope(functionNode,globalScope);
  Map<String,Var> allVariables=new HashMap<>();
  List<Var> orderedVars=new LinkedList<>();
  NodeUtil.getAllVarsDeclaredInFunction(allVariables,orderedVars,compiler,scopeCreator,functionScope);
  Set<String> keySet=new HashSet<>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  assertEquals(keySet,allVariables.keySet());
}

Fixed version (ground truth):
public void testGetAllVars1(){
  String fnString="String_Node_Str";
  Compiler compiler=new Compiler();
  compiler.setLifeCycleStage(LifeCycleStage.NORMALIZED);
  ScopeCreator scopeCreator=new Es6SyntacticScopeCreator(compiler);
  Node ast=parse(fnString);
  Node functionNode=getFunctionNode(fnString);
  Scope globalScope=Scope.createGlobalScope(ast);
  Scope functionScope=scopeCreator.createScope(functionNode,globalScope);
  Map<String,Var> allVariables=new HashMap<>();
  List<Var> orderedVars=new ArrayList<>();
  NodeUtil.getAllVarsDeclaredInFunction(allVariables,orderedVars,compiler,scopeCreator,functionScope);
  Set<String> keySet=new HashSet<>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  assertEquals(keySet,allVariables.keySet());
}
Program: 27198
Project: 27198
Buggy source:
public void testInvalidGoogBase14(){
  testError("String_Node_Str",GOOG_BASE_CLASS_ERROR);
}

Fixed version (ground truth):
public void testInvalidGoogBase14(){
  testError("String_Node_Str",BASE_CLASS_ERROR);
}
Program: 27199
Project: 27199
Buggy source:
public void testInvalidGoogBase14b(){
  testError("String_Node_Str",GOOG_BASE_CLASS_ERROR);
}

Fixed version (ground truth):
public void testInvalidGoogBase14b(){
  testError("String_Node_Str",BASE_CLASS_ERROR);
}
Program: 27202
Project: 27202
Buggy source:
private EnvTypePair analyzePropertyTestCallFwd(Node call,TypeEnv inEnv,JSType specializedType){
  return analyzeTypePredicate(call,call.getFirstChild().getLastChild().getString(),inEnv,specializedType);
}

Fixed version (ground truth):
private EnvTypePair analyzePropertyTestCallFwd(Node call,TypeEnv inEnv,JSType specializedType){
  analyzeExprFwdIgnoreResult(call.getFirstChild(),inEnv);
  return analyzeTypePredicate(call,call.getFirstChild().getLastChild().getString(),inEnv,specializedType);
}
Program: 27203
Project: 27203
Buggy source:
private EnvTypePair analyzeTypePredicate(Node call,String typeHint,TypeEnv inEnv,JSType specializedType){
  int numArgs=call.getChildCount() - 1;
  if (numArgs != 1) {
    warnings.add(JSError.make(call,WRONG_ARGUMENT_COUNT,call.getFirstChild().getQualifiedName(),Integer.toString(numArgs),"String_Node_Str","String_Node_Str"));
    return analyzeInvocationArgsFwdWhenError(call,inEnv);
  }
  EnvTypePair pair=analyzeExprFwd(call.getLastChild(),inEnv);
  if (specializedType.isTrueOrTruthy() || specializedType.isFalseOrFalsy()) {
    pair=analyzeExprFwd(call.getLastChild(),inEnv,UNKNOWN,predicateTransformType(typeHint,specializedType,pair.type));
  }
  pair.type=BOOLEAN;
  return pair;
}

Fixed version (ground truth):
private EnvTypePair analyzeTypePredicate(Node call,String typeHint,TypeEnv inEnv,JSType specializedType){
  analyzeExprFwdIgnoreResult(call.getFirstChild(),inEnv);
  int numArgs=call.getChildCount() - 1;
  if (numArgs != 1) {
    warnings.add(JSError.make(call,WRONG_ARGUMENT_COUNT,call.getFirstChild().getQualifiedName(),Integer.toString(numArgs),"String_Node_Str","String_Node_Str"));
    return analyzeInvocationArgsFwdWhenError(call,inEnv);
  }
  EnvTypePair pair=analyzeExprFwd(call.getLastChild(),inEnv);
  if (specializedType.isTrueOrTruthy() || specializedType.isFalseOrFalsy()) {
    pair=analyzeExprFwd(call.getLastChild(),inEnv,UNKNOWN,predicateTransformType(typeHint,specializedType,pair.type));
  }
  pair.type=BOOLEAN;
  return pair;
}
Program: 27204
Project: 27204
Buggy source:
private EnvTypePair analyzeIncDecFwd(Node expr,TypeEnv inEnv,JSType requiredType){
  mayWarnAboutConst(expr);
  Node ch=expr.getFirstChild();
  if (ch.isGetProp() || (ch.isGetElem() && ch.getLastChild().isString())) {
    Node recv=ch.getFirstChild();
    String pname=ch.getLastChild().getString();
    EnvTypePair pair=analyzeExprFwd(recv,inEnv);
    JSType recvType=pair.type;
    if (mayWarnAboutConstProp(ch,recvType,new QualifiedName(pname))) {
      pair.type=requiredType;
      return pair;
    }
  }
  return analyzeUnaryNumFwd(expr,inEnv);
}

Fixed version (ground truth):
private EnvTypePair analyzeIncDecFwd(Node expr,TypeEnv inEnv,JSType requiredType){
  mayWarnAboutConst(expr);
  Node ch=expr.getFirstChild();
  if (ch.isGetProp() || (ch.isGetElem() && ch.getLastChild().isString())) {
    Node recv=ch.getFirstChild();
    String pname=ch.getLastChild().getString();
    EnvTypePair pair=analyzeExprFwd(recv,inEnv);
    JSType recvType=pair.type;
    if (mayWarnAboutConstProp(ch,recvType,new QualifiedName(pname))) {
      maybeSetTypeI(ch,recvType.getProp(new QualifiedName(pname)));
      pair.type=requiredType;
      return pair;
    }
  }
  return analyzeUnaryNumFwd(expr,inEnv);
}
Program: 27205
Project: 27205
Buggy source:
private EnvTypePair analyzeAssertionCall(Node callNode,TypeEnv env,AssertionFunctionSpec assertionFunctionSpec){
  Node firstParam=callNode.getSecondChild();
  if (firstParam == null) {
    return new EnvTypePair(env,UNKNOWN);
  }
  Node assertedNode=assertionFunctionSpec.getAssertedParam(firstParam);
  if (assertedNode == null) {
    return new EnvTypePair(env,UNKNOWN);
  }
  JSType assertedType=assertionFunctionSpec.getAssertedNewType(callNode,currentScope);
  if (assertedType.isUnknown()) {
    warnings.add(JSError.make(callNode,UNKNOWN_ASSERTION_TYPE));
  }
  EnvTypePair pair=analyzeExprFwd(assertedNode,env,UNKNOWN,assertedType);
  boolean haveCommonSubtype=JSType.haveCommonSubtype(assertedType,pair.type);
  if (!pair.type.isSubtypeOf(assertedType) && haveCommonSubtype) {
    pair.type=assertedType;
  }
  if (!haveCommonSubtype) {
    JSType t=analyzeExprFwd(assertedNode,env).type.substituteGenericsWithUnknown();
    if (t.isSubtypeOf(assertedType)) {
      pair.type=t;
    }
 else {
      if (!firstParam.isFalse()) {
        warnings.add(JSError.make(assertedNode,ASSERT_FALSE));
      }
      pair.type=UNKNOWN;
      pair.env=env;
    }
  }
  return pair;
}

Fixed version (ground truth):
private EnvTypePair analyzeAssertionCall(Node callNode,TypeEnv env,AssertionFunctionSpec assertionFunctionSpec){
  analyzeExprFwdIgnoreResult(callNode.getFirstChild(),env);
  Node firstParam=callNode.getSecondChild();
  if (firstParam == null) {
    return new EnvTypePair(env,UNKNOWN);
  }
  for (  Node assertionArgument : firstParam.siblings()) {
    analyzeExprFwdIgnoreResult(assertionArgument,env);
  }
  Node assertedNode=assertionFunctionSpec.getAssertedParam(firstParam);
  if (assertedNode == null) {
    return new EnvTypePair(env,UNKNOWN);
  }
  JSType assertedType=assertionFunctionSpec.getAssertedNewType(callNode,currentScope);
  if (assertedType.isUnknown()) {
    warnings.add(JSError.make(callNode,UNKNOWN_ASSERTION_TYPE));
  }
  EnvTypePair pair=analyzeExprFwd(assertedNode,env,UNKNOWN,assertedType);
  boolean haveCommonSubtype=JSType.haveCommonSubtype(assertedType,pair.type);
  if (!pair.type.isSubtypeOf(assertedType) && haveCommonSubtype) {
    pair.type=assertedType;
  }
  if (!haveCommonSubtype) {
    JSType t=analyzeExprFwd(assertedNode,env).type.substituteGenericsWithUnknown();
    if (t.isSubtypeOf(assertedType)) {
      pair.type=t;
    }
 else {
      if (!firstParam.isFalse()) {
        warnings.add(JSError.make(assertedNode,ASSERT_FALSE));
      }
      pair.type=UNKNOWN;
      pair.env=env;
    }
  }
  return pair;
}
Program: 27207
Project: 27207
Buggy source:
private boolean isFunctionBind(Node expr,TypeEnv env,boolean isFwd){
  if (NodeUtil.isFunctionBind(expr)) {
    return true;
  }
  if (!expr.isGetProp() || !expr.isQualifiedName() || !expr.getLastChild().getString().equals("String_Node_Str")) {
    return false;
  }
  Node recv=expr.getFirstChild();
  JSType recvType=isFwd ? analyzeExprFwd(recv,env).type : analyzeExprBwd(recv,env).type;
  return !recvType.isUnknown() && recvType.isSubtypeOf(commonTypes.topFunction());
}

Fixed version (ground truth):
private boolean isFunctionBind(Node callee,TypeEnv env,boolean isFwd){
  if (NodeUtil.isFunctionBind(callee)) {
    if (isFwd) {
      analyzeExprFwdIgnoreResult(callee,env);
    }
    return true;
  }
  if (!callee.isGetProp() || !callee.isQualifiedName() || !callee.getLastChild().getString().equals("String_Node_Str")) {
    return false;
  }
  Node recv=callee.getFirstChild();
  JSType recvType;
  if (isFwd) {
    recvType=analyzeExprFwd(recv,env).type;
    maybeSetTypeI(callee,recvType.getProp(new QualifiedName("String_Node_Str")));
  }
 else {
    recvType=analyzeExprBwd(recv,env).type;
  }
  return !recvType.isUnknown() && recvType.isSubtypeOf(commonTypes.topFunction());
}
Program: 27209
Project: 27209
Buggy source:
private EnvTypePair analyzeGoogTypeof(Node typeof,Node typeString,TypeEnv inEnv,JSType specializedType){
  return analyzeTypePredicate(typeof,typeString.isString() ? typeString.getString() : "String_Node_Str",inEnv,specializedType);
}

Fixed version (ground truth):
private EnvTypePair analyzeGoogTypeof(Node typeof,Node typeString,TypeEnv inEnv,JSType specializedType){
  analyzeExprFwdIgnoreResult(typeString,inEnv);
  return analyzeTypePredicate(typeof,typeString.isString() ? typeString.getString() : "String_Node_Str",inEnv,specializedType);
}
Program: 27210
Project: 27210
Buggy source:
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");
}

Fixed version (ground truth):
/** 
 * Does not use type info. For example, it returns false for f.bind(...) because it cannot know whether f is a function.
 */
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: 27211
Project: 27211
Buggy source:
public void testClosureStyleFunctionBind(){
  typeCheck("String_Node_Str",NewTypeInference.GOOG_BIND_EXPECTS_FUNCTION);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str"),NewTypeInference.WRONG_ARGUMENT_COUNT);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str"),NewTypeInference.WRONG_ARGUMENT_COUNT);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_THIS_TYPE_IN_BIND);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(LINE_JOINER.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");
}

Fixed version (ground truth):
public void testClosureStyleFunctionBind(){
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"String_Node_Str"),NewTypeInference.GOOG_BIND_EXPECTS_FUNCTION);
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"String_Node_Str","String_Node_Str"),NewTypeInference.WRONG_ARGUMENT_COUNT);
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"String_Node_Str","String_Node_Str"),NewTypeInference.WRONG_ARGUMENT_COUNT);
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_THIS_TYPE_IN_BIND);
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_ARGUMENT_TYPE);
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.INVALID_OPERAND_TYPE);
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"String_Node_Str"));
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"String_Node_Str"));
}
Program: 27212
Project: 27212
Buggy source:
public void testSuperClassCtorProperty() throws Exception {
  String CLOSURE_DEFS=LINE_JOINER.join("String_Node_Str","String_Node_Str");
  typeCheck(CLOSURE_DEFS + LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(CLOSURE_DEFS + 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"),NewTypeInference.INEXISTENT_PROPERTY);
  typeCheck(CLOSURE_DEFS + LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(CLOSURE_DEFS + LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.MISTYPED_ASSIGN_RHS);
  typeCheck(CLOSURE_DEFS + "String_Node_Str",NewTypeInference.MISTYPED_ASSIGN_RHS);
  typeCheck(CLOSURE_DEFS + "String_Node_Str",NewTypeInference.INEXISTENT_PROPERTY);
  typeCheck(CLOSURE_DEFS + "String_Node_Str");
}

Fixed version (ground truth):
public void testSuperClassCtorProperty() throws Exception {
  String CLOSURE_DEFS=LINE_JOINER.join("String_Node_Str","String_Node_Str");
  typeCheck(CLOSURE_DEFS + LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(CLOSURE_DEFS + 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"),NewTypeInference.INEXISTENT_PROPERTY);
  typeCheck(CLOSURE_DEFS + LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(CLOSURE_DEFS + LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.MISTYPED_ASSIGN_RHS);
  typeCheck(CLOSURE_DEFS + "String_Node_Str",NewTypeInference.MISTYPED_ASSIGN_RHS);
  typeCheck(CLOSURE_DEFS + "String_Node_Str",NewTypeInference.INEXISTENT_PROPERTY);
  typeCheck(LINE_JOINER.join(CLOSURE_DEFS,"String_Node_Str"));
}
Program: 27213
Project: 27213
Buggy source:
public void testGoogIsPredicatesNoSpecializedContext(){
  typeCheck(CLOSURE_BASE + "String_Node_Str",NewTypeInference.WRONG_ARGUMENT_COUNT);
  typeCheck(CLOSURE_BASE + "String_Node_Str",NewTypeInference.WRONG_ARGUMENT_COUNT,NewTypeInference.INVALID_OPERAND_TYPE);
  typeCheck(CLOSURE_BASE + "String_Node_Str");
}

Fixed version (ground truth):
public void testGoogIsPredicatesNoSpecializedContext(){
  typeCheck(CLOSURE_BASE + "String_Node_Str",NewTypeInference.WRONG_ARGUMENT_COUNT);
  typeCheck(CLOSURE_BASE + "String_Node_Str",NewTypeInference.WRONG_ARGUMENT_COUNT,NewTypeInference.INVALID_OPERAND_TYPE);
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"String_Node_Str"));
}
Program: 27214
Project: 27214
Buggy source:
public void testSpecializeTypesAfterNullableDereference(){
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
}

Fixed version (ground truth):
public void testSpecializeTypesAfterNullableDereference(){
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),NewTypeInference.NULLABLE_DEREFERENCE);
}
Program: 27216
Project: 27216
Buggy source:
public void testInferThisInSimpleInferExprType(){
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(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"),NewTypeInference.INVALID_OPERAND_TYPE);
}

Fixed version (ground truth):
public void testInferThisInSimpleInferExprType(){
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(LINE_JOINER.join(CLOSURE_BASE,"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.INVALID_OPERAND_TYPE);
}
Program: 27218
Project: 27218
Buggy source:
public static QualifiedName fromNode(Node qnameNode){
  if (qnameNode == null || !qnameNode.isQualifiedName()) {
    return null;
  }
  return qnameNode.isName() ? new QualifiedName(qnameNode.getString()) : new QualifiedName(ImmutableList.copyOf(Splitter.on('.').split(qnameNode.getQualifiedName())));
}

Fixed version (ground truth):
public static QualifiedName fromNode(Node qnameNode){
  if (qnameNode == null || !qnameNode.isQualifiedName()) {
    return null;
  }
  if (qnameNode.isGetProp()) {
    String pname=qnameNode.getLastChild().getString();
    return join(fromNode(qnameNode.getFirstChild()),new QualifiedName(pname));
  }
  return new QualifiedName(qnameNode.getQualifiedName());
}
Program: 27219
Project: 27219
Buggy source:
public final Node cloneTree(boolean cloneTypeExprs){
  Node result=cloneNode(cloneTypeExprs);
  Node firstChild=null;
  Node lastChild=null;
  if (this.hasChildren()) {
    for (Node n2=getFirstChild(); n2 != null; n2=n2.next) {
      Node n2clone=n2.cloneTree(cloneTypeExprs);
      n2clone.parent=result;
      if (firstChild == null) {
        firstChild=n2clone;
        lastChild=firstChild;
      }
 else {
        lastChild.next=n2clone;
        n2clone.previous=lastChild;
        lastChild=n2clone;
      }
    }
    firstChild.previous=lastChild;
    lastChild.next=null;
    result.first=firstChild;
  }
  return result;
}

Fixed version (ground truth):
@CheckReturnValue public final Node cloneTree(boolean cloneTypeExprs){
  Node result=cloneNode(cloneTypeExprs);
  Node firstChild=null;
  Node lastChild=null;
  if (this.hasChildren()) {
    for (Node n2=getFirstChild(); n2 != null; n2=n2.next) {
      Node n2clone=n2.cloneTree(cloneTypeExprs);
      n2clone.parent=result;
      if (firstChild == null) {
        firstChild=n2clone;
        lastChild=firstChild;
      }
 else {
        lastChild.next=n2clone;
        n2clone.previous=lastChild;
        lastChild=n2clone;
      }
    }
    firstChild.previous=lastChild;
    lastChild.next=null;
    result.first=firstChild;
  }
  return result;
}
Program: 27220
Project: 27220
Buggy source:
/** 
 * @return A detached clone of the Node, specifically excluding its children.
 */
protected Node cloneNode(boolean cloneTypeExprs){
  return copyNodeFields(new Node(token),cloneTypeExprs);
}

Fixed version (ground truth):
/** 
 * @return A detached clone of the Node, specifically excluding its children.
 */
@CheckReturnValue protected Node cloneNode(boolean cloneTypeExprs){
  return copyNodeFields(new Node(token),cloneTypeExprs);
}