nus-yam/ex-repair huggingface dataset:
Program: 19187
Project: 19187
Buggy source:
private void replaceSymbol(NodeTraversal t,Node node,String name,CompilerInput input){
  Node parent=node.getParent();
  boolean isCrossModule=isCrossModuleName(name);
  if (!isCrossModule) {
    if (!NodeUtil.isNameDeclaration(parent)) {
      return;
    }
    boolean hasInterestingChildren=false;
    for (    Node c : parent.children()) {
      if (!c.isName() || isCrossModuleName(c.getString()) || isExternVar(c.getString(),t)) {
        hasInterestingChildren=true;
        break;
      }
    }
    if (!hasInterestingChildren) {
      return;
    }
  }
  Node replacement=isCrossModule ? IR.getprop(IR.name(globalSymbolNamespace).srcref(node),IR.string(name).srcref(node)) : IR.name(name).srcref(node);
  replacement.srcref(node);
  if (node.hasChildren()) {
    Node assign=IR.assign(replacement,node.removeFirstChild());
    parent.replaceChild(node,assign);
    compiler.reportChangeToEnclosingScope(assign);
  }
 else   if (isCrossModule) {
    parent.replaceChild(node,replacement);
    compiler.reportChangeToEnclosingScope(replacement);
    if (parent.isCall() && !maybeReferencesThis.contains(name)) {
      parent.putBooleanProp(Node.FREE_CALL,false);
    }
  }
  if (!isCrossModule && NodeUtil.isNameDeclaration(parent)) {
    preDeclarations.add(new ModuleGlobal(input.getAstRoot(compiler),IR.name(name).srcref(node)));
  }
  compiler.reportChangeToEnclosingScope(parent);
}

Fixed version (ground truth):
/** 
 * Replaces a global cross-module name with an access on the global namespace symbol 
 */
private void replaceSymbol(Node node,String name){
  Node parent=node.getParent();
  Node replacement=IR.getprop(IR.name(globalSymbolNamespace),IR.string(name));
  replacement.useSourceInfoFromForTree(node);
  parent.replaceChild(node,replacement);
  compiler.reportChangeToEnclosingScope(replacement);
  if (parent.isCall() && !maybeReferencesThis.contains(name)) {
    parent.putBooleanProp(Node.FREE_CALL,false);
  }
  compiler.reportChangeToEnclosingScope(parent);
}
Program: 19188
Project: 19188
Buggy source:
/** 
 * Rewrites extern names to be explicit children of window instead of only implicitly referencing it. This enables injecting window into a scope and make all global symbols depend on the injected object.
 */
private void visitExtern(Node nameNode,Node parent){
  String name=nameNode.getString();
  if (globalSymbolNamespace.equals(name) || SPECIAL_EXTERNS.contains(name)) {
    return;
  }
  Node windowPropAccess=IR.getprop(IR.name(WINDOW),IR.string(name));
  if (NodeUtil.isNameDeclaration(parent) && nameNode.hasOneChild()) {
    Node assign=IR.assign(windowPropAccess,nameNode.removeFirstChild());
    assign.setJSDocInfo(parent.getJSDocInfo());
    parent.replaceChild(nameNode,assign.srcrefTree(parent));
  }
 else {
    parent.replaceChild(nameNode,windowPropAccess.srcrefTree(nameNode));
  }
  compiler.reportChangeToEnclosingScope(parent);
}

Fixed version (ground truth):
/** 
 * Rewrites extern names to be explicit children of window instead of only implicitly referencing it. This enables injecting window into a scope and make all global symbols depend on the injected object.
 */
private void visitExtern(Node nameNode,Node parent){
  String name=nameNode.getString();
  if (globalSymbolNamespace.equals(name) || SPECIAL_EXTERNS.contains(name)) {
    return;
  }
  Node windowPropAccess=IR.getprop(IR.name(WINDOW),IR.string(name));
  parent.replaceChild(nameNode,windowPropAccess.srcrefTree(nameNode));
  compiler.reportChangeToEnclosingScope(parent);
}
Program: 19189
Project: 19189
Buggy source:
private void visitName(NodeTraversal t,Node n,Node parent){
  String name=n.getString();
  if (parent.isFunction() && name.isEmpty()) {
    return;
  }
  if (isExternVar(name,t)) {
    visitExtern(n,parent);
    return;
  }
  Var var=t.getScope().getVar(name);
  if (!var.isGlobal() && (name.equals(globalSymbolNamespace) || name.startsWith(globalSymbolNamespace + DISAMBIGUATION_SUFFIX))) {
    n.setString(name + DISAMBIGUATION_SUFFIX);
    compiler.reportChangeToEnclosingScope(n);
  }
  if (!var.isGlobal()) {
    return;
  }
  replaceSymbol(t,n,name,t.getInput());
}

Fixed version (ground truth):
private void visitName(NodeTraversal t,Node n,Node parent){
  String name=n.getString();
  if (parent.isFunction() && name.isEmpty()) {
    return;
  }
  if (isExternVar(name,t)) {
    visitExtern(n,parent);
    return;
  }
  Var var=t.getScope().getVar(name);
  if (!var.isGlobal() && (name.equals(globalSymbolNamespace) || name.startsWith(globalSymbolNamespace + DISAMBIGUATION_SUFFIX))) {
    n.setString(name + DISAMBIGUATION_SUFFIX);
    compiler.reportChangeToEnclosingScope(n);
  }
  if (!(var.isGlobal() && isCrossModuleName(name))) {
    return;
  }
  replaceSymbol(n,name);
}
Program: 19190
Project: 19190
Buggy source:
public void testObjectDestructuringDeclarations(){
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void testObjectDestructuringDeclarations(){
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
  test("String_Node_Str","String_Node_Str");
}
Program: 19191
Project: 19191
Buggy source:
public void testSameVarDeclaredInExternsAndSource(){
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
}

Fixed version (ground truth):
public void testSameVarDeclaredInExternsAndSource(){
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
  test(externs("String_Node_Str"),srcs("String_Node_Str"),expected("String_Node_Str"));
}
Program: 19192
Project: 19192
Buggy source:
public void testObjectDestructuringDeclarations_acrossModules(){
  assumeCrossModuleNames=false;
  test(createModules("String_Node_Str","String_Node_Str"),new String[]{"String_Node_Str","String_Node_Str"});
  test(createModules("String_Node_Str","String_Node_Str"),new String[]{"String_Node_Str","String_Node_Str"});
  test(createModules("String_Node_Str","String_Node_Str"),new String[]{"String_Node_Str","String_Node_Str"});
  test(createModules("String_Node_Str","String_Node_Str"),new String[]{"String_Node_Str","String_Node_Str"});
}

Fixed version (ground truth):
public void testObjectDestructuringDeclarations_acrossModules(){
  assumeCrossModuleNames=false;
  test(createModules("String_Node_Str","String_Node_Str"),new String[]{"String_Node_Str","String_Node_Str"});
  test(createModules("String_Node_Str","String_Node_Str"),new String[]{"String_Node_Str","String_Node_Str"});
  test(createModules("String_Node_Str","String_Node_Str"),new String[]{"String_Node_Str","String_Node_Str"});
  test(createModules("String_Node_Str","String_Node_Str"),new String[]{"String_Node_Str","String_Node_Str"});
  test(createModules("String_Node_Str","String_Node_Str"),new String[]{"String_Node_Str","String_Node_Str"});
  test(createModules("String_Node_Str","String_Node_Str"),new String[]{"String_Node_Str","String_Node_Str"});
}
Program: 19193
Project: 19193
Buggy source:
public void testObjectDestructuringDeclarations_allSameModule(){
  assumeCrossModuleNames=false;
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
}

Fixed version (ground truth):
public void testObjectDestructuringDeclarations_allSameModule(){
  assumeCrossModuleNames=false;
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
  testSame("String_Node_Str");
}
Program: 19194
Project: 19194
Buggy source:
public AbstractScope<?,?> getClosestHoistScope(){
  for (int i=scopeRoots.size(); i > 0; i--) {
    if (isHoistScopeRootNode(scopeRoots.get(i - 1))) {
      return instantiateScopes(i);
    }
  }
  return (AbstractScope<?,?>)scopes.peek().getClosestHoistScope();
}

Fixed version (ground truth):
public AbstractScope<?,?> getClosestHoistScope(){
  for (int i=scopeRoots.size(); i > 0; i--) {
    if (isHoistScopeRootNode(scopeRoots.get(i - 1))) {
      return instantiateScopes(i);
    }
  }
  return scopes.peek().getClosestHoistScope();
}
Program: 19195
Project: 19195
Buggy source:
/** 
 * Keep applying fixes to the given file until no more fixes can be found, or until fixes have been applied   {@code MAX_FIXES} times.
 */
static void fixRepeatedly(String filename) throws IOException {
  for (int i=0; i < MAX_FIXES; i++) {
    if (!fix(filename)) {
      break;
    }
  }
}

Fixed version (ground truth):
/** 
 * Keep applying fixes to the given file until no more fixes can be found, or until fixes have been applied   {@code MAX_FIXES} times.
 */
static void fixRepeatedly(String filename,ImmutableSet<DiagnosticType> unfixableErrors) throws IOException {
  for (int i=0; i < MAX_FIXES; i++) {
    if (!fix(filename,unfixableErrors)) {
      break;
    }
  }
}
Program: 19196
Project: 19196
Buggy source:
/** 
 * @return Whether any fixes were applied. 
 */
private static boolean fix(String filename) throws IOException {
  Compiler compiler=new Compiler(System.out);
  FixingErrorManager errorManager=new FixingErrorManager();
  compiler.setErrorManager(errorManager);
  errorManager.setCompiler(compiler);
  lint(Paths.get(filename),compiler);
  Collection<SuggestedFix> fixes=errorManager.getAllFixes();
  if (!fixes.isEmpty()) {
    ApplySuggestedFixes.applySuggestedFixesToFiles(fixes);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @return Whether any fixes were applied. 
 */
private static boolean fix(String filename,ImmutableSet<DiagnosticType> unfixableErrors) throws IOException {
  Compiler compiler=new Compiler(System.out);
  FixingErrorManager errorManager=new FixingErrorManager(unfixableErrors);
  compiler.setErrorManager(errorManager);
  errorManager.setCompiler(compiler);
  lint(Paths.get(filename),compiler);
  Collection<SuggestedFix> fixes=errorManager.getAllFixes();
  if (!fixes.isEmpty()) {
    ApplySuggestedFixes.applySuggestedFixesToFiles(fixes);
    return true;
  }
  return false;
}
Program: 19197
Project: 19197
Buggy source:
public FixingErrorManager(){
}

Fixed version (ground truth):
public FixingErrorManager(ImmutableSet<DiagnosticType> unfixableErrors){
  this.unfixableErrors=unfixableErrors;
}
Program: 19198
Project: 19198
Buggy source:
@Override public void report(CheckLevel level,JSError error){
  super.report(level,error);
  fixes.putAll(error,ErrorToFixMapper.getFixesForJsError(error,compiler));
}

Fixed version (ground truth):
@Override public void report(CheckLevel level,JSError error){
  super.report(level,error);
  if (!unfixableErrors.contains(error.getType())) {
    fixes.putAll(error,ErrorToFixMapper.getFixesForJsError(error,compiler));
  }
}
Program: 19200
Project: 19200
Buggy source:
/** 
 * Whether this type is meaningfully different from   {@code that} type forthe purposes of data flow analysis. This is a trickier check than pure equality, because it has to properly handle unknown types. See  {@code EquivalenceMethod} for more info.
 * @see <a href="http://www.youtube.com/watch?v=_RpSv3HjpEw">Unknown unknowns</a>
 */
public final boolean differsFrom(JSType that){
  return !checkEquivalenceHelper(that,EquivalenceMethod.DATA_FLOW);
}

Fixed version (ground truth):
/** 
 * Whether this type is meaningfully different from   {@code that} type forthe purposes of data flow analysis. This is a trickier check than pure equality, because it has to properly handle unknown types. See  {@code EquivalenceMethod} for more info.
 * @see <a href="http://www.youtube.com/watch?v=_RpSv3HjpEw">Unknown unknowns</a>
 */
public final boolean differsFrom(JSType that){
  return !checkEquivalenceHelper(that,EquivalenceMethod.DATA_FLOW,EqCache.create());
}
Program: 19201
Project: 19201
Buggy source:
/** 
 * Detects cycles in either the implicit prototype chain, or the implemented/extended interfaces.<p>
 * @return True iff a cycle was detected.
 */
final boolean detectInheritanceCycle(){
  return detectImplicitPrototypeCycle() || Iterables.contains(this.getCtorImplementedInterfaces(),this) || Iterables.contains(this.getCtorExtendedInterfaces(),this);
}

Fixed version (ground truth):
/** 
 * Detects cycles in either the implicit prototype chain, or the implemented/extended interfaces.<p>
 * @return True iff a cycle was detected.
 */
final boolean detectInheritanceCycle(){
  if (detectImplicitPrototypeCycle() || Iterables.contains(this.getCtorImplementedInterfaces(),this)) {
    return true;
  }
  FunctionType fnType=this.getConstructor();
  return fnType != null && fnType.checkExtendsLoop() != null;
}
Program: 19202
Project: 19202
Buggy source:
public static void assertTypeEquals(String message,JSType a,JSType b){
  checkNotNull(a);
  checkNotNull(b);
  Assert.assertTrue(message + (message.isEmpty() ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ a+ "String_Node_Str"+ "String_Node_Str"+ b,a.isEquivalentTo(b));
  Assert.assertTrue(message + "String_Node_Str" + "String_Node_Str"+ b+ "String_Node_Str"+ "String_Node_Str"+ a,b.isEquivalentTo(a));
}

Fixed version (ground truth):
public static void assertTypeEquals(String message,JSType a,JSType b){
  checkNotNull(a);
  checkNotNull(b);
  Assert.assertTrue(message + (message.isEmpty() ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ a+ "String_Node_Str"+ "String_Node_Str"+ b,a.isEquivalentTo(b,true));
  Assert.assertTrue(message + "String_Node_Str" + "String_Node_Str"+ b+ "String_Node_Str"+ "String_Node_Str"+ a,b.isEquivalentTo(a,true));
}
Program: 19205
Project: 19205
Buggy source:
static boolean isPrototypeAssignment(Node getProp){
  if (!getProp.isGetProp()) {
    return false;
  }
  Node parent=getProp.getParent();
  return parent.isAssign() && parent.getFirstChild() == getProp && parent.getFirstChild().getLastChild().getString().equals("String_Node_Str");
}

Fixed version (ground truth):
static boolean isPrototypeAssignment(Node getProp){
  if (!getProp.isGetProp()) {
    return false;
  }
  Node parent=getProp.getParent();
  return parent.isAssign() && parent.getFirstChild() == getProp && getProp.getLastChild().getString().equals("String_Node_Str");
}
Program: 19207
Project: 19207
Buggy source:
public void testConstructorType9(){
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
public void testConstructorType9(){
  testTypes("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","String_Node_Str");
}
Program: 19208
Project: 19208
Buggy source:
public void testDirectPrototypeAssign(){
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
}

Fixed version (ground truth):
public void testDirectPrototypeAssign(){
  testTypes(lines("String_Node_Str","String_Node_Str","String_Node_Str"),"String_Node_Str" + "String_Node_Str");
}
Program: 19210
Project: 19210
Buggy source:
public void testDestructuringEvaluationOrder(){
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  inline("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void testDestructuringEvaluationOrder(){
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  inline("String_Node_Str","String_Node_Str");
}
Program: 19211
Project: 19211
Buggy source:
public void testDestructuringDefaultValue(){
  inline("String_Node_Str","String_Node_Str");
  inline("String_Node_Str","String_Node_Str");
  inline("String_Node_Str","String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  inline("String_Node_Str","String_Node_Str");
  inline("String_Node_Str","String_Node_Str");
  inline("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void testDestructuringDefaultValue(){
  inline("String_Node_Str","String_Node_Str");
  inline("String_Node_Str","String_Node_Str");
  inline("String_Node_Str","String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  inline("String_Node_Str","String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
}
Program: 19212
Project: 19212
Buggy source:
public void testGithubIssue2818(){
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  inline("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void testGithubIssue2818(){
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
}
Program: 19213
Project: 19213
Buggy source:
public void testDestructuringComputedProperty(){
  inline("String_Node_Str","String_Node_Str");
  noInline("String_Node_Str");
}

Fixed version (ground truth):
public void testDestructuringComputedProperty(){
  inline("String_Node_Str","String_Node_Str");
  noInline("String_Node_Str");
  noInline("String_Node_Str");
  inline("String_Node_Str","String_Node_Str");
}
Program: 19214
Project: 19214
Buggy source:
/** 
 * @return The statement containing the expression or null if the subExpressionis not contain in a Node where inlining is known to be possible. For example, a WHILE node condition expression.
 */
@Nullable static Node findExpressionRoot(Node subExpression){
  Node child=subExpression;
  for (  Node parent : child.getAncestors()) {
    Token parentType=parent.getToken();
switch (parentType) {
case EXPR_RESULT:
case IF:
case SWITCH:
case RETURN:
case THROW:
      Preconditions.checkState(child == parent.getFirstChild());
    return parent;
case VAR:
case CONST:
case LET:
  Preconditions.checkState(child == parent.getFirstChild());
if (parent.getParent().isVanillaFor() && parent == parent.getParent().getFirstChild()) {
  return null;
}
 else {
  return parent;
}
case FOR:
if (child == parent.getFirstChild()) {
return parent;
}
case FOR_IN:
case FOR_OF:
case SCRIPT:
case BLOCK:
case LABEL:
case CASE:
case DEFAULT_CASE:
return null;
default :
break;
}
child=parent;
}
throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @return The statement containing the expression or null if the subExpressionis not contain in a Node where inlining is known to be possible. For example, a WHILE node condition expression.
 */
@Nullable static Node findExpressionRoot(Node subExpression){
  Node child=subExpression;
  for (  Node parent : child.getAncestors()) {
    Token parentType=parent.getToken();
switch (parentType) {
case EXPR_RESULT:
case IF:
case SWITCH:
case RETURN:
case THROW:
      Preconditions.checkState(child == parent.getFirstChild());
    return parent;
case VAR:
case CONST:
case LET:
  Preconditions.checkState(child == parent.getFirstChild());
if (parent.getParent().isVanillaFor() && parent == parent.getParent().getFirstChild()) {
  return parent.getParent();
}
 else {
  return parent;
}
case FOR:
if (child == parent.getFirstChild()) {
return parent;
}
case FOR_IN:
case FOR_OF:
case SCRIPT:
case BLOCK:
case LABEL:
case CASE:
case DEFAULT_CASE:
return null;
default :
break;
}
child=parent;
}
throw new IllegalStateException("String_Node_Str");
}
Program: 19216
Project: 19216
Buggy source:
public void testFindExpressionRoot5(){
  assertThat(findExpressionRoot("String_Node_Str","String_Node_Str")).isNull();
}

Fixed version (ground truth):
public void testFindExpressionRoot5(){
  assertNode(findExpressionRoot("String_Node_Str","String_Node_Str")).hasType(Token.FOR);
}
Program: 19217
Project: 19217
Buggy source:
/** 
 * @return The result of calling {@link ExpressionDecomposer#findExpressionRoot} on the CALLnode in  {@code js} whose callee is a NAME matching {@code name}.
 */
@Nullable private Node findExpressionRoot(String js,String name){
  Compiler compiler=getCompiler();
  Node tree=parse(compiler,js);
  Node call=findCall(tree,name);
  checkNotNull(call);
  return ExpressionDecomposer.findExpressionRoot(call);
}

Fixed version (ground truth):
/** 
 * @return The result of calling {@link ExpressionDecomposer#findExpressionRoot} on the CALLnode in  {@code js} whose callee is a NAME matching {@code name}.
 */
@Nullable private Node findExpressionRoot(String js,String name){
  Compiler compiler=getCompiler();
  Node tree=parse(compiler,js);
  Node call=findCall(tree,name);
  checkNotNull(call);
  Node root=ExpressionDecomposer.findExpressionRoot(call);
  if (root != null) {
    checkState(NodeUtil.isStatement(root),root);
  }
  return root;
}
Program: 19218
Project: 19218
Buggy source:
public void testShadowVariables19(){
  test(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testShadowVariables19(){
  test(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),lines("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"));
}
Program: 19221
Project: 19221
Buggy source:
/** 
 * Resolve any stub declarations to unknown types if we could not find types for them during traversal.
 */
void resolveStubDeclarations(){
  for (  StubDeclaration stub : stubDeclarations) {
    Node n=stub.node;
    Node parent=n.getParent();
    String qName=n.getQualifiedName();
    String propName=n.getLastChild().getString();
    String ownerName=stub.ownerName;
    boolean isExtern=stub.isExtern;
    if (scope.isDeclared(qName,false)) {
      continue;
    }
    ObjectType ownerType=getObjectSlot(ownerName);
    defineSlot(n,parent,unknownType,true);
    if (ownerType != null && (isExtern || ownerType.isFunctionPrototypeType())) {
      ownerType.defineInferredProperty(propName,unknownType,n);
    }
 else {
      typeRegistry.registerPropertyOnType(propName,ownerType == null ? unknownType : ownerType);
    }
  }
}

Fixed version (ground truth):
/** 
 * Resolve any stub declarations to unknown types if we could not find types for them during traversal.
 */
void resolveStubDeclarations(){
  for (  StubDeclaration stub : stubDeclarations) {
    Node n=stub.node;
    Node parent=n.getParent();
    String qName=n.getQualifiedName();
    String propName=n.getLastChild().getString();
    String ownerName=stub.ownerName;
    boolean isExtern=stub.isExtern;
    if (scope.isDeclared(qName,false)) {
      continue;
    }
    ObjectType ownerType=getObjectSlot(ownerName);
    JSType inheritedType=getInheritedInterfacePropertyType(ownerType,propName);
    JSType stubType=inheritedType == null ? unknownType : inheritedType;
    defineSlot(n,parent,stubType,true);
    if (ownerType != null && (isExtern || ownerType.isFunctionPrototypeType())) {
      ownerType.defineInferredProperty(propName,stubType,n);
    }
 else {
      typeRegistry.registerPropertyOnType(propName,ownerType == null ? stubType : ownerType);
    }
  }
}
Program: 19222
Project: 19222
Buggy source:
private ObjectType getThisTypeForCollectingProperties(){
  Node rootNode=scope.getRootNode();
  if (rootNode.isFromExterns())   return null;
  JSType type=rootNode.getJSType();
  if (type == null || !type.isFunctionType())   return null;
  FunctionType fnType=type.toMaybeFunctionType();
  JSType fnThisType=fnType.getTypeOfThis();
  return fnThisType.isUnknownType() ? null : fnThisType.toObjectType();
}

Fixed version (ground truth):
private ObjectType getThisTypeForCollectingProperties(){
  Node rootNode=scope.getRootNode();
  if (rootNode.isFromExterns()) {
    return null;
  }
  JSType type=rootNode.getJSType();
  if (type == null || !type.isFunctionType()) {
    return null;
  }
  FunctionType fnType=type.toMaybeFunctionType();
  JSType fnThisType=fnType.getTypeOfThis();
  return fnThisType.isUnknownType() ? null : fnThisType.toObjectType();
}
Program: 19223
Project: 19223
Buggy source:
private ParseTree parseMultiplicativeExpression(){
  SourcePosition start=getTreeStartLocation();
  ParseTree left=parseExponentiationExpression();
  while (peekMultiplicativeOperator()) {
    Token operator=nextToken();
    ParseTree right=parseUnaryExpression();
    left=new BinaryOperatorTree(getTreeLocation(start),left,operator,right);
  }
  return left;
}

Fixed version (ground truth):
private ParseTree parseMultiplicativeExpression(){
  SourcePosition start=getTreeStartLocation();
  ParseTree left=parseExponentiationExpression();
  while (peekMultiplicativeOperator()) {
    Token operator=nextToken();
    ParseTree right=parseExponentiationExpression();
    left=new BinaryOperatorTree(getTreeLocation(start),left,operator,right);
  }
  return left;
}
Program: 19224
Project: 19224
Buggy source:
public void testExponentiationOperator(){
  languageMode=LanguageMode.ECMASCRIPT_2016;
  assertPrintSame("String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
  assertPrintSame("String_Node_Str");
  assertPrintSame("String_Node_Str");
  assertPrintSame("String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void testExponentiationOperator(){
  languageMode=LanguageMode.ECMASCRIPT_2016;
  assertPrintSame("String_Node_Str");
  assertPrint("String_Node_Str","String_Node_Str");
  assertPrintSame("String_Node_Str");
  assertPrintSame("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");
}
Program: 19225
Project: 19225
Buggy source:
public void testExponentOperator(){
  mode=LanguageMode.ECMASCRIPT7;
  strictMode=STRICT;
  parseError("String_Node_Str","String_Node_Str");
  expectFeatures(Feature.EXPONENT_OP);
  parse("String_Node_Str");
  parse("String_Node_Str");
  parse("String_Node_Str");
  parse("String_Node_Str");
  mode=LanguageMode.ECMASCRIPT6;
  strictMode=SLOPPY;
  parseWarning("String_Node_Str",requiresLanguageModeMessage(LanguageMode.ECMASCRIPT7,Feature.EXPONENT_OP));
}

Fixed version (ground truth):
public void testExponentOperator(){
  mode=LanguageMode.ECMASCRIPT7;
  strictMode=STRICT;
  parseError("String_Node_Str","String_Node_Str");
  expectFeatures(Feature.EXPONENT_OP);
  parse("String_Node_Str");
  parse("String_Node_Str");
  parse("String_Node_Str");
  parse("String_Node_Str");
  parse("String_Node_Str");
  mode=LanguageMode.ECMASCRIPT6;
  strictMode=SLOPPY;
  parseWarning("String_Node_Str",requiresLanguageModeMessage(LanguageMode.ECMASCRIPT7,Feature.EXPONENT_OP));
}
Program: 19227
Project: 19227
Buggy source:
public void testSetters(){
  typeCheck("String_Node_Str",GlobalTypeInfoCollector.SETTER_WITH_RETURN);
  typeCheck("String_Node_Str",GlobalTypeInfoCollector.SETTER_WITH_RETURN);
  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"),JSTypeCreatorFromJSDoc.TEMPLATED_GETTER_SETTER);
  typeCheck("String_Node_Str",NewTypeInference.RETURN_NONDECLARED_TYPE);
  typeCheck("String_Node_Str",JSTypeCreatorFromJSDoc.FUNCTION_WITH_NONFUNC_JSDOC);
  typeCheck("String_Node_Str",NewTypeInference.ILLEGAL_OBJLIT_KEY);
  typeCheck("String_Node_Str",NewTypeInference.ILLEGAL_OBJLIT_KEY);
  typeCheck("String_Node_Str",NewTypeInference.INVALID_OPERAND_TYPE);
  typeCheck("String_Node_Str",NewTypeInference.INEXISTENT_PROPERTY);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str"),NewTypeInference.MISTYPED_ASSIGN_RHS);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str"),NewTypeInference.MISTYPED_ASSIGN_RHS);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str"),NewTypeInference.MISTYPED_ASSIGN_RHS);
}

Fixed version (ground truth):
public void testSetters(){
  typeCheck("String_Node_Str",GlobalTypeInfoCollector.SETTER_WITH_RETURN);
  typeCheck("String_Node_Str",GlobalTypeInfoCollector.SETTER_WITH_RETURN);
  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"),JSTypeCreatorFromJSDoc.TEMPLATED_GETTER_SETTER);
  typeCheck("String_Node_Str",NewTypeInference.RETURN_NONDECLARED_TYPE);
  typeCheck("String_Node_Str",JSTypeCreatorFromJSDoc.FUNCTION_WITH_NONFUNC_JSDOC);
  typeCheck("String_Node_Str",NewTypeInference.ILLEGAL_OBJLIT_KEY);
  typeCheck("String_Node_Str",NewTypeInference.ILLEGAL_OBJLIT_KEY);
  typeCheck("String_Node_Str",NewTypeInference.INVALID_OPERAND_TYPE);
  typeCheck("String_Node_Str",NewTypeInference.INEXISTENT_PROPERTY);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str"),NewTypeInference.MISTYPED_ASSIGN_RHS);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str"),NewTypeInference.MISTYPED_ASSIGN_RHS);
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str"),NewTypeInference.MISTYPED_ASSIGN_RHS);
  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","String_Node_Str","String_Node_Str"),JSTypeCreatorFromJSDoc.FUNCTION_WITH_NONFUNC_JSDOC);
}
Program: 19229
Project: 19229
Buggy source:
public void testReferenceInDestructuringPatternComputedProperty(){
  inFunction(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testReferenceInDestructuringPatternComputedProperty(){
  inFunction("String_Node_Str");
  inFunction(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 19230
Project: 19230
Buggy source:
public void testDestructuring(){
  inFunction("String_Node_Str");
  inFunction("String_Node_Str");
}

Fixed version (ground truth):
public void testDestructuring(){
  inFunction("String_Node_Str");
  inFunction("String_Node_Str");
  inFunction("String_Node_Str","String_Node_Str");
  inFunction("String_Node_Str");
}
Program: 19231
Project: 19231
Buggy source:
public void testReferenceInDestructuringPatternDefaultValue(){
  inFunction(lines("String_Node_Str","String_Node_Str","String_Node_Str"));
  inFunction(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  inFunction(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"),lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testReferenceInDestructuringPatternDefaultValue(){
  inFunction(lines("String_Node_Str","String_Node_Str","String_Node_Str"));
  inFunction(lines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  inFunction("String_Node_Str");
  inFunction("String_Node_Str");
}
Program: 19232
Project: 19232
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: 19233
Project: 19233
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: 19234
Project: 19234
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: 19235
Project: 19235
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: 19236
Project: 19236
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: 19237
Project: 19237
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: 19239
Project: 19239
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: 19240
Project: 19240
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: 19241
Project: 19241
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: 19242
Project: 19242
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: 19243
Project: 19243
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: 19244
Project: 19244
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: 19246
Project: 19246
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: 19247
Project: 19247
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: 19248
Project: 19248
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));
  }
}