nus-yam/ex-repair huggingface dataset:
Program: 28058
Project: 28058
Buggy source:
/** 
 * TypeExpression := BasicTypeExpression | '?' BasicTypeExpression | '!' BasicTypeExpression | BasicTypeExpression '?' | BasicTypeExpression '!' | '?'
 */
private Node parseTypeExpression(JsDocToken token){
  if (token == JsDocToken.QMARK) {
    token=next();
    if (token == JsDocToken.COMMA || token == JsDocToken.EQUALS || token == JsDocToken.RC || token == JsDocToken.RP || token == JsDocToken.PIPE) {
      restoreLookAhead(token);
      return newNode(Token.QMARK);
    }
    return wrapNode(Token.QMARK,parseBasicTypeExpression(token));
  }
 else   if (token == JsDocToken.BANG) {
    return wrapNode(Token.BANG,parseBasicTypeExpression(next()));
  }
 else {
    Node basicTypeExpr=parseBasicTypeExpression(token);
    if (basicTypeExpr != null) {
      if (match(JsDocToken.QMARK)) {
        next();
        return wrapNode(Token.QMARK,basicTypeExpr);
      }
 else       if (match(JsDocToken.BANG)) {
        next();
        return wrapNode(Token.BANG,basicTypeExpr);
      }
    }
    return basicTypeExpr;
  }
}

Fixed version (ground truth):
/** 
 * TypeExpression := BasicTypeExpression | '?' BasicTypeExpression | '!' BasicTypeExpression | BasicTypeExpression '?' | BasicTypeExpression '!' | '?'
 */
private Node parseTypeExpression(JsDocToken token){
  if (token == JsDocToken.QMARK) {
    token=next();
    if (token == JsDocToken.COMMA || token == JsDocToken.EQUALS || token == JsDocToken.RB || token == JsDocToken.RC || token == JsDocToken.RP || token == JsDocToken.PIPE) {
      restoreLookAhead(token);
      return newNode(Token.QMARK);
    }
    return wrapNode(Token.QMARK,parseBasicTypeExpression(token));
  }
 else   if (token == JsDocToken.BANG) {
    return wrapNode(Token.BANG,parseBasicTypeExpression(next()));
  }
 else {
    Node basicTypeExpr=parseBasicTypeExpression(token);
    if (basicTypeExpr != null) {
      if (match(JsDocToken.QMARK)) {
        next();
        return wrapNode(Token.QMARK,basicTypeExpr);
      }
 else       if (match(JsDocToken.BANG)) {
        next();
        return wrapNode(Token.BANG,basicTypeExpr);
      }
    }
    return basicTypeExpr;
  }
}
Program: 28059
Project: 28059
Buggy source:
private void tryConvertToNumber(Node n){
switch (n.getType()) {
case Token.NUMBER:
    return;
case Token.AND:
case Token.OR:
case Token.COMMA:
  tryConvertToNumber(n.getLastChild());
return;
case Token.HOOK:
tryConvertToNumber(n.getChildAtIndex(1));
tryConvertToNumber(n.getLastChild());
return;
case Token.NAME:
if (!NodeUtil.isUndefined(n)) {
return;
}
break;
}
Double result=NodeUtil.getNumberValue(n);
if (result == null) {
return;
}
double value=result;
Node replacement=NodeUtil.numberNode(value,n);
n.getParent().replaceChild(n,replacement);
reportCodeChange();
}

Fixed version (ground truth):
private void tryConvertToNumber(Node n){
switch (n.getType()) {
case Token.NUMBER:
    return;
case Token.AND:
case Token.OR:
case Token.COMMA:
  tryConvertToNumber(n.getLastChild());
return;
case Token.HOOK:
tryConvertToNumber(n.getChildAtIndex(1));
tryConvertToNumber(n.getLastChild());
return;
case Token.NAME:
if (!NodeUtil.isUndefined(n)) {
return;
}
break;
}
Double result=NodeUtil.getNumberValue(n);
if (result == null) {
return;
}
double value=result;
Node replacement=NodeUtil.numberNode(value,n);
if (replacement.isEquivalentTo(n)) {
return;
}
n.getParent().replaceChild(n,replacement);
reportCodeChange();
}
Program: 28061
Project: 28061
Buggy source:
/** 
 * Activates Common JS module processing.
 */
public void setProcessCommonJSModules(boolean processCommonJSModules){
  this.processCommonJSModules=processCommonJSModules;
}

Fixed version (ground truth):
/** 
 * Rewrites CommonJS modulee so that modules can be concatenated together, by renaming all globals to avoid conflicting with other modules.
 */
public void setProcessCommonJSModules(boolean processCommonJSModules){
  this.processCommonJSModules=processCommonJSModules;
}
Program: 28062
Project: 28062
Buggy source:
/** 
 * Get the return value of calling "bind" on this function with the specified number of arguments. If -1 is passed, then we will return a result that accepts any parameters.
 */
public FunctionType getBindReturnType(int argsToBind){
  FunctionBuilder builder=new FunctionBuilder(registry).withReturnType(getReturnType());
  if (argsToBind >= 0) {
    Node origParams=getParametersNode();
    if (origParams != null) {
      Node params=origParams.cloneTree();
      for (int i=1; i < argsToBind && params.getFirstChild() != null; i++) {
        params.removeFirstChild();
      }
      builder.withParamsNode(params);
    }
  }
  return builder.build();
}

Fixed version (ground truth):
/** 
 * Get the return value of calling "bind" on this function with the specified number of arguments. If -1 is passed, then we will return a result that accepts any parameters.
 */
public FunctionType getBindReturnType(int argsToBind){
  FunctionBuilder builder=new FunctionBuilder(registry).withReturnType(getReturnType());
  if (argsToBind >= 0) {
    Node origParams=getParametersNode();
    if (origParams != null) {
      Node params=origParams.cloneTree();
      for (int i=1; i < argsToBind && params.getFirstChild() != null; i++) {
        if (params.getFirstChild().isVarArgs()) {
          break;
        }
        params.removeFirstChild();
      }
      builder.withParamsNode(params);
    }
  }
  return builder.build();
}
Program: 28063
Project: 28063
Buggy source:
void add(String newcode){
  maybeEndStatement();
  if (newcode.length() == 0) {
    return;
  }
  char c=newcode.charAt(0);
  if ((isWordChar(c) || c == '\\') && isWordChar(getLastChar())) {
    append("String_Node_Str");
  }
  append(newcode);
}

Fixed version (ground truth):
void add(String newcode){
  maybeEndStatement();
  if (newcode.length() == 0) {
    return;
  }
  char c=newcode.charAt(0);
  if ((isWordChar(c) || c == '\\') && isWordChar(getLastChar())) {
    append("String_Node_Str");
  }
 else   if (c == '/' && getLastChar() == '/') {
    append("String_Node_Str");
  }
  append(newcode);
}
Program: 28065
Project: 28065
Buggy source:
public void testRecordSubtypeChain() throws Exception {
  RecordTypeBuilder builder=new RecordTypeBuilder(registry);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  JSType aType=builder.build();
  builder=new RecordTypeBuilder(registry);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  JSType abType=builder.build();
  builder=new RecordTypeBuilder(registry);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  builder.addProperty("String_Node_Str",NUMBER_TYPE,null);
  JSType abcType=builder.build();
  List<JSType> typeChain=Lists.newArrayList(registry.getNativeType(JSTypeNative.ALL_TYPE),registry.getNativeType(JSTypeNative.OBJECT_PROTOTYPE),registry.getNativeType(JSTypeNative.OBJECT_TYPE),aType,abType,abcType,registry.getNativeType(JSTypeNative.NO_OBJECT_TYPE),registry.getNativeType(JSTypeNative.NO_TYPE));
  verifySubtypeChain(typeChain);
}

Fixed version (ground truth):
public void testRecordSubtypeChain() throws Exception {
  RecordTypeBuilder builder=new RecordTypeBuilder(registry);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  JSType aType=builder.build();
  builder=new RecordTypeBuilder(registry);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  JSType abType=builder.build();
  builder=new RecordTypeBuilder(registry);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  JSType acType=builder.build();
  JSType abOrAcType=registry.createUnionType(abType,acType);
  builder=new RecordTypeBuilder(registry);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  builder.addProperty("String_Node_Str",NUMBER_TYPE,null);
  JSType abcType=builder.build();
  List<JSType> typeChain=Lists.newArrayList(registry.getNativeType(JSTypeNative.ALL_TYPE),registry.getNativeType(JSTypeNative.OBJECT_PROTOTYPE),registry.getNativeType(JSTypeNative.OBJECT_TYPE),aType,abOrAcType,abType,abcType,registry.getNativeType(JSTypeNative.NO_OBJECT_TYPE),registry.getNativeType(JSTypeNative.NO_TYPE));
  verifySubtypeChain(typeChain);
}
Program: 28066
Project: 28066
Buggy source:
public void testRecordTypeLeastSuperType3(){
  RecordTypeBuilder builder=new RecordTypeBuilder(registry);
  builder.addProperty("String_Node_Str",NUMBER_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  JSType subRecordType=builder.build();
  JSType leastSupertype=recordType.getLeastSupertype(subRecordType);
  assertTypeEquals(leastSupertype,OBJECT_TYPE);
}

Fixed version (ground truth):
public void testRecordTypeLeastSuperType3(){
  RecordTypeBuilder builder=new RecordTypeBuilder(registry);
  builder.addProperty("String_Node_Str",NUMBER_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  JSType otherRecordType=builder.build();
  assertTypeEquals(registry.createUnionType(recordType,otherRecordType),recordType.getLeastSupertype(otherRecordType));
}
Program: 28067
Project: 28067
Buggy source:
public void testRecordTypeLeastSuperType2(){
  RecordTypeBuilder builder=new RecordTypeBuilder(registry);
  builder.addProperty("String_Node_Str",NUMBER_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  JSType subRecordType=builder.build();
  JSType leastSupertype=recordType.getLeastSupertype(subRecordType);
  builder=new RecordTypeBuilder(registry);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  assertTypeEquals(leastSupertype,builder.build());
}

Fixed version (ground truth):
public void testRecordTypeLeastSuperType2(){
  RecordTypeBuilder builder=new RecordTypeBuilder(registry);
  builder.addProperty("String_Node_Str",NUMBER_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  builder.addProperty("String_Node_Str",STRING_TYPE,null);
  JSType otherRecordType=builder.build();
  assertTypeEquals(registry.createUnionType(recordType,otherRecordType),recordType.getLeastSupertype(otherRecordType));
}
Program: 28068
Project: 28068
Buggy source:
/** 
 * Check if the given node is a property of a name in the global scope.
 */
private boolean isQnameRootedInGlobalScope(Node n){
  Node root=NodeUtil.getRootOfQualifiedName(n);
  if (root.isName()) {
    Var var=scope.getVar(root.getString());
    if (var != null) {
      return var.isGlobal();
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Check if the given node is a property of a name in the global scope.
 */
private boolean isQnameRootedInGlobalScope(Node n){
  Scope scope=getQnameRootScope(n);
  return scope != null && scope.isGlobal();
}
Program: 28070
Project: 28070
Buggy source:
public void testBadTemplateType2() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",TypeInference.TEMPLATE_TYPE_NOT_OBJECT_TYPE.format(),true);
}

Fixed version (ground truth):
public void testBadTemplateType2() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",TypeInference.TEMPLATE_TYPE_NOT_OBJECT_TYPE.format("String_Node_Str"));
}
Program: 28071
Project: 28071
Buggy source:
public void testBadTemplateType1() throws Exception {
  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",FunctionTypeBuilder.TEMPLATE_TYPE_DUPLICATED.format(),true);
}

Fixed version (ground truth):
public void testBadTemplateType1() throws Exception {
  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",FunctionTypeBuilder.TEMPLATE_TYPE_DUPLICATED.format());
}
Program: 28072
Project: 28072
Buggy source:
public void testBadTemplateType5() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",FunctionTypeBuilder.TEMPLATE_TYPE_EXPECTED.format(),true);
}

Fixed version (ground truth):
public void testBadTemplateType5() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",FunctionTypeBuilder.TEMPLATE_TYPE_EXPECTED.format());
}
Program: 28073
Project: 28073
Buggy source:
public void testBadTemplateType4() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",FunctionTypeBuilder.TEMPLATE_TYPE_EXPECTED.format(),true);
}

Fixed version (ground truth):
public void testBadTemplateType4() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",FunctionTypeBuilder.TEMPLATE_TYPE_EXPECTED.format());
}
Program: 28074
Project: 28074
Buggy source:
public void testBadTemplateType3() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",TypeInference.TEMPLATE_TYPE_OF_THIS_EXPECTED.format(),true);
}

Fixed version (ground truth):
public void testBadTemplateType3() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",TypeInference.TEMPLATE_TYPE_OF_THIS_EXPECTED.format());
}
Program: 28075
Project: 28075
Buggy source:
public void testBadTemplateType2() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",TypeInference.TEMPLATE_TYPE_NOT_OBJECT_TYPE.format(),true);
}

Fixed version (ground truth):
public void testBadTemplateType2() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",TypeInference.TEMPLATE_TYPE_NOT_OBJECT_TYPE.format("String_Node_Str"));
}
Program: 28076
Project: 28076
Buggy source:
public void testBadTemplateType1() throws Exception {
  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",FunctionTypeBuilder.TEMPLATE_TYPE_DUPLICATED.format(),true);
}

Fixed version (ground truth):
public void testBadTemplateType1() throws Exception {
  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",FunctionTypeBuilder.TEMPLATE_TYPE_DUPLICATED.format());
}
Program: 28077
Project: 28077
Buggy source:
public void testBadTemplateType5() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",FunctionTypeBuilder.TEMPLATE_TYPE_EXPECTED.format(),true);
}

Fixed version (ground truth):
public void testBadTemplateType5() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",FunctionTypeBuilder.TEMPLATE_TYPE_EXPECTED.format());
}
Program: 28078
Project: 28078
Buggy source:
public void testBadTemplateType4() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",FunctionTypeBuilder.TEMPLATE_TYPE_EXPECTED.format(),true);
}

Fixed version (ground truth):
public void testBadTemplateType4() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",FunctionTypeBuilder.TEMPLATE_TYPE_EXPECTED.format());
}
Program: 28079
Project: 28079
Buggy source:
public void testBadTemplateType3() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",TypeInference.TEMPLATE_TYPE_OF_THIS_EXPECTED.format(),true);
}

Fixed version (ground truth):
public void testBadTemplateType3() throws Exception {
  testTypes("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",TypeInference.TEMPLATE_TYPE_OF_THIS_EXPECTED.format());
}
Program: 28080
Project: 28080
Buggy source:
@Override public void inferQualifiedSlot(Node node,String symbol,JSType bottomType,JSType inferredType){
  Scope functionScope=getFunctionScope();
  if (functionScope.isLocal()) {
    if (functionScope.getVar(symbol) == null && !functionScope.isBottom()) {
      int firstDot=symbol.indexOf("String_Node_Str");
      Preconditions.checkState(firstDot != -1);
      Var owner=functionScope.getVar(symbol.substring(0,firstDot));
      Scope ownerScope=owner == null ? functionScope : owner.getScope();
      ownerScope.declare(symbol,node,bottomType,null);
    }
    inferSlotType(symbol,inferredType);
  }
}

Fixed version (ground truth):
@Override public void inferQualifiedSlot(Node node,String symbol,JSType bottomType,JSType inferredType){
  Scope functionScope=getFunctionScope();
  if (functionScope.isLocal()) {
    if (functionScope.getVar(symbol) == null && !functionScope.isBottom()) {
      functionScope.declare(symbol,node,bottomType,null);
    }
    inferSlotType(symbol,inferredType);
  }
}
Program: 28081
Project: 28081
Buggy source:
/** 
 * Visits a GETPROP node.
 * @param t The node traversal object that supplies context, such as thescope chain to use in name lookups as well as error reporting.
 * @param n The node being visited.
 * @param parent The parent of <code>n</code>
 */
private void visitGetProp(NodeTraversal t,Node n,Node parent){
  if (n.getJSType() != null && parent.getType() == Token.ASSIGN) {
    return;
  }
  Node property=n.getLastChild();
  Node objNode=n.getFirstChild();
  JSType childType=getJSType(objNode);
  if (!validator.expectNotNullOrUndefined(t,n,childType,childType + "String_Node_Str",getNativeType(OBJECT_TYPE))) {
    ensureTyped(t,n);
    return;
  }
  checkPropertyAccess(childType,property.getString(),t,n);
  ensureTyped(t,n);
}

Fixed version (ground truth):
/** 
 * Visits a GETPROP node.
 * @param t The node traversal object that supplies context, such as thescope chain to use in name lookups as well as error reporting.
 * @param n The node being visited.
 * @param parent The parent of <code>n</code>
 */
private void visitGetProp(NodeTraversal t,Node n,Node parent){
  if (n.getJSType() != null && parent.getType() == Token.ASSIGN) {
    return;
  }
  Node property=n.getLastChild();
  Node objNode=n.getFirstChild();
  JSType childType=getJSType(objNode);
  if (!validator.expectNotNullOrUndefined(t,n,childType,"String_Node_Str",getNativeType(OBJECT_TYPE))) {
    ensureTyped(t,n);
    return;
  }
  checkPropertyAccess(childType,property.getString(),t,n);
  ensureTyped(t,n);
}
Program: 28082
Project: 28082
Buggy source:
/** 
 * Creates an instance for a function that is an interface. 
 */
private FunctionType(JSTypeRegistry registry,String name,Node source){
  super(registry,name,registry.getNativeObjectType(JSTypeNative.FUNCTION_INSTANCE_TYPE));
  Preconditions.checkArgument(source == null || Token.FUNCTION == source.getType());
  Preconditions.checkArgument(name != null);
  this.source=source;
  this.call=new ArrowType(registry,new Node(Token.LP),null);
  this.kind=Kind.INTERFACE;
  this.typeOfThis=new InstanceObjectType(registry,this);
}

Fixed version (ground truth):
/** 
 * Creates an instance for a function that is an interface. 
 */
private FunctionType(JSTypeRegistry registry,String name,Node source){
  super(registry,name,registry.getNativeObjectType(JSTypeNative.FUNCTION_INSTANCE_TYPE));
  setPrettyPrint(true);
  Preconditions.checkArgument(source == null || Token.FUNCTION == source.getType());
  Preconditions.checkArgument(name != null);
  this.source=source;
  this.call=new ArrowType(registry,new Node(Token.LP),null);
  this.kind=Kind.INTERFACE;
  this.typeOfThis=new InstanceObjectType(registry,this);
}
Program: 28083
Project: 28083
Buggy source:
/** 
 * Informally, a function is represented by  {@code function (params): returnType} where the {@code params} is a commaseparated list of types, the first one being a special {@code this:T} if the function expects a known type for {@code this}.
 */
@Override public String toString(){
  if (this == registry.getNativeType(JSTypeNative.FUNCTION_INSTANCE_TYPE)) {
    return "String_Node_Str";
  }
  StringBuilder b=new StringBuilder(32);
  b.append("String_Node_Str");
  int paramNum=call.parameters.getChildCount();
  boolean hasKnownTypeOfThis=!typeOfThis.isUnknownType();
  if (hasKnownTypeOfThis) {
    if (isConstructor()) {
      b.append("String_Node_Str");
    }
 else {
      b.append("String_Node_Str");
    }
    b.append(typeOfThis.toString());
  }
  if (paramNum > 0) {
    if (hasKnownTypeOfThis) {
      b.append("String_Node_Str");
    }
    Node p=call.parameters.getFirstChild();
    if (p.isVarArgs()) {
      appendVarArgsString(b,p.getJSType());
    }
 else {
      b.append(p.getJSType().toString());
    }
    p=p.getNext();
    while (p != null) {
      b.append("String_Node_Str");
      if (p.isVarArgs()) {
        appendVarArgsString(b,p.getJSType());
      }
 else {
        b.append(p.getJSType().toString());
      }
      p=p.getNext();
    }
  }
  b.append("String_Node_Str");
  b.append(call.returnType);
  return b.toString();
}

Fixed version (ground truth):
/** 
 * Informally, a function is represented by  {@code function (params): returnType} where the {@code params} is a commaseparated list of types, the first one being a special {@code this:T} if the function expects a known type for {@code this}.
 */
@Override public String toString(){
  if (!isPrettyPrint() || this == registry.getNativeType(JSTypeNative.FUNCTION_INSTANCE_TYPE)) {
    return "String_Node_Str";
  }
  setPrettyPrint(false);
  StringBuilder b=new StringBuilder(32);
  b.append("String_Node_Str");
  int paramNum=call.parameters.getChildCount();
  boolean hasKnownTypeOfThis=!typeOfThis.isUnknownType();
  if (hasKnownTypeOfThis) {
    if (isConstructor()) {
      b.append("String_Node_Str");
    }
 else {
      b.append("String_Node_Str");
    }
    b.append(typeOfThis.toString());
  }
  if (paramNum > 0) {
    if (hasKnownTypeOfThis) {
      b.append("String_Node_Str");
    }
    Node p=call.parameters.getFirstChild();
    if (p.isVarArgs()) {
      appendVarArgsString(b,p.getJSType());
    }
 else {
      b.append(p.getJSType().toString());
    }
    p=p.getNext();
    while (p != null) {
      b.append("String_Node_Str");
      if (p.isVarArgs()) {
        appendVarArgsString(b,p.getJSType());
      }
 else {
        b.append(p.getJSType().toString());
      }
      p=p.getNext();
    }
  }
  b.append("String_Node_Str");
  b.append(call.returnType);
  setPrettyPrint(true);
  return b.toString();
}
Program: 28084
Project: 28084
Buggy source:
/** 
 * A generic implementation meant to be used as a helper for common getGreatestSubtype implementations.
 */
static JSType getGreatestSubtype(JSType thisType,JSType thatType){
  if (thisType.isEquivalentTo(thatType)) {
    return thisType;
  }
 else   if (thisType.isUnknownType() || thatType.isUnknownType()) {
    return thisType.isEquivalentTo(thatType) ? thisType : thisType.getNativeType(JSTypeNative.UNKNOWN_TYPE);
  }
 else   if (thisType.isSubtype(thatType)) {
    return filterNoResolvedType(thisType);
  }
 else   if (thatType.isSubtype(thisType)) {
    return filterNoResolvedType(thatType);
  }
 else   if (thisType.isUnionType()) {
    return thisType.toMaybeUnionType().meet(thatType);
  }
 else   if (thatType.isUnionType()) {
    return thatType.toMaybeUnionType().meet(thisType);
  }
  if (thisType.isEnumElementType()) {
    JSType inf=thisType.toMaybeEnumElementType().meet(thatType);
    if (inf != null) {
      return inf;
    }
  }
 else   if (thatType.isEnumElementType()) {
    JSType inf=thatType.toMaybeEnumElementType().meet(thisType);
    if (inf != null) {
      return inf;
    }
  }
  if (thisType.isObject() && thatType.isObject()) {
    return thisType.getNativeType(JSTypeNative.NO_OBJECT_TYPE);
  }
  return thisType.getNativeType(JSTypeNative.NO_TYPE);
}

Fixed version (ground truth):
/** 
 * A generic implementation meant to be used as a helper for common getGreatestSubtype implementations.
 */
static JSType getGreatestSubtype(JSType thisType,JSType thatType){
  if (thisType.isEquivalentTo(thatType)) {
    return thisType;
  }
 else   if (thisType.isUnknownType() || thatType.isUnknownType()) {
    return thisType.isEquivalentTo(thatType) ? thisType : thisType.getNativeType(JSTypeNative.UNKNOWN_TYPE);
  }
 else   if (thisType.isSubtype(thatType)) {
    return filterNoResolvedType(thisType);
  }
 else   if (thatType.isSubtype(thisType)) {
    return filterNoResolvedType(thatType);
  }
 else   if (thisType.isUnionType()) {
    return thisType.toMaybeUnionType().meet(thatType);
  }
 else   if (thatType.isUnionType()) {
    return thatType.toMaybeUnionType().meet(thisType);
  }
 else   if (thisType.isRecordType()) {
    return thisType.toMaybeRecordType().getGreatestSubtypeHelper(thatType);
  }
 else   if (thatType.isRecordType()) {
    return thatType.toMaybeRecordType().getGreatestSubtypeHelper(thisType);
  }
  if (thisType.isEnumElementType()) {
    JSType inf=thisType.toMaybeEnumElementType().meet(thatType);
    if (inf != null) {
      return inf;
    }
  }
 else   if (thatType.isEnumElementType()) {
    JSType inf=thatType.toMaybeEnumElementType().meet(thisType);
    if (inf != null) {
      return inf;
    }
  }
  if (thisType.isObject() && thatType.isObject()) {
    return thisType.getNativeType(JSTypeNative.NO_OBJECT_TYPE);
  }
  return thisType.getNativeType(JSTypeNative.NO_TYPE);
}
Program: 28085
Project: 28085
Buggy source:
public boolean isRecordType(){
  return false;
}

Fixed version (ground truth):
public boolean isRecordType(){
  return toMaybeRecordType() != null;
}
Program: 28086
Project: 28086
Buggy source:
@Override public boolean isSubtype(JSType that){
  if (JSType.isSubtypeHelper(this,that)) {
    return true;
  }
  if (that.isUnionType()) {
    return false;
  }
  if (that instanceof RecordType) {
    return RecordType.isSubtype(this,(RecordType)that);
  }
  ObjectType thatObj=that.toObjectType();
  ObjectType thatCtor=thatObj == null ? null : thatObj.getConstructor();
  if (thatCtor != null && thatCtor.isInterface()) {
    Iterable<ObjectType> thisInterfaces=getCtorImplementedInterfaces();
    for (    ObjectType thisInterface : thisInterfaces) {
      if (thisInterface.isSubtype(that)) {
        return true;
      }
    }
  }
  if (getConstructor() != null && getConstructor().isInterface()) {
    for (    ObjectType thisInterface : getCtorExtendedInterfaces()) {
      if (thisInterface.isSubtype(that)) {
        return true;
      }
    }
  }
  if (isUnknownType() || implicitPrototypeChainIsUnknown()) {
    return true;
  }
  return this.isImplicitPrototype(thatObj);
}

Fixed version (ground truth):
@Override public boolean isSubtype(JSType that){
  if (JSType.isSubtypeHelper(this,that)) {
    return true;
  }
  if (that.isUnionType()) {
    return false;
  }
  if (that.isRecordType()) {
    return RecordType.isSubtype(this,that.toMaybeRecordType());
  }
  ObjectType thatObj=that.toObjectType();
  ObjectType thatCtor=thatObj == null ? null : thatObj.getConstructor();
  if (thatCtor != null && thatCtor.isInterface()) {
    Iterable<ObjectType> thisInterfaces=getCtorImplementedInterfaces();
    for (    ObjectType thisInterface : thisInterfaces) {
      if (thisInterface.isSubtype(that)) {
        return true;
      }
    }
  }
  if (getConstructor() != null && getConstructor().isInterface()) {
    for (    ObjectType thisInterface : getCtorExtendedInterfaces()) {
      if (thisInterface.isSubtype(that)) {
        return true;
      }
    }
  }
  if (isUnknownType() || implicitPrototypeChainIsUnknown()) {
    return true;
  }
  return this.isImplicitPrototype(thatObj);
}
Program: 28087
Project: 28087
Buggy source:
@Override public boolean isEquivalentTo(JSType other){
  if (!(other instanceof RecordType)) {
    return false;
  }
  RecordType otherRecord=(RecordType)other;
  Set<String> keySet=properties.keySet();
  Map<String,JSType> otherProps=otherRecord.properties;
  if (!otherProps.keySet().equals(keySet)) {
    return false;
  }
  for (  String key : keySet) {
    if (!otherProps.get(key).isEquivalentTo(properties.get(key))) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isEquivalentTo(JSType other){
  if (!other.isRecordType()) {
    return false;
  }
  RecordType otherRecord=other.toMaybeRecordType();
  if (otherRecord == this) {
    return true;
  }
  Set<String> keySet=properties.keySet();
  Map<String,JSType> otherProps=otherRecord.properties;
  if (!otherProps.keySet().equals(keySet)) {
    return false;
  }
  for (  String key : keySet) {
    if (!otherProps.get(key).isEquivalentTo(properties.get(key))) {
      return false;
    }
  }
  return true;
}
Program: 28088
Project: 28088
Buggy source:
/** 
 * Creates a record type.
 * @param registry The type registry under which this type lives.
 * @param properties A map of all the properties of this record type.
 * @throws IllegalStateException if the {@code RecordProperty} associatedwith a property is null.
 */
RecordType(JSTypeRegistry registry,Map<String,RecordProperty> properties){
  super(registry,null,null);
  for (  String property : properties.keySet()) {
    RecordProperty prop=properties.get(property);
    if (prop == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    defineDeclaredProperty(property,prop.getType(),prop.getPropertyNode());
  }
  isFrozen=true;
}

Fixed version (ground truth):
/** 
 * Creates a record type.
 * @param registry The type registry under which this type lives.
 * @param properties A map of all the properties of this record type.
 * @throws IllegalStateException if the {@code RecordProperty} associatedwith a property is null.
 */
RecordType(JSTypeRegistry registry,Map<String,RecordProperty> properties){
  super(registry,null,null);
  setPrettyPrint(true);
  for (  String property : properties.keySet()) {
    RecordProperty prop=properties.get(property);
    if (prop == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    defineDeclaredProperty(property,prop.getType(),prop.getPropertyNode());
  }
  isFrozen=true;
}
Program: 28089
Project: 28089
Buggy source:
@Override public JSType getLeastSupertype(JSType that){
  if (!that.isRecordType()) {
    return super.getLeastSupertype(that);
  }
  RecordType thatRecord=(RecordType)that;
  RecordTypeBuilder builder=new RecordTypeBuilder(registry);
  for (  String property : properties.keySet()) {
    if (thatRecord.hasProperty(property) && thatRecord.getPropertyType(property).isEquivalentTo(getPropertyType(property))) {
      builder.addProperty(property,getPropertyType(property),getPropertyNode(property));
    }
  }
  return builder.build();
}

Fixed version (ground truth):
@Override public JSType getLeastSupertype(JSType that){
  if (!that.isRecordType()) {
    return super.getLeastSupertype(that);
  }
  RecordType thatRecord=that.toMaybeRecordType();
  RecordTypeBuilder builder=new RecordTypeBuilder(registry);
  for (  String property : properties.keySet()) {
    if (thatRecord.hasProperty(property) && thatRecord.getPropertyType(property).isEquivalentTo(getPropertyType(property))) {
      builder.addProperty(property,getPropertyType(property),getPropertyNode(property));
    }
  }
  return builder.build();
}
Program: 28090
Project: 28090
Buggy source:
/** 
 * Set the implicit prototype if it's possible to do so.
 * @return True if we were able to set the implicit prototype successfully,false if it was not possible to do so for some reason. There are a few different reasons why this could fail: for example, numbers can't be implicit prototypes, and we don't want to change the implicit prototype if other classes have already subclassed this one.
 */
public boolean resetImplicitPrototype(JSType type,ObjectType newImplicitProto){
  if (type instanceof PrototypeObjectType) {
    PrototypeObjectType poType=(PrototypeObjectType)type;
    if (!poType.hasCachedValues()) {
      poType.setImplicitPrototype(newImplicitProto);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Set the implicit prototype if it's possible to do so.
 * @return True if we were able to set the implicit prototype successfully,false if it was not possible to do so for some reason. There are a few different reasons why this could fail: for example, numbers can't be implicit prototypes, and we don't want to change the implicit prototype if other classes have already subclassed this one.
 */
public boolean resetImplicitPrototype(JSType type,ObjectType newImplicitProto){
  if (type instanceof PrototypeObjectType) {
    PrototypeObjectType poType=(PrototypeObjectType)type;
    poType.clearCachedValues();
    poType.setImplicitPrototype(newImplicitProto);
    return true;
  }
  return false;
}
Program: 28091
Project: 28091
Buggy source:
/** 
 * Returns true if any cached valeus have been set for this type.  If true, then the prototype chain should not be changed, as it might invalidate the cached values.
 */
public boolean hasCachedValues(){
  return !unknown;
}

Fixed version (ground truth):
/** 
 * Returns true if any cached values have been set for this type.  If true, then the prototype chain should not be changed, as it might invalidate the cached values.
 */
public boolean hasCachedValues(){
  return !unknown;
}
Program: 28092
Project: 28092
Buggy source:
/** 
 * Sets the source node.
 */
public void setSource(Node source){
  if (null == source) {
    prototypeSlot=null;
  }
  this.source=source;
}

Fixed version (ground truth):
/** 
 * Sets the source node.
 */
public void setSource(Node source){
  if (prototypeSlot != null) {
    if (source == null || prototypeSlot.getNode() == null) {
      prototypeSlot=new Property(prototypeSlot.getName(),prototypeSlot.getType(),prototypeSlot.isTypeInferred(),source);
    }
  }
  this.source=source;
}
Program: 28093
Project: 28093
Buggy source:
/** 
 * Looks for a type expression at the current token and if found, returns it. Note that this method consumes input. Parameter type expressions are special for two reasons: <ol> <li>They must begin with '{', to distinguish type names from param names. <li>They may end in '=', to denote optionality. </ol>
 * @param token The current token.
 * @return The type expression found or null if none.
 */
private Node parseAndRecordParamTypeNode(JsDocToken token){
  Preconditions.checkArgument(token == JsDocToken.LC);
  int lineno=stream.getLineno();
  int startCharno=stream.getCharno();
  Node typeNode=parseParamTypeExpressionAnnotation(token);
  int endCharno=stream.getCharno();
  jsdocBuilder.markTypeNode(typeNode,lineno,startCharno,endCharno,true);
  return typeNode;
}

Fixed version (ground truth):
/** 
 * Looks for a type expression at the current token and if found, returns it. Note that this method consumes input. Parameter type expressions are special for two reasons: <ol> <li>They must begin with '{', to distinguish type names from param names. <li>They may end in '=', to denote optionality. </ol>
 * @param token The current token.
 * @return The type expression found or null if none.
 */
private Node parseAndRecordParamTypeNode(JsDocToken token){
  Preconditions.checkArgument(token == JsDocToken.LC);
  int lineno=stream.getLineno();
  int startCharno=stream.getCharno();
  Node typeNode=parseParamTypeExpressionAnnotation(token);
  if (typeNode != null) {
    int endLineno=stream.getLineno();
    int endCharno=stream.getCharno();
    jsdocBuilder.markTypeNode(typeNode,lineno,startCharno,endLineno,endCharno,true);
  }
  return typeNode;
}
Program: 28094
Project: 28094
Buggy source:
/** 
 * Looks for a parameter type expression at the current token and if found, returns it. Note that this method consumes input.
 * @param token The current token.
 * @param lineno The line of the type expression.
 * @param startCharno The starting character position of the type expression.
 * @param matchingLC Whether the type expression starts with a "{".
 * @param onlyParseSimpleNames If true, only simple type names are parsed(via a call to parseTypeNameAnnotation instead of parseTypeExpressionAnnotation).
 * @return The type expression found or null if none.
 */
private Node parseAndRecordTypeNode(JsDocToken token,int lineno,int startCharno,boolean matchingLC,boolean onlyParseSimpleNames){
  Node typeNode=null;
  if (onlyParseSimpleNames) {
    typeNode=parseTypeNameAnnotation(token);
  }
 else {
    typeNode=parseTypeExpressionAnnotation(token);
  }
  if (typeNode != null && !matchingLC) {
    typeNode.putBooleanProp(Node.BRACELESS_TYPE,true);
  }
  int endCharno=stream.getCharno();
  jsdocBuilder.markTypeNode(typeNode,lineno,startCharno,endCharno,matchingLC);
  return typeNode;
}

Fixed version (ground truth):
/** 
 * Looks for a parameter type expression at the current token and if found, returns it. Note that this method consumes input.
 * @param token The current token.
 * @param lineno The line of the type expression.
 * @param startCharno The starting character position of the type expression.
 * @param matchingLC Whether the type expression starts with a "{".
 * @param onlyParseSimpleNames If true, only simple type names are parsed(via a call to parseTypeNameAnnotation instead of parseTypeExpressionAnnotation).
 * @return The type expression found or null if none.
 */
private Node parseAndRecordTypeNode(JsDocToken token,int lineno,int startCharno,boolean matchingLC,boolean onlyParseSimpleNames){
  Node typeNode=null;
  if (onlyParseSimpleNames) {
    typeNode=parseTypeNameAnnotation(token);
  }
 else {
    typeNode=parseTypeExpressionAnnotation(token);
  }
  if (typeNode != null && !matchingLC) {
    typeNode.putBooleanProp(Node.BRACELESS_TYPE,true);
  }
  if (typeNode != null) {
    int endLineno=stream.getLineno();
    int endCharno=stream.getCharno();
    jsdocBuilder.markTypeNode(typeNode,lineno,startCharno,endLineno,endCharno,matchingLC);
  }
  return typeNode;
}
Program: 28095
Project: 28095
Buggy source:
/** 
 * Gets the list of all markers for the documentation in this JSDoc. 
 */
public Collection<Marker> getMarkers(){
  return documentation == null ? null : documentation.markers;
}

Fixed version (ground truth):
/** 
 * Gets the list of all markers for the documentation in this JSDoc. 
 */
public Collection<Marker> getMarkers(){
  return documentation == null ? ImmutableList.<Marker>of() : documentation.markers;
}
Program: 28096
Project: 28096
Buggy source:
/** 
 * Adds a textual block to the current marker.
 */
public void markText(String text,int startLineno,int startCharno,int endLineno,int endCharno){
  if (currentMarker != null) {
    currentMarker.description=new JSDocInfo.StringPosition();
    currentMarker.description.setItem(text);
    currentMarker.description.setPositionInformation(startLineno,startCharno,endLineno,endCharno);
  }
}

Fixed version (ground truth):
/** 
 * Adds a textual block to the current marker.
 */
public void markText(String text,int startLineno,int startCharno,int endLineno,int endCharno){
  if (currentMarker != null) {
    JSDocInfo.StringPosition position=new JSDocInfo.StringPosition();
    position.setItem(text);
    position.setPositionInformation(startLineno,startCharno,endLineno,endCharno);
    currentMarker.setDescription(position);
  }
}
Program: 28097
Project: 28097
Buggy source:
/** 
 * Adds a marker to the current JSDocInfo and populates the marker with the annotation information.
 */
public void markAnnotation(String annotation,int lineno,int charno){
  JSDocInfo.Marker marker=currentInfo.addMarker();
  if (marker != null) {
    marker.annotation=new JSDocInfo.StringPosition();
    marker.annotation.setItem(annotation);
    marker.annotation.setPositionInformation(lineno,charno,lineno,charno + annotation.length());
  }
  currentMarker=marker;
}

Fixed version (ground truth):
/** 
 * Adds a marker to the current JSDocInfo and populates the marker with the annotation information.
 */
public void markAnnotation(String annotation,int lineno,int charno){
  JSDocInfo.Marker marker=currentInfo.addMarker();
  if (marker != null) {
    JSDocInfo.TrimmedStringPosition position=new JSDocInfo.TrimmedStringPosition();
    position.setItem(annotation);
    position.setPositionInformation(lineno,charno,lineno,charno + annotation.length());
    marker.setAnnotation(position);
    populated=true;
  }
  currentMarker=marker;
}
Program: 28098
Project: 28098
Buggy source:
/** 
 * Adds a name declaration to the current marker.
 */
public void markName(String name,int lineno,int charno){
  if (currentMarker != null) {
    currentMarker.name=new JSDocInfo.StringPosition();
    currentMarker.name.setItem(name);
    currentMarker.name.setPositionInformation(lineno,charno,lineno,charno + name.length());
  }
}

Fixed version (ground truth):
/** 
 * Adds a name declaration to the current marker.
 */
public void markName(String name,int lineno,int charno){
  if (currentMarker != null) {
    JSDocInfo.TrimmedStringPosition position=new JSDocInfo.TrimmedStringPosition();
    position.setItem(name);
    position.setPositionInformation(lineno,charno,lineno,charno + name.length());
    currentMarker.setName(position);
  }
}
Program: 28099
Project: 28099
Buggy source:
/** 
 * Adds a type declaration to the current marker.
 */
public void markTypeNode(Node typeNode,int lineno,int startCharno,int endCharno,boolean hasLC){
  if (currentMarker != null) {
    currentMarker.type=new JSDocInfo.TypePosition();
    currentMarker.type.setItem(typeNode);
    currentMarker.type.hasBrackets=hasLC;
    currentMarker.type.setPositionInformation(lineno,startCharno,lineno,endCharno);
  }
}

Fixed version (ground truth):
/** 
 * Adds a type declaration to the current marker.
 */
public void markTypeNode(Node typeNode,int lineno,int startCharno,int endLineno,int endCharno,boolean hasLC){
  if (currentMarker != null) {
    JSDocInfo.TypePosition position=new JSDocInfo.TypePosition();
    position.setItem(typeNode);
    position.setHasBrackets(hasLC);
    position.setPositionInformation(lineno,startCharno,endLineno,endCharno);
    currentMarker.setType(position);
  }
}
Program: 28100
Project: 28100
Buggy source:
/** 
 * Sets the position information contained in this source position.
 */
public void setPositionInformation(int startLineno,int startCharno,int endLineno,int endCharno){
  this.startLineno=startLineno;
  this.startCharno=startCharno;
  this.endLineno=endLineno;
  this.endCharno=endCharno;
}

Fixed version (ground truth):
/** 
 * Sets the position information contained in this source position.
 */
public void setPositionInformation(int startLineno,int startCharno,int endLineno,int endCharno){
  if (startLineno == endLineno) {
    if (startCharno >= endCharno) {
      throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + startCharno + "String_Node_Str"+ "String_Node_Str"+ endCharno);
    }
  }
 else {
    if (startLineno > endLineno) {
      throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + startLineno + "String_Node_Str"+ "String_Node_Str"+ endLineno);
    }
  }
  this.startLineno=startLineno;
  this.startCharno=startCharno;
  this.endLineno=endLineno;
  this.endCharno=endCharno;
}
Program: 28101
Project: 28101
Buggy source:
private void assertMarkerPosition(Node n,int lineno,int charno){
  int count=0;
  for (  JSDocInfo.Marker marker : n.getJSDocInfo().getMarkers()) {
    assertEquals(lineno,marker.annotation.getStartLine());
    assertEquals(charno,marker.annotation.getPositionOnStartLine());
    count++;
  }
  assertEquals(1,count);
}

Fixed version (ground truth):
private void assertMarkerPosition(Node n,int lineno,int charno){
  int count=0;
  for (  JSDocInfo.Marker marker : n.getJSDocInfo().getMarkers()) {
    assertEquals(lineno,marker.getAnnotation().getStartLine());
    assertEquals(charno,marker.getAnnotation().getPositionOnStartLine());
    count++;
  }
  assertEquals(1,count);
}
Program: 28102
Project: 28102
Buggy source:
private FlowScope narrowScope(FlowScope scope,Node node,JSType narrowed){
  scope=scope.createChildFlowScope();
  if (node.getType() == Token.GETPROP) {
    scope.inferQualifiedSlot(node.getQualifiedName(),getNativeType(UNKNOWN_TYPE),narrowed);
  }
 else {
    redeclareSimpleVar(scope,node,narrowed);
  }
  return scope;
}

Fixed version (ground truth):
private FlowScope narrowScope(FlowScope scope,Node node,JSType narrowed){
  scope=scope.createChildFlowScope();
  if (node.getType() == Token.GETPROP) {
    scope.inferQualifiedSlot(node.getQualifiedName(),getJSType(node),narrowed);
  }
 else {
    redeclareSimpleVar(scope,node,narrowed);
  }
  return scope;
}
Program: 28103
Project: 28103
Buggy source:
public void testClosure7() throws Exception {
  testClosureTypes(CLOSURE_DEFS + "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 testClosure7() throws Exception {
  testClosureTypes(CLOSURE_DEFS + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str");
}
Program: 28104
Project: 28104
Buggy source:
private void reportRefToUndefinedName(Name name,Ref ref){
  while (name.parent != null && name.parent.globalSets + name.parent.localSets == 0) {
    name=name.parent;
  }
  compiler.report(JSError.make(ref.getSourceName(),ref.node,level,UNDEFINED_NAME_WARNING,name.fullName()));
}

Fixed version (ground truth):
private void reportRefToUndefinedName(Name name,Ref ref){
  while (name.parent != null && name.parent.globalSets + name.parent.localSets == 0) {
    name=name.parent;
  }
  compiler.report(JSError.make(ref.getSourceName(),ref.node,level,UNDEFINED_NAME_WARNING,name.getFullName()));
}
Program: 28105
Project: 28105
Buggy source:
private void reportBadModuleReference(Name name,Ref ref){
  compiler.report(JSError.make(ref.source.getName(),ref.node,STRICT_MODULE_DEP_QNAME,ref.getModule().getName(),name.getDeclaration().getModule().getName(),name.fullName()));
}

Fixed version (ground truth):
private void reportBadModuleReference(Name name,Ref ref){
  compiler.report(JSError.make(ref.source.getName(),ref.node,STRICT_MODULE_DEP_QNAME,ref.getModule().getName(),name.getDeclaration().getModule().getName(),name.getFullName()));
}