nus-yam/ex-repair huggingface dataset:
Program: 27313
Project: 27313
Buggy source:
@Override void endFile(){
  super.endFile();
  if (!preferLineBreakAtEndOfFile) {
    return;
  }
  if (lineLength > lineLengthThreshold / 2) {
    append("String_Node_Str");
    startNewLine();
  }
 else   if (prevCutPosition > 0) {
    code.setCharAt(prevCutPosition,' ');
    lineStartPosition=prevLineStartPosition;
    lineLength=code.length() - lineStartPosition;
    reportLineCut(lineIndex,prevCutPosition + 1,false);
    lineIndex--;
    prevCutPosition=0;
    prevLineStartPosition=0;
    append("String_Node_Str");
    startNewLine();
  }
 else {
  }
}

Fixed version (ground truth):
@Override void endFile(){
  super.endFile();
  if (!preferLineBreakAtEndOfFile) {
    return;
  }
  if (lineLength > lineLengthThreshold / 2) {
    append("String_Node_Str");
    startNewLine();
  }
 else   if (prevCutPosition > 0) {
    code.setCharAt(prevCutPosition,' ');
    lineStartPosition=prevLineStartPosition;
    lineLength=code.length() - lineStartPosition;
    int prevLineEndPosition=prevCutPosition - prevLineStartPosition + 1;
    reportLineCut(lineIndex,prevLineEndPosition,false);
    lineIndex--;
    prevCutPosition=0;
    prevLineStartPosition=0;
    append("String_Node_Str");
    startNewLine();
  }
 else {
  }
}
Program: 27314
Project: 27314
Buggy source:
/** 
 * Converts a tree to JS code
 */
private static String toSource(Node root,Format outputFormat,CompilerOptions options,SourceMap sourceMap,boolean tagAsExterns,boolean tagAsStrict,boolean lineBreak,CodeGeneratorFactory codeGeneratorFactory){
  Preconditions.checkState(options.sourceMapDetailLevel != null);
  boolean createSourceMap=(sourceMap != null);
  MappedCodePrinter mcp=outputFormat == Format.COMPACT ? new CompactCodePrinter(lineBreak,options.preferLineBreakAtEndOfFile,options.lineLengthThreshold,createSourceMap,options.sourceMapDetailLevel) : new PrettyCodePrinter(options.lineLengthThreshold,createSourceMap,options.sourceMapDetailLevel);
  CodeGenerator cg=codeGeneratorFactory.getCodeGenerator(outputFormat,mcp);
  if (tagAsExterns) {
    cg.tagAsExterns();
  }
  if (tagAsStrict) {
    cg.tagAsStrict();
  }
  cg.add(root);
  mcp.endFile();
  String code=mcp.getCode();
  if (createSourceMap) {
    mcp.generateSourceMap(sourceMap);
  }
  return code;
}

Fixed version (ground truth):
/** 
 * Converts a tree to JS code
 */
private static String toSource(Node root,Format outputFormat,CompilerOptions options,SourceMap sourceMap,boolean tagAsExterns,boolean tagAsStrict,boolean lineBreak,CodeGeneratorFactory codeGeneratorFactory){
  Preconditions.checkState(options.sourceMapDetailLevel != null);
  boolean createSourceMap=(sourceMap != null);
  MappedCodePrinter mcp=outputFormat == Format.COMPACT ? new CompactCodePrinter(lineBreak,options.preferLineBreakAtEndOfFile,options.lineLengthThreshold,createSourceMap,options.sourceMapDetailLevel) : new PrettyCodePrinter(options.lineLengthThreshold,createSourceMap,options.sourceMapDetailLevel);
  CodeGenerator cg=codeGeneratorFactory.getCodeGenerator(outputFormat,mcp);
  if (tagAsExterns) {
    cg.tagAsExterns();
  }
  if (tagAsStrict) {
    cg.tagAsStrict();
  }
  cg.add(root);
  mcp.endFile();
  String code=mcp.getCode();
  if (createSourceMap) {
    mcp.generateSourceMap(code,sourceMap);
  }
  return code;
}
Program: 27315
Project: 27315
Buggy source:
/** 
 * Generates the source map from the given code consumer, appending the information it saved to the SourceMap object given.
 */
void generateSourceMap(SourceMap map){
  if (createSrcMap) {
    for (    Mapping mapping : allMappings) {
      map.addMapping(mapping.node,mapping.start,mapping.end);
    }
  }
}

Fixed version (ground truth):
/** 
 * Generates the source map from the given code consumer, appending the information it saved to the SourceMap object given.
 */
void generateSourceMap(String code,SourceMap map){
  if (createSrcMap) {
    List<Integer> lineLengths=computeLineLengths(code);
    for (    Mapping mapping : allMappings) {
      map.addMapping(mapping.node,mapping.start,adjustEndPosition(lineLengths,mapping.end));
    }
  }
}
Program: 27316
Project: 27316
Buggy source:
/** 
 * Invalidates the given type, so that no properties on it will be renamed.
 */
private void recordInvalidatingType(JSType type,JSError error){
  type=type.restrictByNotNullOrUndefined();
  if (type.isUnionType()) {
    for (    JSType alt : type.toMaybeUnionType().getAlternatesWithoutStructuralTyping()) {
      recordInvalidatingType(alt,error);
    }
  }
 else   if (type.isEnumElementType()) {
    recordInvalidatingType(type.toMaybeEnumElementType().getPrimitiveType(),error);
  }
 else {
    addInvalidatingType(type);
    recordInvalidationError(type,error);
    ObjectType objType=ObjectType.cast(type);
    if (objType != null && objType.getImplicitPrototype() != null) {
      addInvalidatingType(objType.getImplicitPrototype());
      recordInvalidationError(objType.getImplicitPrototype(),error);
    }
    if (objType != null && objType.isConstructor() && objType.isFunctionType()) {
      addInvalidatingType(objType.toMaybeFunctionType().getInstanceType());
    }
  }
}

Fixed version (ground truth):
/** 
 * Invalidates the given type, so that no properties on it will be renamed.
 */
private void recordInvalidatingType(JSType type,TypeMismatch mis){
  type=type.restrictByNotNullOrUndefined();
  if (type.isUnionType()) {
    for (    JSType alt : type.toMaybeUnionType().getAlternatesWithoutStructuralTyping()) {
      recordInvalidatingType(alt,mis);
    }
  }
 else   if (type.isEnumElementType()) {
    recordInvalidatingType(type.toMaybeEnumElementType().getPrimitiveType(),mis);
  }
 else {
    addInvalidatingType(type);
    recordInvalidationError(type,mis);
    ObjectType objType=ObjectType.cast(type);
    if (objType != null && objType.getImplicitPrototype() != null) {
      addInvalidatingType(objType.getImplicitPrototype());
      recordInvalidationError(objType.getImplicitPrototype(),mis);
    }
    if (objType != null && objType.isConstructor() && objType.isFunctionType()) {
      addInvalidatingType(objType.toMaybeFunctionType().getInstanceType());
    }
  }
}
Program: 27317
Project: 27317
Buggy source:
@Override public void process(Node externs,Node root){
  Preconditions.checkState(compiler.getLifeCycleStage() == LifeCycleStage.NORMALIZED);
  this.ancestorInterfaces=new HashMap<>();
  this.gtwpCache=new HashMap<>();
  for (  TypeMismatch mis : compiler.getTypeMismatches()) {
    recordInvalidatingType(mis.typeA,mis.src);
    recordInvalidatingType(mis.typeB,mis.src);
  }
  for (  TypeMismatch mis : compiler.getImplicitInterfaceUses()) {
    recordInvalidatingType(mis.typeA,mis.src);
    recordInvalidatingType(mis.typeB,mis.src);
  }
  NodeTraversal.traverseEs6(compiler,externs,new FindExternProperties());
  NodeTraversal.traverseEs6(compiler,root,new FindRenameableProperties());
  renameProperties();
}

Fixed version (ground truth):
@Override public void process(Node externs,Node root){
  Preconditions.checkState(compiler.getLifeCycleStage() == LifeCycleStage.NORMALIZED);
  this.ancestorInterfaces=new HashMap<>();
  this.gtwpCache=new HashMap<>();
  for (  TypeMismatch mis : compiler.getTypeMismatches()) {
    recordInvalidatingType(mis.typeA,mis);
    recordInvalidatingType(mis.typeB,mis);
  }
  for (  TypeMismatch mis : compiler.getImplicitInterfaceUses()) {
    recordInvalidatingType(mis.typeA,mis);
    recordInvalidatingType(mis.typeB,mis);
  }
  NodeTraversal.traverseEs6(compiler,externs,new FindExternProperties());
  NodeTraversal.traverseEs6(compiler,root,new FindRenameableProperties());
  renameProperties();
}
Program: 27318
Project: 27318
Buggy source:
private void recordInvalidationError(JSType t,JSError error){
  if (!t.isObject()) {
    return;
  }
  if (invalidationMap != null) {
    Collection<JSError> errors=this.invalidationMap.get(t);
    if (errors.size() < MAX_INVALIDATION_WARNINGS_PER_PROPERTY) {
      errors.add(error);
    }
  }
}

Fixed version (ground truth):
private void recordInvalidationError(JSType t,TypeMismatch mis){
  if (!t.isObject()) {
    return;
  }
  if (invalidationMap != null) {
    Collection<JSError> errors=this.invalidationMap.get(t);
    if (errors.size() < MAX_INVALIDATION_WARNINGS_PER_PROPERTY) {
      JSError error=mis.src;
      if (error.getType().equals(TypeValidator.TYPE_MISMATCH_WARNING) && error.description.isEmpty()) {
        String msg="String_Node_Str" + mis.typeA + "String_Node_Str"+ mis.typeB;
        error=JSError.make(error.node,TypeValidator.TYPE_MISMATCH_WARNING,msg);
      }
      errors.add(error);
    }
  }
}
Program: 27319
Project: 27319
Buggy source:
private void recordImplicitInterfaceUses(Node src,JSType sourceType,JSType targetType){
  sourceType=removeNullUndefinedAndTemplates(sourceType);
  targetType=removeNullUndefinedAndTemplates(targetType);
  boolean strictMismatch=!sourceType.isSubtypeWithoutStructuralTyping(targetType) && !targetType.isSubtypeWithoutStructuralTyping(sourceType);
  boolean mismatch=!sourceType.isSubtype(targetType) && !targetType.isSubtype(sourceType);
  if (strictMismatch || mismatch) {
    String msg;
    if (numImplicitUses < 10) {
      msg="String_Node_Str" + sourceType + "String_Node_Str"+ targetType;
    }
 else {
      msg="String_Node_Str";
    }
    numImplicitUses++;
    JSError err=JSError.make(src,TYPE_MISMATCH_WARNING,msg);
    implicitInterfaceUses.add(new TypeMismatch(sourceType,targetType,err));
  }
}

Fixed version (ground truth):
private void recordImplicitInterfaceUses(Node src,JSType sourceType,JSType targetType){
  sourceType=removeNullUndefinedAndTemplates(sourceType);
  targetType=removeNullUndefinedAndTemplates(targetType);
  boolean strictMismatch=!sourceType.isSubtypeWithoutStructuralTyping(targetType) && !targetType.isSubtypeWithoutStructuralTyping(sourceType);
  boolean mismatch=!sourceType.isSubtype(targetType) && !targetType.isSubtype(sourceType);
  if (strictMismatch || mismatch) {
    JSError err=JSError.make(src,TYPE_MISMATCH_WARNING,"String_Node_Str");
    implicitInterfaceUses.add(new TypeMismatch(sourceType,targetType,err));
  }
}
Program: 27320
Project: 27320
Buggy source:
@Override SourceFile getSourceFileByName(String sourceName){
  if (sourceName != null) {
    CompilerInput input=inputsById.get(new InputId(sourceName));
    if (input != null) {
      return input.getSourceFile();
    }
    return sourceMapOriginalSources.get(sourceName);
  }
  return null;
}

Fixed version (ground truth):
@Override public SourceFile getSourceFileByName(String sourceName){
  if (sourceName != null) {
    CompilerInput input=inputsById.get(new InputId(sourceName));
    if (input != null) {
      return input.getSourceFile();
    }
    return sourceMapOriginalSources.get(sourceName);
  }
  return null;
}
Program: 27321
Project: 27321
Buggy source:
/** 
 * Applies the provided set of code replacements to the code and returns the transformed code. The code replacements may not have any overlap.
 */
public static String applyCodeReplacements(Iterable<CodeReplacement> replacements,String code){
  List<CodeReplacement> sortedReplacements=ORDER_CODE_REPLACEMENTS.sortedCopy(replacements);
  validateNoOverlaps(sortedReplacements);
  StringBuilder sb=new StringBuilder();
  int lastIndex=0;
  for (  CodeReplacement replacement : sortedReplacements) {
    sb.append(code,lastIndex,replacement.getStartPosition());
    sb.append(replacement.getNewContent());
    lastIndex=replacement.getStartPosition() + replacement.getLength();
  }
  if (lastIndex <= code.length()) {
    sb.append(code,lastIndex,code.length());
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Applies the provided set of code replacements to the code and returns the transformed code. The code replacements may not have any overlap.
 */
public static String applyCodeReplacements(Iterable<CodeReplacement> replacements,String code){
  List<CodeReplacement> sortedReplacements=ORDER_CODE_REPLACEMENTS.sortedCopy(replacements);
  validateNoOverlaps(sortedReplacements);
  StringBuilder sb=new StringBuilder();
  int lastIndex=0;
  for (  CodeReplacement replacement : sortedReplacements) {
    sb.append(code,lastIndex,replacement.getStartPosition());
    sb.append(replacement.getNewContent());
    lastIndex=replacement.getEndPosition();
  }
  if (lastIndex <= code.length()) {
    sb.append(code,lastIndex,code.length());
  }
  return sb.toString();
}
Program: 27322
Project: 27322
Buggy source:
/** 
 * Checks whether the CodeReplacements have any overlap. The replacements must be provided in order sorted by start position, as sorted by ORDER_CODE_REPLACEMENTS.
 */
private static boolean containsOverlaps(List<CodeReplacement> replacements){
  Preconditions.checkState(ORDER_CODE_REPLACEMENTS.isOrdered(replacements));
  int start=-1;
  for (  CodeReplacement replacement : replacements) {
    if (replacement.getStartPosition() < start) {
      return true;
    }
    start=Math.max(start,replacement.getStartPosition() + replacement.getLength());
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether the CodeReplacements have any overlap. The replacements must be provided in order sorted by start position, as sorted by ORDER_CODE_REPLACEMENTS.
 */
private static boolean containsOverlaps(List<CodeReplacement> replacements){
  Preconditions.checkState(ORDER_CODE_REPLACEMENTS.isOrdered(replacements));
  int start=-1;
  for (  CodeReplacement replacement : replacements) {
    if (replacement.getStartPosition() < start) {
      return true;
    }
    start=Math.max(start,replacement.getEndPosition());
  }
  return false;
}
Program: 27323
Project: 27323
Buggy source:
/** 
 * Returns how many bytes the new content should replace in the original content.
 */
public int getLength(){
  return length;
}

Fixed version (ground truth):
/** 
 * Returns how many characters the new content should replace in the original content.
 */
public int getLength(){
  return length;
}
Program: 27327
Project: 27327
Buggy source:
/** 
 * Records that this property could be referenced from any interface that this type, or any type in its superclass chain, implements. If the property p is defined only on a subtype of constructor, then this method has no effect. But we tried modifying getTypeWithProperty to tell us when the returned type is a subtype, and then skip those calls to recordInterface, and there was no speed-up. And it made the code harder to understand, so we don't do it.
 */
private void recordInterfaces(FunctionType constructor,JSType relatedType,DisambiguateProperties.Property p){
  Preconditions.checkArgument(constructor.isConstructor());
  Iterable<ObjectType> interfaces=implementedInterfaces.get(constructor);
  if (interfaces == null) {
    interfaces=constructor.getImplementedInterfaces();
    implementedInterfaces.put(constructor,interfaces);
  }
  for (  ObjectType itype : interfaces) {
    JSType top=getTypeWithProperty(p.name,itype);
    if (top != null) {
      p.addType(itype,relatedType);
    }
    if (p.skipRenaming) {
      return;
    }
  }
}

Fixed version (ground truth):
/** 
 * Records that this property could be referenced from any interface that this type inherits from. If the property p is defined only on a subtype of constructor, then this method has no effect. But we tried modifying getTypeWithProperty to tell us when the returned type is a subtype, and then skip those calls to recordInterface, and there was no speed-up. And it made the code harder to understand, so we don't do it.
 */
private void recordInterfaces(FunctionType constructor,JSType relatedType,Property p){
  Iterable<ObjectType> interfaces=ancestorInterfaces.get(constructor);
  if (interfaces == null) {
    interfaces=constructor.isConstructor() ? constructor.getImplementedInterfaces() : constructor.getExtendedInterfaces();
    ancestorInterfaces.put(constructor,interfaces);
  }
  for (  ObjectType itype : interfaces) {
    JSType top=getTypeWithProperty(p.name,itype);
    if (top != null) {
      p.addType(itype,relatedType);
    }
    if (p.skipRenaming) {
      return;
    }
  }
}
Program: 27328
Project: 27328
Buggy source:
@Override public void process(Node externs,Node root){
  Preconditions.checkState(compiler.getLifeCycleStage() == LifeCycleStage.NORMALIZED);
  this.implementedInterfaces=new HashMap<>();
  this.gtwpCache=new HashMap<>();
  for (  TypeMismatch mis : compiler.getTypeMismatches()) {
    recordInvalidatingType(mis.typeA,mis.src);
    recordInvalidatingType(mis.typeB,mis.src);
  }
  for (  TypeMismatch mis : compiler.getImplicitInterfaceUses()) {
    recordInvalidatingType(mis.typeA,mis.src);
    recordInvalidatingType(mis.typeB,mis.src);
  }
  NodeTraversal.traverseEs6(compiler,externs,new FindExternProperties());
  NodeTraversal.traverseEs6(compiler,root,new FindRenameableProperties());
  renameProperties();
}

Fixed version (ground truth):
@Override public void process(Node externs,Node root){
  Preconditions.checkState(compiler.getLifeCycleStage() == LifeCycleStage.NORMALIZED);
  this.ancestorInterfaces=new HashMap<>();
  this.gtwpCache=new HashMap<>();
  for (  TypeMismatch mis : compiler.getTypeMismatches()) {
    recordInvalidatingType(mis.typeA,mis.src);
    recordInvalidatingType(mis.typeB,mis.src);
  }
  for (  TypeMismatch mis : compiler.getImplicitInterfaceUses()) {
    recordInvalidatingType(mis.typeA,mis.src);
    recordInvalidatingType(mis.typeB,mis.src);
  }
  NodeTraversal.traverseEs6(compiler,externs,new FindExternProperties());
  NodeTraversal.traverseEs6(compiler,root,new FindRenameableProperties());
  renameProperties();
}
Program: 27329
Project: 27329
Buggy source:
private FunctionType getConstructor(JSType type){
  ObjectType objType=ObjectType.cast(type);
  if (objType == null) {
    return null;
  }
  FunctionType constructor=null;
  if (objType.isFunctionType()) {
    constructor=objType.toMaybeFunctionType();
  }
 else   if (objType.isFunctionPrototypeType()) {
    constructor=objType.getOwnerFunction();
  }
 else {
    constructor=objType.getConstructor();
  }
  return constructor != null && constructor.isConstructor() ? constructor : null;
}

Fixed version (ground truth):
private FunctionType getConstructor(JSType type){
  ObjectType objType=ObjectType.cast(type);
  if (objType == null) {
    return null;
  }
  FunctionType constructor=null;
  if (objType.isFunctionType()) {
    constructor=objType.toMaybeFunctionType();
  }
 else   if (objType.isFunctionPrototypeType()) {
    constructor=objType.getOwnerFunction();
  }
 else {
    constructor=objType.getConstructor();
  }
  return constructor;
}
Program: 27330
Project: 27330
Buggy source:
/** 
 * Returns the alternatives if this is a type that represents multiple types, and null if not. Union and interface types can correspond to multiple other types.
 */
private Iterable<JSType> getTypeAlternatives(JSType type){
  if (type.isUnionType()) {
    return type.toMaybeUnionType().getAlternatesWithoutStructuralTyping();
  }
 else {
    ObjectType objType=type.toObjectType();
    if (objType != null && objType.getConstructor() != null && objType.getConstructor().isInterface()) {
      List<JSType> list=new ArrayList<>();
      for (      FunctionType impl : registry.getDirectImplementors(objType)) {
        list.add(impl.getInstanceType());
      }
      return list;
    }
 else {
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Returns the alternatives if this is a type that represents multiple types, and null if not. Union and interface types can correspond to multiple other types.
 */
private Iterable<JSType> getTypeAlternatives(JSType type){
  if (type.isUnionType()) {
    return type.toMaybeUnionType().getAlternatesWithoutStructuralTyping();
  }
 else {
    ObjectType objType=type.toObjectType();
    if (objType != null && objType.getConstructor() != null && objType.getConstructor().isInterface()) {
      List<JSType> list=new ArrayList<>();
      for (      FunctionType impl : registry.getDirectImplementors(objType)) {
        list.add(impl.getInstanceType());
      }
      return list.isEmpty() ? null : list;
    }
 else {
      return null;
    }
  }
}
Program: 27331
Project: 27331
Buggy source:
/** 
 * Traverse a node and its children and remove any references to from the structures.
 */
void removeReferences(Node node){
  if (DefinitionsRemover.isDefinitionNode(node)) {
    DefinitionSite defSite=definitionNodeByDefinitionSite.get(node);
    if (defSite != null) {
      Definition def=defSite.definition;
      String name=getSimplifiedName(def.getLValue());
      if (name != null) {
        this.definitionNodeByDefinitionSite.remove(node);
        this.nameDefinitionMultimap.remove(name,node);
      }
    }
  }
 else {
    Node useSite=node;
    if (useSite.isGetProp()) {
      String propName=useSite.getLastChild().getString();
      if (propName.equals("String_Node_Str") || propName.equals("String_Node_Str")) {
        useSite=useSite.getFirstChild();
      }
    }
    String name=getSimplifiedName(useSite);
    if (name != null) {
      this.nameUseSiteMultimap.remove(name,new UseSite(useSite,null,null));
    }
  }
  for (  Node child : node.children()) {
    removeReferences(child);
  }
}

Fixed version (ground truth):
/** 
 * Traverse a node and its children and remove any references to from the structures.
 */
void removeReferences(Node node){
  if (DefinitionsRemover.isDefinitionNode(node)) {
    DefinitionSite defSite=definitionNodeByDefinitionSite.get(node);
    if (defSite != null) {
      Definition def=defSite.definition;
      String name=getSimplifiedName(def.getLValue());
      if (name != null) {
        this.definitionNodeByDefinitionSite.remove(node);
        this.nameDefinitionMultimap.remove(name,def);
      }
    }
  }
 else {
    Node useSite=node;
    if (useSite.isGetProp()) {
      String propName=useSite.getLastChild().getString();
      if (propName.equals("String_Node_Str") || propName.equals("String_Node_Str")) {
        useSite=useSite.getFirstChild();
      }
    }
    String name=getSimplifiedName(useSite);
    if (name != null) {
      this.nameUseSiteMultimap.remove(name,new UseSite(useSite,null,null));
    }
  }
  for (  Node child : node.children()) {
    removeReferences(child);
  }
}
Program: 27333
Project: 27333
Buggy source:
public static RawNominalType makeStructuralInterface(JSTypes commonTypes,Node defSite,String name,ImmutableList<String> typeParameters){
  return new RawNominalType(commonTypes,defSite,name,typeParameters,Kind.RECORD,ObjectKind.UNRESTRICTED);
}

Fixed version (ground truth):
public static RawNominalType makeStructuralInterface(JSTypes commonTypes,Node defSite,String name,ImmutableList<String> typeParameters,ObjectKind objKind){
  if (objKind == ObjectKind.DICT) {
    objKind=ObjectKind.UNRESTRICTED;
  }
  return new RawNominalType(commonTypes,defSite,name,typeParameters,Kind.RECORD,objKind);
}
Program: 27334
Project: 27334
Buggy source:
public static RawNominalType makeNominalInterface(JSTypes commonTypes,Node defSite,String name,ImmutableList<String> typeParameters){
  return new RawNominalType(commonTypes,defSite,name,typeParameters,Kind.INTERFACE,ObjectKind.UNRESTRICTED);
}

Fixed version (ground truth):
public static RawNominalType makeNominalInterface(JSTypes commonTypes,Node defSite,String name,ImmutableList<String> typeParameters,ObjectKind objKind){
  if (objKind == ObjectKind.DICT) {
    objKind=ObjectKind.UNRESTRICTED;
  }
  return new RawNominalType(commonTypes,defSite,name,typeParameters,Kind.INTERFACE,objKind);
}
Program: 27335
Project: 27335
Buggy source:
public void testMisplacedStructDictAnnotation(){
  typeCheck("String_Node_Str",GlobalTypeInfo.STRUCTDICT_WITHOUT_CTOR);
  typeCheck("String_Node_Str",GlobalTypeInfo.STRUCTDICT_WITHOUT_CTOR);
}

Fixed version (ground truth):
public void testMisplacedStructDictAnnotation(){
  typeCheck("String_Node_Str",GlobalTypeInfo.STRUCT_WITHOUT_CTOR_OR_INTERF);
  typeCheck("String_Node_Str",GlobalTypeInfo.DICT_WITHOUT_CTOR);
  typeCheck("String_Node_Str",GlobalTypeInfo.DICT_WITHOUT_CTOR);
}
Program: 27337
Project: 27337
Buggy source:
static ObjectType join(ObjectType obj1,ObjectType obj2){
  if (obj1.isTopObject() || obj2.isTopObject()) {
    return obj1.commonTypes.TOP_OBJECTTYPE;
  }
  NominalType nom1=obj1.nominalType;
  NominalType nom2=obj2.nominalType;
  Preconditions.checkState(nom1 == null || nom2 == null || nom1.isRawSubtypeOf(nom2) || nom2.isRawSubtypeOf(nom1));
  if (obj1.equals(obj2)) {
    return obj1;
  }
  JSTypes commonTypes=obj1.commonTypes;
  boolean isLoose=obj1.isLoose || obj2.isLoose;
  FunctionType fn=FunctionType.join(obj1.fn,obj2.fn);
  PersistentMap<String,Property> props;
  if (isLoose) {
    fn=fn == null ? null : fn.withLoose();
    props=joinPropsLoosely(commonTypes,obj1.props,obj2.props);
  }
 else {
    props=joinProps(obj1.props,obj2.props,nom1,nom2);
  }
  NominalType nominal=NominalType.pickSuperclass(nom1,nom2);
  if (nominal == null || !nominal.isFunction()) {
    fn=null;
  }
  Namespace ns=Objects.equals(obj1.ns,obj2.ns) ? obj1.ns : null;
  return makeObjectType(commonTypes,nominal,props,fn,ns,isLoose,ObjectKind.join(obj1.objectKind,obj2.objectKind));
}

Fixed version (ground truth):
static ObjectType join(ObjectType obj1,ObjectType obj2){
  if ((obj1.isTopObject() && obj2.props.isEmpty()) || (obj2.isTopObject() && obj1.props.isEmpty())) {
    return obj1.commonTypes.TOP_OBJECTTYPE;
  }
  NominalType nom1=obj1.nominalType;
  NominalType nom2=obj2.nominalType;
  Preconditions.checkState(nom1 == null || nom2 == null || nom1.isRawSubtypeOf(nom2) || nom2.isRawSubtypeOf(nom1));
  if (obj1.equals(obj2)) {
    return obj1;
  }
  JSTypes commonTypes=obj1.commonTypes;
  boolean isLoose=obj1.isLoose || obj2.isLoose;
  FunctionType fn=FunctionType.join(obj1.fn,obj2.fn);
  PersistentMap<String,Property> props;
  if (isLoose) {
    fn=fn == null ? null : fn.withLoose();
    props=joinPropsLoosely(commonTypes,obj1.props,obj2.props);
  }
 else {
    props=joinProps(obj1.props,obj2.props,nom1,nom2);
  }
  NominalType nominal=NominalType.pickSuperclass(nom1,nom2);
  if (nominal == null || !nominal.isFunction()) {
    fn=null;
  }
  Namespace ns=Objects.equals(obj1.ns,obj2.ns) ? obj1.ns : null;
  return makeObjectType(commonTypes,nominal,props,fn,ns,isLoose,ObjectKind.join(obj1.objectKind,obj2.objectKind));
}
Program: 27338
Project: 27338
Buggy source:
public void testJoinWithTopObject(){
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void testJoinWithTopObject(){
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str"));
  typeCheck(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}
Program: 27339
Project: 27339
Buggy source:
public void testDoWhileLoopBranch() throws Exception {
  compareDoWhileLoopBranch(LanguageMode.ECMASCRIPT6);
}

Fixed version (ground truth):
public void testDoWhileLoopBranch() throws Exception {
  compareDoWhileLoopBranch(LanguageMode.ECMASCRIPT5);
  compareDoWhileLoopBranch(LanguageMode.ECMASCRIPT6);
}
Program: 27340
Project: 27340
Buggy source:
public void testDoWhileLoopMultiLineBranch() throws Exception {
  compareDoWhileLoopBranch(LanguageMode.ECMASCRIPT6);
}

Fixed version (ground truth):
public void testDoWhileLoopMultiLineBranch() throws Exception {
  compareDoWhileLoopMultiLineBranch(LanguageMode.ECMASCRIPT5);
  compareDoWhileLoopMultiLineBranch(LanguageMode.ECMASCRIPT6);
}
Program: 27341
Project: 27341
Buggy source:
@Override public final void visit(NodeTraversal nodeTraversal,Node n,Node parent){
  if (n.isCall() && parent.isExprResult() && n.getFirstChild().matchesQualifiedName(closureFunction)) {
    calls.add(parent);
  }
 else   if (NodeUtil.isNameDeclaration(parent) && n.getLastChild().getFirstChild().matchesQualifiedName(closureFunction)) {
    Preconditions.checkState(n.isName() || n.isDestructuringLhs());
    calls.add(parent);
  }
}

Fixed version (ground truth):
@Override public final void visit(NodeTraversal nodeTraversal,Node n,Node parent){
  if (n.isCall() && parent.isExprResult() && n.getFirstChild().matchesQualifiedName(closureFunction)) {
    calls.add(parent);
  }
 else   if (NodeUtil.isNameDeclaration(parent) && n.hasChildren() && n.getLastChild().isCall()&& n.getLastChild().getFirstChild().matchesQualifiedName(closureFunction)) {
    Preconditions.checkState(n.isName() || n.isDestructuringLhs());
    calls.add(parent);
  }
}
Program: 27342
Project: 27342
Buggy source:
/** 
 * Normalize the type of a constructor, its instance, and its prototype all down to the same type (the instance type).
 */
private static TypeI normalizeClassType(TypeI type){
  if (type == null || type.isUnknownType()) {
    return type;
  }
 else   if (type.isConstructor() || type.isInterface()) {
    return type.toMaybeFunctionType().getInstanceType();
  }
 else   if (type.isPrototypeObject()) {
    Preconditions.checkState(type instanceof ObjectType);
    FunctionType owner=((ObjectType)type).getOwnerFunction();
    if (owner.isConstructor()) {
      return owner.getInstanceType();
    }
  }
  return type;
}

Fixed version (ground truth):
/** 
 * Normalize the type of a constructor, its instance, and its prototype all down to the same type (the instance type).
 */
private static TypeI normalizeClassType(TypeI type){
  if (type == null || type.isUnknownType()) {
    return type;
  }
 else   if (type.isConstructor() || type.isInterface()) {
    return type.toMaybeFunctionType().getInstanceType();
  }
 else {
    ObjectTypeI obj=type.toMaybeObjectType();
    if (obj != null) {
      return obj.normalizeObjectForCheckAccessControls();
    }
  }
  return type;
}
Program: 27343
Project: 27343
Buggy source:
private void fixLineNumbers(Node expr){
  expr.setLineno(expr.getLineno() + templateLineno - 1);
  for (  Node child : expr.children()) {
    fixLineNumbers(child);
  }
}

Fixed version (ground truth):
private void fixLineNumbers(Node expr){
  expr.setLineno(expr.getLineno() + templateLineno);
  for (  Node child : expr.children()) {
    fixLineNumbers(child);
  }
}
Program: 27345
Project: 27345
Buggy source:
protected CodeGenerator(CodeConsumer consumer,CompilerOptions options){
  cc=consumer;
  this.outputCharsetEncoder=new OutputCharsetEncoder(options.getOutputCharset());
  this.preferSingleQuotes=options.preferSingleQuotes;
  this.trustedStrings=options.trustedStrings;
  this.preserveTypeAnnotations=options.preserveTypeAnnotations;
  this.quoteKeywordProperties=options.quoteKeywordProperties;
  this.outputAsExterns=options.shouldGenerateTypedExterns();
  this.useOriginalName=options.getUseOriginalNamesInOutput();
}

Fixed version (ground truth):
protected CodeGenerator(CodeConsumer consumer,CompilerOptions options){
  cc=consumer;
  this.outputCharsetEncoder=new OutputCharsetEncoder(options.getOutputCharset());
  this.preferSingleQuotes=options.preferSingleQuotes;
  this.trustedStrings=options.trustedStrings;
  this.preserveTypeAnnotations=options.preserveTypeAnnotations;
  this.quoteKeywordProperties=options.quoteKeywordProperties;
  this.outputAsExterns=options.shouldGenerateTypedExterns();
  this.useOriginalName=options.getUseOriginalNamesInOutput();
  this.jsDocInfoPrinter=new JSDocInfoPrinter(useOriginalName);
}
Program: 27346
Project: 27346
Buggy source:
private static String buildAnnotationWithType(String annotation,Node type){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(annotation);
  sb.append("String_Node_Str");
  appendTypeNode(sb,type);
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
private String buildAnnotationWithType(String annotation,Node type){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(annotation);
  sb.append("String_Node_Str");
  appendTypeNode(sb,type);
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 27347
Project: 27347
Buggy source:
private static String typeNode(Node typeNode){
  StringBuilder sb=new StringBuilder();
  appendTypeNode(sb,typeNode);
  return sb.toString();
}

Fixed version (ground truth):
private String typeNode(Node typeNode){
  StringBuilder sb=new StringBuilder();
  appendTypeNode(sb,typeNode);
  return sb.toString();
}
Program: 27349
Project: 27349
Buggy source:
private static Node stripBang(Node typeNode){
  if (typeNode.getToken() == Token.BANG) {
    typeNode=typeNode.getFirstChild();
  }
  return typeNode;
}

Fixed version (ground truth):
private Node stripBang(Node typeNode){
  if (typeNode.getToken() == Token.BANG) {
    typeNode=typeNode.getFirstChild();
  }
  return typeNode;
}
Program: 27350
Project: 27350
Buggy source:
private static String buildParamType(String name,JSTypeExpression type){
  if (type != null) {
    return "String_Node_Str" + typeNode(type.getRoot()) + "String_Node_Str"+ name;
  }
 else {
    return name;
  }
}

Fixed version (ground truth):
private String buildParamType(String name,JSTypeExpression type){
  if (type != null) {
    return "String_Node_Str" + typeNode(type.getRoot()) + "String_Node_Str"+ name;
  }
 else {
    return name;
  }
}
Program: 27351
Project: 27351
Buggy source:
private static void appendFunctionNode(StringBuilder sb,Node function){
  boolean hasNewOrThis=false;
  sb.append("String_Node_Str");
  Node first=function.getFirstChild();
  if (first.isNew()) {
    sb.append("String_Node_Str");
    appendTypeNode(sb,first.getFirstChild());
    hasNewOrThis=true;
  }
 else   if (first.isThis()) {
    sb.append("String_Node_Str");
    appendTypeNode(sb,first.getFirstChild());
    hasNewOrThis=true;
  }
 else   if (first.isEmpty()) {
    sb.append("String_Node_Str");
    return;
  }
 else   if (!first.isParamList()) {
    sb.append("String_Node_Str");
    appendTypeNode(sb,first);
    return;
  }
  Node paramList=null;
  if (first.isParamList()) {
    paramList=first;
  }
 else   if (first.getNext().isParamList()) {
    paramList=first.getNext();
  }
  if (paramList != null) {
    boolean firstParam=true;
    for (    Node param : paramList.children()) {
      if (!firstParam || hasNewOrThis) {
        sb.append("String_Node_Str");
      }
      appendTypeNode(sb,param);
      firstParam=false;
    }
  }
  sb.append("String_Node_Str");
  Node returnType=function.getLastChild();
  if (!returnType.isEmpty()) {
    sb.append("String_Node_Str");
    appendTypeNode(sb,returnType);
  }
}

Fixed version (ground truth):
private void appendFunctionNode(StringBuilder sb,Node function){
  boolean hasNewOrThis=false;
  sb.append("String_Node_Str");
  Node first=function.getFirstChild();
  if (first.isNew()) {
    sb.append("String_Node_Str");
    appendTypeNode(sb,first.getFirstChild());
    hasNewOrThis=true;
  }
 else   if (first.isThis()) {
    sb.append("String_Node_Str");
    appendTypeNode(sb,first.getFirstChild());
    hasNewOrThis=true;
  }
 else   if (first.isEmpty()) {
    sb.append("String_Node_Str");
    return;
  }
 else   if (!first.isParamList()) {
    sb.append("String_Node_Str");
    appendTypeNode(sb,first);
    return;
  }
  Node paramList=null;
  if (first.isParamList()) {
    paramList=first;
  }
 else   if (first.getNext().isParamList()) {
    paramList=first.getNext();
  }
  if (paramList != null) {
    boolean firstParam=true;
    for (    Node param : paramList.children()) {
      if (!firstParam || hasNewOrThis) {
        sb.append("String_Node_Str");
      }
      appendTypeNode(sb,param);
      firstParam=false;
    }
  }
  sb.append("String_Node_Str");
  Node returnType=function.getLastChild();
  if (!returnType.isEmpty()) {
    sb.append("String_Node_Str");
    appendTypeNode(sb,returnType);
  }
}
Program: 27353
Project: 27353
Buggy source:
private void fixTypeNode(Node typeNode){
  if (typeNode.isString()) {
    String name=typeNode.getString();
    int endIndex=name.indexOf('.');
    if (endIndex == -1) {
      endIndex=name.length();
    }
    String baseName=name.substring(0,endIndex);
    Var aliasVar=aliases.get(baseName);
    if (aliasVar != null) {
      aliasUsages.add(new AliasedTypeNode(aliasVar,typeNode));
    }
  }
  for (Node child=typeNode.getFirstChild(); child != null; child=child.getNext()) {
    fixTypeNode(child);
  }
}

Fixed version (ground truth):
private void fixTypeNode(Node typeNode){
  if (typeNode.isString()) {
    String name=typeNode.getString();
    int endIndex=name.indexOf('.');
    if (endIndex == -1) {
      endIndex=name.length();
    }
    String baseName=name.substring(0,endIndex);
    Var aliasVar=aliases.get(baseName);
    if (aliasVar != null) {
      aliasUsages.add(new AliasedTypeNode(aliasVar,typeNode));
    }
    if (compiler.getOptions().preservesDetailedSourceInfo()) {
      typeNode.setOriginalName(name);
    }
  }
  for (Node child=typeNode.getFirstChild(); child != null; child=child.getNext()) {
    fixTypeNode(child);
  }
}
Program: 27354
Project: 27354
Buggy source:
@Override public void visit(NodeTraversal t,Node n,Node parent){
  if (isCallToScopeMethod(n)) {
    validateScopeCall(t,n,n.getParent());
  }
  if (!inGoogScopeBody()) {
    return;
  }
  Token type=n.getToken();
  boolean isObjLitShorthand=type == Token.STRING_KEY && !n.hasChildren();
  Var aliasVar=null;
  if (type == Token.NAME || isObjLitShorthand) {
    String name=n.getString();
    Var lexicalVar=t.getScope().getVar(name);
    if (lexicalVar != null && lexicalVar == aliases.get(name)) {
      aliasVar=lexicalVar;
    }
  }
  if (isGoogScopeFunctionBody(t.getEnclosingFunction().getLastChild())) {
    if (aliasVar != null && !isObjLitShorthand && NodeUtil.isLValue(n)) {
      if (aliasVar.getNode() == n) {
        aliasDefinitionsInOrder.add(n);
        return;
      }
 else {
        report(t,n,GOOG_SCOPE_ALIAS_REDEFINED,n.getString());
      }
    }
    if (type == Token.RETURN) {
      report(t,n,GOOG_SCOPE_USES_RETURN);
    }
 else     if (type == Token.THIS) {
      report(t,n,GOOG_SCOPE_REFERENCES_THIS);
    }
 else     if (type == Token.THROW) {
      report(t,n,GOOG_SCOPE_USES_THROW);
    }
  }
  if (inGoogScopeBody()) {
    if (aliasVar != null) {
      aliasUsages.add(new AliasedNode(aliasVar,n));
    }
    JSDocInfo info=n.getJSDocInfo();
    if (info != null && !injectedDecls.contains(n)) {
      for (      Node node : info.getTypeNodes()) {
        fixTypeNode(node);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void visit(NodeTraversal t,Node n,Node parent){
  if (isCallToScopeMethod(n)) {
    validateScopeCall(t,n,n.getParent());
  }
  if (!inGoogScopeBody()) {
    return;
  }
  Token type=n.getToken();
  boolean isObjLitShorthand=type == Token.STRING_KEY && !n.hasChildren();
  Var aliasVar=null;
  if (type == Token.NAME || isObjLitShorthand) {
    String name=n.getString();
    Var lexicalVar=t.getScope().getVar(name);
    if (lexicalVar != null && lexicalVar == aliases.get(name)) {
      aliasVar=lexicalVar;
      if (compiler.getOptions().preservesDetailedSourceInfo() && n.isName()) {
        n.setOriginalName(name);
      }
    }
  }
  if (isGoogScopeFunctionBody(t.getEnclosingFunction().getLastChild())) {
    if (aliasVar != null && !isObjLitShorthand && NodeUtil.isLValue(n)) {
      if (aliasVar.getNode() == n) {
        aliasDefinitionsInOrder.add(n);
        return;
      }
 else {
        report(t,n,GOOG_SCOPE_ALIAS_REDEFINED,n.getString());
      }
    }
    if (type == Token.RETURN) {
      report(t,n,GOOG_SCOPE_USES_RETURN);
    }
 else     if (type == Token.THIS) {
      report(t,n,GOOG_SCOPE_REFERENCES_THIS);
    }
 else     if (type == Token.THROW) {
      report(t,n,GOOG_SCOPE_USES_THROW);
    }
  }
  if (inGoogScopeBody()) {
    if (aliasVar != null) {
      aliasUsages.add(new AliasedNode(aliasVar,n));
    }
    JSDocInfo info=n.getJSDocInfo();
    if (info != null && !injectedDecls.contains(n)) {
      for (      Node node : info.getTypeNodes()) {
        fixTypeNode(node);
      }
    }
  }
}
Program: 27355
Project: 27355
Buggy source:
@Override protected void add(Node n,Context context){
  Node parent=n.getParent();
  if (parent != null && (parent.isBlock() || parent.isScript())) {
    if (n.isFunction()) {
      add(getFunctionAnnotation(n));
    }
 else     if (n.isExprResult() && n.getFirstChild().isAssign()) {
      Node assign=n.getFirstChild();
      if (NodeUtil.isNamespaceDecl(assign.getFirstChild())) {
        add(JSDocInfoPrinter.print(assign.getJSDocInfo()));
      }
 else {
        Node rhs=assign.getLastChild();
        add(getTypeAnnotation(rhs));
      }
    }
 else     if (n.isVar() && n.getFirstFirstChild() != null) {
      if (NodeUtil.isNamespaceDecl(n.getFirstChild())) {
        add(JSDocInfoPrinter.print(n.getJSDocInfo()));
      }
 else {
        add(getTypeAnnotation(n.getFirstFirstChild()));
      }
    }
  }
  super.add(n,context);
}

Fixed version (ground truth):
@Override protected void add(Node n,Context context){
  Node parent=n.getParent();
  if (parent != null && (parent.isBlock() || parent.isScript())) {
    if (n.isFunction()) {
      add(getFunctionAnnotation(n));
    }
 else     if (n.isExprResult() && n.getFirstChild().isAssign()) {
      Node assign=n.getFirstChild();
      if (NodeUtil.isNamespaceDecl(assign.getFirstChild())) {
        add(jsDocInfoPrinter.print(assign.getJSDocInfo()));
      }
 else {
        Node rhs=assign.getLastChild();
        add(getTypeAnnotation(rhs));
      }
    }
 else     if (n.isVar() && n.getFirstFirstChild() != null) {
      if (NodeUtil.isNamespaceDecl(n.getFirstChild())) {
        add(jsDocInfoPrinter.print(n.getJSDocInfo()));
      }
 else {
        add(getTypeAnnotation(n.getFirstFirstChild()));
      }
    }
  }
  super.add(n,context);
}
Program: 27356
Project: 27356
Buggy source:
TypedCodeGenerator(CodeConsumer consumer,CompilerOptions options,TypeIRegistry registry){
  super(consumer,options);
  Preconditions.checkNotNull(registry);
  this.registry=registry;
}

Fixed version (ground truth):
TypedCodeGenerator(CodeConsumer consumer,CompilerOptions options,TypeIRegistry registry){
  super(consumer,options);
  Preconditions.checkNotNull(registry);
  this.registry=registry;
  this.jsDocInfoPrinter=new JSDocInfoPrinter(options.getUseOriginalNamesInOutput());
}
Program: 27357
Project: 27357
Buggy source:
private ParseTree parseCoverParenthesizedExpressionAndArrowParameterList(){
  if (peekType(1) == TokenType.FOR) {
    return parseGeneratorComprehension();
  }
  SourcePosition start=getTreeStartLocation();
  eat(TokenType.OPEN_PAREN);
  if (peek(TokenType.CLOSE_PAREN)) {
    eat(TokenType.CLOSE_PAREN);
    return new FormalParameterListTree(getTreeLocation(start),ImmutableList.<ParseTree>of());
  }
  if (peek(TokenType.SPREAD)) {
    ParseTree result=new FormalParameterListTree(getTreeLocation(start),ImmutableList.of(parseParameter(ParamContext.IMPLEMENTATION)));
    eat(TokenType.CLOSE_PAREN);
    return result;
  }
  ParseTree result=parseExpression();
  if (peek(TokenType.COMMA)) {
    eat(TokenType.COMMA);
    result=new CommaExpressionTree(getTreeLocation(start),ImmutableList.of(result,parseParameter(ParamContext.IMPLEMENTATION)));
  }
  eat(TokenType.CLOSE_PAREN);
  return new ParenExpressionTree(getTreeLocation(start),result);
}

Fixed version (ground truth):
private ParseTree parseCoverParenthesizedExpressionAndArrowParameterList(){
  if (peekType(1) == TokenType.FOR) {
    return parseGeneratorComprehension();
  }
  SourcePosition start=getTreeStartLocation();
  eat(TokenType.OPEN_PAREN);
  if (peek(TokenType.CLOSE_PAREN)) {
    eat(TokenType.CLOSE_PAREN);
    if (peek(TokenType.ARROW)) {
      return new FormalParameterListTree(getTreeLocation(start),ImmutableList.<ParseTree>of());
    }
 else {
      reportError("String_Node_Str");
      return new MissingPrimaryExpressionTree(getTreeLocation(start));
    }
  }
  if (peek(TokenType.SPREAD)) {
    ImmutableList<ParseTree> params=ImmutableList.of(parseParameter(ParamContext.IMPLEMENTATION));
    eat(TokenType.CLOSE_PAREN);
    if (peek(TokenType.ARROW)) {
      return new FormalParameterListTree(getTreeLocation(start),params);
    }
 else {
      reportError("String_Node_Str");
      return new MissingPrimaryExpressionTree(getTreeLocation(start));
    }
  }
  ParseTree result=parseExpression();
  if (peek(TokenType.COMMA)) {
    eat(TokenType.COMMA);
    result=new CommaExpressionTree(getTreeLocation(start),ImmutableList.of(result,parseParameter(ParamContext.IMPLEMENTATION)));
  }
  eat(TokenType.CLOSE_PAREN);
  return new ParenExpressionTree(getTreeLocation(start),result);
}
Program: 27358
Project: 27358
Buggy source:
private ParseTree parseAssignment(Expression expressionIn){
  if (peek(TokenType.YIELD) && inGeneratorContext()) {
    return parseYield(expressionIn);
  }
  SourcePosition start=getTreeStartLocation();
  ParseTree left=parseConditional(expressionIn);
  if (peek(TokenType.ARROW)) {
    return completeAssignmentExpressionParseAtArrow(left,expressionIn);
  }
  if (left.type == ParseTreeType.FORMAL_PARAMETER_LIST) {
    reportError("String_Node_Str");
  }
  if (peekAssignmentOperator()) {
    left=transformLeftHandSideExpression(left);
    if (!left.isValidAssignmentTarget()) {
      reportError("String_Node_Str");
    }
    Token operator=nextToken();
    if (TokenType.STAR_STAR_EQUAL.equals(operator.type)) {
      features=features.require(Feature.EXPONENT_OP);
    }
    ParseTree right=parseAssignment(expressionIn);
    return new BinaryOperatorTree(getTreeLocation(start),left,operator,right);
  }
  return left;
}

Fixed version (ground truth):
private ParseTree parseAssignment(Expression expressionIn){
  if (peek(TokenType.YIELD) && inGeneratorContext()) {
    return parseYield(expressionIn);
  }
  SourcePosition start=getTreeStartLocation();
  ParseTree left=parseConditional(expressionIn);
  if (peek(TokenType.ARROW)) {
    return completeAssignmentExpressionParseAtArrow(left,expressionIn);
  }
  if (peekAssignmentOperator()) {
    left=transformLeftHandSideExpression(left);
    if (!left.isValidAssignmentTarget()) {
      reportError("String_Node_Str");
    }
    Token operator=nextToken();
    if (TokenType.STAR_STAR_EQUAL.equals(operator.type)) {
      features=features.require(Feature.EXPONENT_OP);
    }
    ParseTree right=parseAssignment(expressionIn);
    return new BinaryOperatorTree(getTreeLocation(start),left,operator,right);
  }
  return left;
}
Program: 27359
Project: 27359
Buggy source:
@Override public boolean isUnresolved(){
  return isUnknown();
}

Fixed version (ground truth):
@Override public boolean isUnresolved(){
  return false;
}
Program: 27360
Project: 27360
Buggy source:
public void testCustomBanUnresolvedType(){
  configuration="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  this.mode=TypeInferenceMode.OTI_ONLY;
  testSame(EXTERNS,"String_Node_Str" + "String_Node_Str",CheckConformance.CONFORMANCE_VIOLATION,"String_Node_Str");
}

Fixed version (ground truth):
public void testCustomBanUnresolvedType(){
  configuration="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  this.mode=TypeInferenceMode.OTI_ONLY;
  testSame(EXTERNS,"String_Node_Str" + "String_Node_Str",CheckConformance.CONFORMANCE_VIOLATION,"String_Node_Str");
  this.mode=TypeInferenceMode.BOTH;
  testSame(LINE_JOINER.join("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}