nus-yam/ex-repair huggingface dataset:
Program: 84165
Project: 84165
Buggy source:
@Override public void writeInnerClassInfo(ClassWriter writer){
  if (this.enclosingClass != null) {
    int modifiers=this.modifiers.toFlags() & 0x761F;
    if ((modifiers & Modifiers.INTERFACE_CLASS) != Modifiers.INTERFACE_CLASS) {
      modifiers|=Modifiers.STATIC;
    }
 else {
      modifiers&=~Modifiers.STATIC;
    }
    final String outerName=this.enclosingClass.getInternalName();
    writer.visitInnerClass(this.getInternalName(),outerName,this.name.qualified,modifiers);
    writer.visitOuterClass(outerName,null,null);
  }
}

Fixed version (ground truth):
@Override public void writeInnerClassInfo(ClassWriter writer){
  if (this.enclosingClass != null) {
    int modifiers=this.modifiers.toFlags() & 0x761F;
    if ((modifiers & Modifiers.INTERFACE_CLASS) != Modifiers.INTERFACE_CLASS) {
      modifiers|=Modifiers.STATIC;
    }
 else {
      modifiers&=~Modifiers.STATIC;
    }
    final String outerName=this.enclosingClass.getInternalName();
    writer.visitInnerClass(this.getInternalName(),outerName,this.name.qualified,modifiers);
  }
}
Program: 84166
Project: 84166
Buggy source:
protected void writeField(ClassWriter writer,int modifiers,String name,String descriptor){
  final String signature=this.type.needsSignature() ? this.getSignature() : null;
  final Object value;
  if (this.value != null && this.hasModifier(Modifiers.STATIC) && this.hasConstantValue()) {
    value=this.value.toObject();
  }
 else {
    value=null;
  }
  final FieldVisitor fieldVisitor=writer.visitField(modifiers,name,descriptor,signature,value);
  IField.writeAnnotations(fieldVisitor,this.modifiers,this.annotations,this.type);
  fieldVisitor.visitEnd();
}

Fixed version (ground truth):
protected void writeField(ClassWriter writer,int modifiers,String name,String descriptor){
  final String signature=this.getType().needsSignature() ? this.getSignature() : null;
  final Object value;
  if (this.value != null && this.hasModifier(Modifiers.STATIC) && this.hasConstantValue()) {
    value=this.value.toObject();
  }
 else {
    value=null;
  }
  final FieldVisitor fieldVisitor=writer.visitField(modifiers,name,descriptor,signature,value);
  IField.writeAnnotations(fieldVisitor,this.modifiers,this.annotations,this.type);
  fieldVisitor.visitEnd();
}
Program: 84167
Project: 84167
Buggy source:
private RetentionPolicy getRetention(){
  return this.type.getTheClass().getMetadata().getRetention();
}

Fixed version (ground truth):
private RetentionPolicy getRetention(){
  final IClass type=this.type.getTheClass();
  return type == null ? null : type.getMetadata().getRetention();
}
Program: 84168
Project: 84168
Buggy source:
private IType resolveTopLevelWith(MarkerList markers,IContext context){
  final IClass theClass=context.resolveClass(this.name);
  if (theClass != null) {
    final IType classType=theClass.getThisType();
    return this.checkCount(markers,theClass,"String_Node_Str",classType);
  }
  final ITypeParameter typeParameter=context.resolveTypeParameter(this.name);
  if (typeParameter != null) {
    markers.add(Markers.semanticError(this.position,"String_Node_Str",typeParameter.getName()));
    return new ResolvedTypeVarType(typeParameter,this.position);
  }
  final ITypeAlias typeAlias=context.resolveTypeAlias(this.name,this.typeArgumentCount);
  if (typeAlias != null) {
    final IType type=typeAlias.getType();
    return this.checkCount(markers,typeAlias,"String_Node_Str",type);
  }
  return null;
}

Fixed version (ground truth):
private IType resolveTopLevelWith(MarkerList markers,IContext context){
  final IClass theClass=context.resolveClass(this.name);
  if (theClass != null) {
    final IType classType=theClass.getThisType();
    return this.checkCount(markers,theClass,"String_Node_Str",classType);
  }
  final ITypeParameter typeParameter=context.resolveTypeParameter(this.name);
  if (typeParameter != null) {
    markers.add(Markers.semanticError(this.position,"String_Node_Str",typeParameter.getName()));
    return new ResolvedTypeVarType(typeParameter,this.position);
  }
  final ITypeAlias typeAlias=context.resolveTypeAlias(this.name,this.typeArgumentCount);
  if (typeAlias != null) {
    final IType aliasType=typeAlias.getType();
    if (!aliasType.isResolved()) {
      markers.add(Markers.semanticError(this.position,"String_Node_Str",this.name));
      return aliasType.atPosition(this.position);
    }
    return this.checkCount(markers,typeAlias,"String_Node_Str",aliasType);
  }
  return null;
}
Program: 84169
Project: 84169
Buggy source:
private IType resolveTopLevelWith(@SuppressWarnings("String_Node_Str") MarkerList markers,IContext context){
  final IClass theClass=context.resolveClass(this.name);
  if (theClass != null) {
    return new ResolvedClassType(theClass,this.position);
  }
  final ITypeParameter typeParameter=context.resolveTypeParameter(this.name);
  if (typeParameter != null) {
    return new ResolvedTypeVarType(typeParameter,this.position);
  }
  final ITypeAlias type=context.resolveTypeAlias(this.name,0);
  if (type != null) {
    return type.getType().getConcreteType(ITypeContext.DEFAULT).atPosition(this.position);
  }
  return null;
}

Fixed version (ground truth):
private IType resolveTopLevelWith(@SuppressWarnings("String_Node_Str") MarkerList markers,IContext context){
  final IClass theClass=context.resolveClass(this.name);
  if (theClass != null) {
    return new ResolvedClassType(theClass,this.position);
  }
  final ITypeParameter typeParameter=context.resolveTypeParameter(this.name);
  if (typeParameter != null) {
    return new ResolvedTypeVarType(typeParameter,this.position);
  }
  final ITypeAlias type=context.resolveTypeAlias(this.name,0);
  if (type != null) {
    final IType aliasType=type.getType();
    if (!aliasType.isResolved()) {
      markers.add(Markers.semanticError(this.position,"String_Node_Str",this.name));
      return aliasType.atPosition(this.position);
    }
    return aliasType.getConcreteType(ITypeContext.DEFAULT).atPosition(this.position);
  }
  return null;
}
Program: 84170
Project: 84170
Buggy source:
public void findFiles(File sourceDir,File targetDir){
  final String[] subFiles=sourceDir.list();
  if (subFiles == null) {
    return;
  }
  Map<String,Template> templates=new HashMap<>();
  List<Specialization> specializations=new ArrayList<>();
  for (  String subFile : subFiles) {
    final File sourceFile=new File(sourceDir,subFile);
    if (sourceFile.isDirectory()) {
      this.findFiles(sourceFile,new File(targetDir,subFile));
      continue;
    }
    final int endIndex=subFile.length() - 4;
    if (subFile.endsWith("String_Node_Str")) {
      final String fileName=subFile.substring(0,endIndex);
      templates.put(fileName,new Template(sourceFile,targetDir,fileName));
    }
 else     if (subFile.endsWith("String_Node_Str")) {
      final int dashIndex=subFile.lastIndexOf('-',endIndex);
      final String fileName=subFile.substring(0,dashIndex);
      final String specName=subFile.substring(dashIndex + 1,endIndex);
      specializations.add(new Specialization(sourceFile,fileName,specName));
    }
  }
  for (  Specialization spec : specializations) {
    this.specs.put(spec.getSourceFile(),spec);
    final Template template=templates.get(spec.getTemplateName());
    if (template == null) {
      continue;
    }
    spec.setTemplate(template);
    template.addSpecialization(spec);
  }
  this.templates.addAll(templates.values());
}

Fixed version (ground truth):
public void findFiles(File sourceDir,File targetDir){
  final String[] subFiles=sourceDir.list();
  if (subFiles == null) {
    return;
  }
  Map<String,Template> templates=new HashMap<>();
  List<Specialization> specializations=new ArrayList<>();
  for (  String subFile : subFiles) {
    final File sourceFile=new File(sourceDir,subFile);
    if (sourceFile.isDirectory()) {
      this.findFiles(sourceFile,new File(targetDir,subFile));
      continue;
    }
    final int endIndex=subFile.length() - 4;
    if (subFile.endsWith("String_Node_Str")) {
      final String fileName=subFile.substring(0,endIndex);
      templates.put(fileName,new Template(sourceFile,targetDir,fileName));
    }
 else     if (subFile.endsWith("String_Node_Str")) {
      final int dashIndex=subFile.lastIndexOf('-',endIndex);
      final Specialization spec;
      if (dashIndex < 0) {
        spec=new Specialization(sourceFile,subFile.substring(0,endIndex));
      }
 else {
        final String fileName=subFile.substring(0,dashIndex);
        final String specName=subFile.substring(dashIndex + 1,endIndex);
        spec=new Specialization(sourceFile,fileName,specName);
      }
      specializations.add(spec);
    }
  }
  for (  Specialization spec : specializations) {
    this.specs.put(spec.getSourceFile(),spec);
    final Template template=templates.get(spec.getTemplateName());
    if (template == null) {
      continue;
    }
    spec.setTemplate(template);
    template.addSpecialization(spec);
  }
  this.templates.addAll(templates.values());
}
Program: 84172
Project: 84172
Buggy source:
private boolean isConvertibleFrom(IType type){
  return type.getAnnotation(MapType.MapTypes.MAP_CONVERTIBLE_CLASS) != null;
}

Fixed version (ground truth):
private boolean isConvertibleFrom(IType type){
  return type.getAnnotation(LazyTypes.MAP_CONVERTIBLE_CLASS) != null;
}
Program: 84173
Project: 84173
Buggy source:
@Override public IValue withType(IType mapType,ITypeContext typeContext,MarkerList markers,IContext context){
  if (!MapType.MapTypes.MAP_CLASS.isSubClassOf(mapType)) {
    IAnnotation annotation=mapType.getTheClass().getAnnotation(MapType.MapTypes.MAP_CONVERTIBLE_CLASS);
    if (annotation != null) {
      ArgumentList arguments=new ArgumentList(new IValue[]{new ArrayExpr(this.keys,this.count),new ArrayExpr(this.values,this.count)},2);
      return new LiteralConversion(this,annotation,arguments).withType(mapType,typeContext,markers,context);
    }
    return null;
  }
  final IType keyType=this.keyType=Types.resolveTypeSafely(mapType,MapType.MapTypes.KEY_VARIABLE);
  final IType valueType=this.valueType=Types.resolveTypeSafely(mapType,MapType.MapTypes.VALUE_VARIABLE);
  for (int i=0; i < this.count; i++) {
    this.keys[i]=TypeChecker.convertValue(this.keys[i],keyType,typeContext,markers,context,KEY_MARKER_SUPPLIER);
    this.values[i]=TypeChecker.convertValue(this.values[i],valueType,typeContext,markers,context,VALUE_MARKER_SUPPLIER);
  }
  return this;
}

Fixed version (ground truth):
@Override public IValue withType(IType mapType,ITypeContext typeContext,MarkerList markers,IContext context){
  if (!MapType.MapTypes.MAP_CLASS.isSubClassOf(mapType)) {
    IAnnotation annotation=mapType.getTheClass().getAnnotation(LazyTypes.MAP_CONVERTIBLE_CLASS);
    if (annotation != null) {
      ArgumentList arguments=new ArgumentList(new IValue[]{new ArrayExpr(this.keys,this.count),new ArrayExpr(this.values,this.count)},2);
      return new LiteralConversion(this,annotation,arguments).withType(mapType,typeContext,markers,context);
    }
    return null;
  }
  final IType keyType=this.keyType=Types.resolveTypeSafely(mapType,MapType.MapTypes.KEY_VARIABLE);
  final IType valueType=this.valueType=Types.resolveTypeSafely(mapType,MapType.MapTypes.VALUE_VARIABLE);
  for (int i=0; i < this.count; i++) {
    this.keys[i]=TypeChecker.convertValue(this.keys[i],keyType,typeContext,markers,context,KEY_MARKER_SUPPLIER);
    this.values[i]=TypeChecker.convertValue(this.values[i],valueType,typeContext,markers,context,VALUE_MARKER_SUPPLIER);
  }
  return this;
}
Program: 84174
Project: 84174
Buggy source:
@Override public IValue checkAccess(MarkerList markers,ICodePosition position,IValue receiver,IContext context){
  if (receiver != null) {
    if (this.modifiers.hasIntModifier(Modifiers.STATIC)) {
      if (receiver.isClassAccess()) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name));
      }
 else       if (receiver.getType().getTheClass() != this.enclosingClass) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name,this.enclosingClass.getFullName()));
      }
      receiver=null;
    }
 else     if (receiver.isClassAccess()) {
      if (!receiver.getType().getTheClass().isObject()) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name));
      }
    }
 else {
      IType type=this.enclosingClass.getClassType();
      receiver=TypeChecker.convertValue(receiver,type,type,markers,context,TypeChecker.markerSupplier("String_Node_Str",this.name));
    }
  }
 else   if (!this.modifiers.hasIntModifier(Modifiers.STATIC)) {
    if (context.isStatic()) {
      markers.add(Markers.semantic(position,"String_Node_Str",this.name));
    }
 else {
      markers.add(Markers.semantic(position,"String_Node_Str",this.name.unqualified));
      receiver=new ThisExpr(position,this.enclosingClass.getType(),context,markers);
    }
  }
  ModifierUtil.checkVisibility(this,position,markers,context);
  return receiver;
}

Fixed version (ground truth):
@Override public IValue checkAccess(MarkerList markers,ICodePosition position,IValue receiver,IContext context){
  if (receiver != null) {
    if (this.modifiers.hasIntModifier(Modifiers.STATIC)) {
      if (!receiver.isClassAccess()) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name));
      }
 else       if (receiver.getType().getTheClass() != this.enclosingClass) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name,this.enclosingClass.getFullName()));
      }
      receiver=receiver.asIgnoredClassAccess();
    }
 else     if (receiver.isClassAccess()) {
      if (!receiver.getType().getTheClass().isObject()) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name));
      }
    }
 else {
      IType type=this.enclosingClass.getClassType();
      receiver=TypeChecker.convertValue(receiver,type,type,markers,context,TypeChecker.markerSupplier("String_Node_Str",this.name));
    }
  }
 else   if (!this.modifiers.hasIntModifier(Modifiers.STATIC)) {
    if (context.isStatic()) {
      markers.add(Markers.semantic(position,"String_Node_Str",this.name));
    }
 else {
      markers.add(Markers.semantic(position,"String_Node_Str",this.name.unqualified));
      receiver=new ThisExpr(position,this.enclosingClass.getType(),context,markers);
    }
  }
  ModifierUtil.checkVisibility(this,position,markers,context);
  return receiver;
}
Program: 84175
Project: 84175
Buggy source:
@Override public void writeClassInit(MethodWriter writer) throws BytecodeException {
  if (this.traitInit) {
    writer.visitVarInsn(Opcodes.ALOAD,0);
    writer.visitMethodInsn(Opcodes.INVOKEVIRTUAL,this.getInternalName(),TraitMetadata.INIT_NAME,"String_Node_Str",false);
  }
  this.metadata.writeClassInit(writer);
  if (this.body != null) {
    for (int i=0, count=this.body.fieldCount(); i < count; i++) {
      this.body.getField(i).writeClassInit(writer);
    }
    for (int i=0, count=this.body.propertyCount(); i < count; i++) {
      this.body.getProperty(i).writeClassInit(writer);
    }
    for (int i=0, count=this.body.initializerCount(); i < count; i++) {
      this.body.getInitializer(i).writeClassInit(writer);
    }
  }
  for (int i=0; i < this.compilableCount; i++) {
    this.compilables[i].writeClassInit(writer);
  }
}

Fixed version (ground truth):
@Override public void writeClassInit(MethodWriter writer) throws BytecodeException {
  if (this.traitInit) {
    writer.visitVarInsn(Opcodes.ALOAD,0);
    writer.visitMethodInsn(Opcodes.INVOKEVIRTUAL,this.getInternalName(),TraitMetadata.INIT_NAME,"String_Node_Str",false);
  }
  for (int i=0; i < this.compilableCount; i++) {
    this.compilables[i].writeClassInit(writer);
  }
  this.metadata.writeClassInit(writer);
  if (this.body == null) {
    return;
  }
  for (int i=0, count=this.body.fieldCount(); i < count; i++) {
    this.body.getField(i).writeClassInit(writer);
  }
  for (int i=0, count=this.body.propertyCount(); i < count; i++) {
    this.body.getProperty(i).writeClassInit(writer);
  }
  for (int i=0, count=this.body.initializerCount(); i < count; i++) {
    this.body.getInitializer(i).writeClassInit(writer);
  }
}
Program: 84176
Project: 84176
Buggy source:
@Override public void writeStaticInit(MethodWriter writer) throws BytecodeException {
  this.metadata.writeStaticInit(writer);
  if (this.body != null) {
    for (int i=0, count=this.body.fieldCount(); i < count; i++) {
      this.body.getField(i).writeStaticInit(writer);
    }
    for (int i=0, count=this.body.propertyCount(); i < count; i++) {
      this.body.getProperty(i).writeStaticInit(writer);
    }
    for (int i=0, count=this.body.initializerCount(); i < count; i++) {
      this.body.getInitializer(i).writeStaticInit(writer);
    }
  }
  for (int i=0; i < this.compilableCount; i++) {
    this.compilables[i].writeStaticInit(writer);
  }
}

Fixed version (ground truth):
@Override public void writeStaticInit(MethodWriter writer) throws BytecodeException {
  for (int i=0; i < this.compilableCount; i++) {
    this.compilables[i].writeStaticInit(writer);
  }
  this.metadata.writeStaticInit(writer);
  if (this.body == null) {
    return;
  }
  for (int i=0, count=this.body.fieldCount(); i < count; i++) {
    this.body.getField(i).writeStaticInit(writer);
  }
  for (int i=0, count=this.body.propertyCount(); i < count; i++) {
    this.body.getProperty(i).writeStaticInit(writer);
  }
  for (int i=0, count=this.body.initializerCount(); i < count; i++) {
    this.body.getInitializer(i).writeStaticInit(writer);
  }
}
Program: 84177
Project: 84177
Buggy source:
@Override public void appendSignature(StringBuilder buffer){
  buffer.append(this.name).append(':');
  if (this.upperBoundCount <= 0) {
    buffer.append("String_Node_Str");
    return;
  }
  if (this.upperBounds[0].getTheClass().isInterface()) {
    buffer.append(':');
  }
  this.upperBounds[0].appendSignature(buffer,false);
  for (int i=1; i < this.upperBoundCount; i++) {
    buffer.append(':');
    this.upperBounds[i].appendSignature(buffer,false);
  }
}

Fixed version (ground truth):
@Override public void appendSignature(StringBuilder buffer){
  buffer.append(this.name).append(':');
  if (this.upperBoundCount <= 0) {
    buffer.append("String_Node_Str");
    return;
  }
  final IClass theClass=this.upperBounds[0].getTheClass();
  if (theClass != null && theClass.isInterface()) {
    buffer.append(':');
  }
  this.upperBounds[0].appendSignature(buffer,false);
  for (int i=1; i < this.upperBoundCount; i++) {
    buffer.append(':');
    this.upperBounds[i].appendSignature(buffer,false);
  }
}
Program: 84178
Project: 84178
Buggy source:
@Override public boolean isResolved(){
  return this.type != null;
}

Fixed version (ground truth):
@Override public boolean isResolved(){
  return this.left.isResolved() && this.right.isResolved();
}
Program: 84181
Project: 84181
Buggy source:
private void preWrite(MethodWriter writer,IValue instance,IArguments arguments,int localCount){
  if (!this.preProcessed) {
    this.preProcessed=true;
    final int[] accessCounts=new int[this.maxLocals];
    int lastStoredIndex=-1;
    for (int i=0; i < this.instructionCount; i++) {
      final IInstruction instruction=this.instructions[i];
      final int opcode=instruction.getOpcode();
      if (Opcodes.isLoadOpcode(opcode)) {
        final int varIndex=((VarInstruction)instruction).getIndex();
        if (++accessCounts[varIndex] < 2) {
          continue;
        }
        if (varIndex > lastStoredIndex) {
          lastStoredIndex=varIndex;
        }
      }
 else       if (Opcodes.isReturnOpcode(opcode)) {
        this.returnIndex=i;
      }
    }
    this.storedParameters=lastStoredIndex + 1;
    final IParameterList parameterList=this.method.getParameterList();
    int parameterSlots=0;
    for (int i=0, parameterCount=parameterList.size(); i < parameterCount; i++) {
      parameterSlots+=parameterList.get(i).getInternalType().getLocalSlots();
    }
    this.parameterSlots=parameterSlots;
  }
  for (int i=0; i < this.storedParameters; i++) {
    final IType type=IntrinsicData.writeArgument(writer,this.method,i,instance,arguments);
    writer.visitVarInsn(type.getStoreOpcode(),localCount);
    localCount=writer.localCount();
  }
}

Fixed version (ground truth):
private void preWrite(MethodWriter writer,IValue instance,IArguments arguments,int localCount){
  if (!this.preProcessed) {
    this.preProcessed=true;
    this.preProcess();
  }
  for (int i=0; i < this.storedParameters; i++) {
    final IType type=IntrinsicData.writeArgument(writer,this.method,i,instance,arguments);
    writer.visitVarInsn(type.getStoreOpcode(),localCount);
    localCount=writer.localCount();
  }
}
Program: 84182
Project: 84182
Buggy source:
private static boolean lowerPrecedence(OperatorElement element1,OperatorElement element2,OperatorElement ternaryOperator,MarkerList markers){
  if (element1.operator.getType() == IOperator.TERNARY) {
    if (element2.operator.getType() == IOperator.TERNARY) {
      return false;
    }
    if (element2.name == element1.operator.getTernaryName()) {
      return false;
    }
  }
  if (ternaryOperator != null && element1.name == ternaryOperator.operator.getTernaryName()) {
    if (element2.name == element1.name) {
      return true;
    }
    if (element2.name == ternaryOperator.name) {
      return false;
    }
  }
  final int comparePrecedence=element1.operator.comparePrecedence(element2.operator);
  if (comparePrecedence < 0) {
    return true;
  }
  if (comparePrecedence == 0) {
switch (element1.operator.getAssociativity()) {
case IOperator.NONE:
      markers.add(Markers.semantic(element1.position,"String_Node_Str",element1.name));
case IOperator.LEFT:
    return true;
}
}
return false;
}

Fixed version (ground truth):
private static boolean lowerPrecedence(OperatorElement element1,OperatorElement element2,OperatorElement ternaryOperator,MarkerList markers){
  final byte element1Type=element1.operator.getType();
  if (element1Type == IOperator.TERNARY) {
    if (element2.operator.getType() == IOperator.TERNARY) {
      return false;
    }
    if (element2.name == element1.operator.getTernaryName()) {
      return false;
    }
  }
  if (ternaryOperator != null && element1.name == ternaryOperator.operator.getTernaryName()) {
    if (element2.name == element1.name) {
      return true;
    }
    if (element2.name == ternaryOperator.name) {
      return false;
    }
  }
  final int comparePrecedence=element1.operator.comparePrecedence(element2.operator);
  if (comparePrecedence < 0) {
    return true;
  }
  if (comparePrecedence > 0) {
    return false;
  }
switch (element1.operator.getAssociativity()) {
case IOperator.NONE:
    if (element1Type != IOperator.INFIX) {
      return true;
    }
  markers.add(Markers.semantic(element1.position,"String_Node_Str",element1.name));
case IOperator.LEFT:
return true;
}
return false;
}
Program: 84183
Project: 84183
Buggy source:
@Override public IValue resolveCall(MarkerList markers,IContext context){
  final IValue op=Operators.getPrefix(this.name,this.arguments.getFirstValue());
  if (op != null) {
    op.setPosition(this.position);
    return op.resolveOperator(markers,context);
  }
  if (this.resolveMethodCall(markers,context)) {
    return this;
  }
  if (this.resolveImplicitCall(markers,context)) {
    return this;
  }
  return null;
}

Fixed version (ground truth):
@Override public IValue resolveCall(MarkerList markers,IContext context){
  final IValue operand=this.arguments.getFirstValue();
  if (operand != null) {
    final IValue op=Operators.getPrefix(this.name,operand);
    if (op != null) {
      op.setPosition(this.position);
      return op.resolveOperator(markers,context);
    }
  }
  if (this.resolveMethodCall(markers,context)) {
    return this;
  }
  if (this.resolveImplicitCall(markers,context)) {
    return this;
  }
  return null;
}
Program: 84184
Project: 84184
Buggy source:
@Override public void resolveTypes(MarkerList markers,IContext context){
  super.resolveTypes(markers,context);
  if (this.type.getTheClass().isInterface()) {
    this.nestedClass.addInterface(this.type);
  }
 else {
    this.nestedClass.setSuperType(this.type);
  }
  this.nestedClass.resolveTypes(markers,context);
}

Fixed version (ground truth):
@Override public void resolveTypes(MarkerList markers,IContext context){
  super.resolveTypes(markers,context);
  final IClass theClass=this.type.getTheClass();
  if (theClass != null) {
    if (theClass.isInterface()) {
      this.nestedClass.addInterface(this.type);
    }
 else {
      this.nestedClass.setSuperType(this.type);
    }
  }
  this.nestedClass.resolveTypes(markers,context);
}
Program: 84185
Project: 84185
Buggy source:
@Override public void resolve(MarkerList markers,IContext context){
  context=context.push(this);
  super.resolve(markers,context);
  for (int i=0; i < this.typeParameterCount; i++) {
    this.typeParameters[i].resolve(markers,context);
  }
  if (this.receiverType != null) {
    this.receiverType.resolve(markers,context);
  }
  this.parameters.resolve(markers,context);
  for (int i=0; i < this.exceptionCount; i++) {
    this.exceptions[i].resolve(markers,context);
  }
  if (this.value != null) {
    this.value=this.value.resolve(markers,context);
    boolean inferType=false;
    if (this.type == Types.UNKNOWN) {
      inferType=true;
      this.type=this.value.getType();
      if (this.type == Types.UNKNOWN && this.value.isResolved()) {
        markers.add(Markers.semantic(this.position,"String_Node_Str",this.name.unqualified));
      }
    }
    final TypeChecker.MarkerSupplier markerSupplier=TypeChecker.markerSupplier("String_Node_Str","String_Node_Str","String_Node_Str",this.name);
    this.value=TypeChecker.convertValue(this.value,this.type,this.type,markers,context,markerSupplier);
    if (inferType) {
      this.type=this.value.getType();
    }
  }
 else   if (this.type == Types.UNKNOWN) {
    markers.add(Markers.semantic(this.position,"String_Node_Str",this.name.unqualified));
    this.type=Types.ANY;
  }
  context.pop();
}

Fixed version (ground truth):
@Override public void resolve(MarkerList markers,IContext context){
  context=context.push(this);
  super.resolve(markers,context);
  for (int i=0; i < this.typeParameterCount; i++) {
    this.typeParameters[i].resolve(markers,context);
  }
  if (this.receiverType != null) {
    this.receiverType.resolve(markers,context);
  }
  this.parameters.resolve(markers,context);
  for (int i=0; i < this.exceptionCount; i++) {
    this.exceptions[i].resolve(markers,context);
  }
  if (this.value != null) {
    this.value=this.value.resolve(markers,context);
    boolean inferType=false;
    if (this.type == Types.UNKNOWN || this.type == null) {
      inferType=true;
      this.type=this.value.getType();
      if (this.type == Types.UNKNOWN && this.value.isResolved()) {
        markers.add(Markers.semantic(this.position,"String_Node_Str",this.name.unqualified));
      }
    }
    final TypeChecker.MarkerSupplier markerSupplier=TypeChecker.markerSupplier("String_Node_Str","String_Node_Str","String_Node_Str",this.name);
    this.value=TypeChecker.convertValue(this.value,this.type,this.type,markers,context,markerSupplier);
    if (inferType) {
      this.type=this.value.getType();
    }
  }
 else   if (this.type == Types.UNKNOWN) {
    markers.add(Markers.semantic(this.position,"String_Node_Str",this.name.unqualified));
    this.type=Types.ANY;
  }
  context.pop();
}
Program: 84186
Project: 84186
Buggy source:
@Override public void checkTypes(MarkerList markers,IContext context){
  final IType returnType=context.getReturnType();
  if (this.value != null) {
    this.value.checkTypes(markers,context);
    if (returnType == null) {
      return;
    }
    final IType valueType=this.value.getType();
    if (!Types.isSuperType(returnType,valueType)) {
      final Marker marker=Markers.semanticError(this.position,"String_Node_Str");
      marker.addInfo(Markers.getSemantic("String_Node_Str",returnType));
      marker.addInfo(Markers.getSemantic("String_Node_Str",valueType));
      markers.add(marker);
    }
  }
 else   if (returnType != null && !Types.isSameClass(returnType,Types.VOID)) {
    markers.add(Markers.semanticError(this.position,"String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void checkTypes(MarkerList markers,IContext context){
  final IType returnType=context.getReturnType();
  if (this.value != null) {
    this.value.checkTypes(markers,context);
    if (returnType == null || !this.value.isResolved()) {
      return;
    }
    final IType valueType=this.value.getType();
    if (!Types.isSuperType(returnType,valueType)) {
      final Marker marker=Markers.semanticError(this.position,"String_Node_Str");
      marker.addInfo(Markers.getSemantic("String_Node_Str",returnType));
      marker.addInfo(Markers.getSemantic("String_Node_Str",valueType));
      markers.add(marker);
    }
  }
 else   if (returnType != null && !Types.isSameClass(returnType,Types.VOID)) {
    markers.add(Markers.semanticError(this.position,"String_Node_Str"));
  }
}
Program: 84188
Project: 84188
Buggy source:
private boolean success(){
  return !this.hasSyntaxErrors || this.reportErrors;
}

Fixed version (ground truth):
private boolean success(MarkerList markers){
  if (!this.hasSyntaxErrors || this.reportErrors) {
    markers.addAll(this.markers);
    return true;
  }
  return false;
}
Program: 84189
Project: 84189
Buggy source:
public TryParserManager(Symbols symbols,TokenIterator tokens,MarkerList markers){
  super(symbols,tokens,markers);
}

Fixed version (ground truth):
@Deprecated public TryParserManager(Symbols symbols,TokenIterator tokens,MarkerList markers){
  super(symbols,tokens,markers);
}
Program: 84190
Project: 84190
Buggy source:
@Override public void report(Marker error){
  final boolean isError=error.isError();
  if (!this.hasSyntaxErrors && isError) {
    this.hasSyntaxErrors=true;
  }
  if (this.reportErrors || !isError) {
    super.report(error);
    this.reportedMarkers++;
  }
}

Fixed version (ground truth):
@Override public void report(Marker error){
  final boolean isError=error.isError();
  if (!this.hasSyntaxErrors && isError) {
    this.hasSyntaxErrors=true;
  }
  if (this.reportErrors || !isError) {
    super.report(error);
  }
}
Program: 84191
Project: 84191
Buggy source:
public boolean parse(Parser parser,int flags){
  this.parser=parser;
  this.hasSyntaxErrors=false;
  this.reportErrors=(flags & REPORT_ERRORS) != 0;
  IToken token=null;
  while (true) {
    if (this.reparse) {
      this.reparse=false;
    }
 else {
      if (!this.tokens.hasNext()) {
        break;
      }
      token=this.tokens.next();
    }
    if (this.skip > 0) {
      this.skip--;
      continue;
    }
    if (this.parser == null) {
      if ((flags & EXIT_ON_ROOT) != 0) {
        return this.success();
      }
      this.reportUnparsed(token);
      continue;
    }
    if (!this.reportErrors && this.parser.reportErrors()) {
      if (this.hasSyntaxErrors) {
        return false;
      }
      this.reportErrors=true;
    }
    try {
      this.parser.parse(this,token);
    }
 catch (    Exception ex) {
      this.reportError(token,ex);
      return this.success();
    }
    if (!this.success()) {
      return false;
    }
  }
  this.parseRemaining(token);
  return this.success();
}

Fixed version (ground truth):
public boolean parse(Parser parser,MarkerList markers,int flags){
  this.parser=parser;
  this.hasSyntaxErrors=false;
  this.markers=new MarkerList(markers.getI18n());
  this.reportErrors=(flags & REPORT_ERRORS) != 0;
  IToken token=null;
  while (true) {
    if (this.reparse) {
      this.reparse=false;
    }
 else {
      if (!this.tokens.hasNext()) {
        break;
      }
      token=this.tokens.next();
    }
    if (this.skip > 0) {
      this.skip--;
      continue;
    }
    if (this.parser == null) {
      if ((flags & EXIT_ON_ROOT) != 0) {
        return this.success(markers);
      }
      this.reportUnparsed(token);
      continue;
    }
    if (!this.reportErrors && this.parser.reportErrors()) {
      if (this.hasSyntaxErrors) {
        return this.success(markers);
      }
      this.reportErrors=true;
    }
    try {
      this.parser.parse(this,token);
    }
 catch (    Exception ex) {
      this.reportError(token,ex);
      return this.success(markers);
    }
    if (this.hasSyntaxErrors && !this.reportErrors) {
      return this.success(markers);
    }
  }
  this.parseRemaining(token);
  return this.success(markers);
}
Program: 84192
Project: 84192
Buggy source:
public void resetTo(IToken token){
  this.tokens.jump(token);
  if (this.reportedMarkers >= 0) {
    this.markers.remove(this.reportedMarkers);
  }
  if (this.splitTokens == null) {
    return;
  }
  for (  IToken splitToken : this.splitTokens) {
    splitToken.prev().setNext(splitToken);
    splitToken.next().setPrev(splitToken);
  }
  this.splitTokens.clear();
}

Fixed version (ground truth):
public void resetTo(IToken token){
  this.tokens.jump(token);
  if (this.splitTokens == null) {
    return;
  }
  for (  IToken splitToken : this.splitTokens) {
    splitToken.prev().setNext(splitToken);
    splitToken.next().setPrev(splitToken);
  }
  this.splitTokens.clear();
}
Program: 84193
Project: 84193
Buggy source:
public void add(Marker marker){
  if (marker.isError()) {
    this.errors++;
  }
  if (marker.isWarning()) {
    this.warnings++;
  }
  int index=this.markerCount++;
  if (index >= this.markers.length) {
    Marker[] temp=new Marker[this.markerCount];
    System.arraycopy(this.markers,0,temp,0,this.markers.length);
    this.markers=temp;
  }
  this.markers[index]=marker;
}

Fixed version (ground truth):
public void add(Marker marker){
  if (marker.isError()) {
    this.errors++;
  }
  if (marker.isWarning()) {
    this.warnings++;
  }
  int index=this.markerCount++;
  if (index >= this.markers.length) {
    Marker[] temp=new Marker[this.markerCount << 1];
    System.arraycopy(this.markers,0,temp,0,index);
    this.markers=temp;
  }
  this.markers[index]=marker;
}
Program: 84194
Project: 84194
Buggy source:
private boolean tryParse(MarkerList markers,TokenIterator tokens,Parser parser,boolean reportErrors){
  this.parser.reset(markers,tokens);
  this.parser.resetTo(tokens.first());
  return this.parser.parse(parser,reportErrors);
}

Fixed version (ground truth):
private boolean tryParse(MarkerList markers,TokenIterator tokens,Parser parser,boolean reportErrors){
  this.parser.reset(markers,tokens);
  this.parser.resetTo(tokens.first());
  return this.parser.parse(parser,markers,reportErrors ? TryParserManager.REPORT_ERRORS : 0);
}
Program: 84195
Project: 84195
Buggy source:
public static IValue convertValue(IValue value,IType type,ITypeContext typeContext,MarkerList markers,IContext context,MarkerSupplier markerSupplier){
  final IType concreteType=type.getConcreteType(typeContext);
  final IValue newValue=convertValueDirect(value,concreteType,typeContext,markers,context);
  if (newValue != null) {
    if (typeContext != null && !typeContext.isReadonly()) {
      type.inferTypes(newValue.getType(),typeContext);
    }
    return newValue;
  }
  if (value.isResolved()) {
    markers.add(markerSupplier.createMarker(value.getPosition(),type,value.getType()));
  }
  return value;
}

Fixed version (ground truth):
public static IValue convertValue(IValue value,IType type,ITypeContext typeContext,MarkerList markers,IContext context,MarkerSupplier markerSupplier){
  final IType concreteType=type.getConcreteType(typeContext);
  final IValue newValue=convertValueDirect(value,concreteType,typeContext,markers,context);
  if (newValue != null) {
    if (typeContext != null && !typeContext.isReadonly()) {
      type.inferTypes(newValue.getType(),typeContext);
    }
    return newValue;
  }
  if (value.isResolved()) {
    markers.add(markerSupplier.createMarker(value.getPosition(),concreteType,value.getType()));
  }
  return value;
}
Program: 84196
Project: 84196
Buggy source:
@Override public IValue resolve(MarkerList markers,IContext context){
switch (this.operatorCount) {
case 0:
    return this.operands[0];
case 1:
  return createCall(this.operators[0],this.operands[0],this.operands[1]).resolve(markers,context);
}
final Stack<OperatorElement> operatorStack=new LinkedList<>();
final Stack<IValue> operandStack=new LinkedList<>();
operandStack.push(this.operands[0]);
for (int i=0; i < this.operatorCount; i++) {
final OperatorElement element1=this.operators[i];
OperatorElement element2;
while (!operatorStack.isEmpty()) {
  element2=operatorStack.peek();
  final int comparePrecedence=element1.operator.comparePrecedence(element2.operator);
  if (comparePrecedence < 0 || element1.operator.getAssociativity() != IOperator.RIGHT && comparePrecedence == 0) {
    operatorStack.pop();
    this.pushCall(operandStack,element2);
  }
 else {
    break;
  }
}
operatorStack.push(element1);
operandStack.push(this.operands[i + 1]);
}
while (!operatorStack.isEmpty()) {
this.pushCall(operandStack,operatorStack.pop());
}
return operandStack.pop().resolve(markers,context);
}

Fixed version (ground truth):
@Override public IValue resolve(MarkerList markers,IContext context){
switch (this.operatorCount) {
case 0:
    return this.operands[0];
case 1:
  return createCall(this.operators[0],this.operands[0],this.operands[1]).resolve(markers,context);
}
final Stack<OperatorElement> operatorStack=new LinkedList<>();
final Stack<IValue> operandStack=new LinkedList<>();
operandStack.push(this.operands[0]);
for (int i=0; i < this.operatorCount; i++) {
final OperatorElement element1=this.operators[i];
OperatorElement element2;
while (!operatorStack.isEmpty()) {
  element2=operatorStack.peek();
  final int comparePrecedence=element1.operator.comparePrecedence(element2.operator);
  if (comparePrecedence < 0) {
    operatorStack.pop();
    this.pushCall(operandStack,element2);
    continue;
  }
  if (comparePrecedence == 0) {
switch (element1.operator.getAssociativity()) {
case IOperator.NONE:
      markers.add(Markers.semantic(element1.position,"String_Node_Str",element1.name));
case IOperator.LEFT:
    operatorStack.pop();
  this.pushCall(operandStack,element2);
continue;
}
}
break;
}
operatorStack.push(element1);
operandStack.push(this.operands[i + 1]);
}
while (!operatorStack.isEmpty()) {
this.pushCall(operandStack,operatorStack.pop());
}
return operandStack.pop().resolve(markers,context);
}
Program: 84197
Project: 84197
Buggy source:
@Override public IValue resolve(MarkerList markers,IContext context){
  this.left=this.left.resolve(markers,context);
  this.right=this.right.resolve(markers,context);
  return this;
}

Fixed version (ground truth):
@Override public IValue resolve(MarkerList markers,IContext context){
  if (this.left != null) {
    this.left=this.left.resolve(markers,context);
  }
 else {
    markers.add(Markers.semanticError(this.position,"String_Node_Str"));
    this.left=new WildcardValue(this.position);
  }
  if (this.right != null) {
    this.right=this.right.resolve(markers,context);
  }
 else {
    markers.add(Markers.semanticError(this.position,"String_Node_Str"));
    this.right=new WildcardValue(this.position);
  }
  return this;
}
Program: 84198
Project: 84198
Buggy source:
@Override public void resolveTypes(MarkerList markers,IContext context){
  this.left.resolveTypes(markers,context);
  this.right.resolveTypes(markers,context);
}

Fixed version (ground truth):
@Override public void resolveTypes(MarkerList markers,IContext context){
  if (this.left != null) {
    this.left.resolveTypes(markers,context);
  }
  if (this.right != null) {
    this.right.resolveTypes(markers,context);
  }
}
Program: 84199
Project: 84199
Buggy source:
@Override public void resolve(MarkerList markers,IContext context){
  this.arguments.resolve(markers,context);
  final IClass theClass=this.type.getTheClass();
  if (theClass == null) {
    return;
  }
  for (int i=0, count=theClass.parameterCount(); i < count; i++) {
    final IParameter parameter=theClass.getParameter(i);
    final IType parameterType=parameter.getType();
    final IValue value=this.arguments.getValue(i,parameter);
    if (value == null) {
      if (parameter.getValue() == null) {
        markers.add(Markers.semanticError(this.position,"String_Node_Str",this.type,parameter.getName()));
      }
      continue;
    }
    IValue typedValue=value.withType(parameterType,parameterType,markers,context);
    if (typedValue == null) {
      markers.add(TypeChecker.typeError(value,parameterType,parameterType,"String_Node_Str",parameter.getName()));
      continue;
    }
    typedValue=Util.constant(typedValue,markers,context);
    if (typedValue != value) {
      this.arguments.setValue(i,parameter,typedValue);
    }
  }
}

Fixed version (ground truth):
@Override public void resolve(MarkerList markers,IContext context){
  this.arguments.resolve(markers,context);
  final IClass theClass;
  if (this.type == null || (theClass=this.type.getTheClass()) == null) {
    return;
  }
  for (int i=0, count=theClass.parameterCount(); i < count; i++) {
    final IParameter parameter=theClass.getParameter(i);
    final IType parameterType=parameter.getType();
    final IValue value=this.arguments.getValue(i,parameter);
    if (value == null) {
      if (parameter.getValue() == null) {
        markers.add(Markers.semanticError(this.position,"String_Node_Str",this.type,parameter.getName()));
      }
      continue;
    }
    IValue typedValue=value.withType(parameterType,parameterType,markers,context);
    if (typedValue == null) {
      markers.add(TypeChecker.typeError(value,parameterType,parameterType,"String_Node_Str",parameter.getName()));
      continue;
    }
    typedValue=Util.constant(typedValue,markers,context);
    if (typedValue != value) {
      this.arguments.setValue(i,parameter,typedValue);
    }
  }
}
Program: 84200
Project: 84200
Buggy source:
@Override public void check(MarkerList markers,IContext context,ElementType target){
  if (this.type == null || !this.type.isResolved()) {
    return;
  }
  IClass theClass=this.type.getTheClass();
  if (!theClass.hasModifier(Modifiers.ANNOTATION)) {
    markers.add(Markers.semantic(this.position,"String_Node_Str",this.type.getName()));
    return;
  }
  if (target == null) {
    return;
  }
  IClassMetadata metadata=theClass.getMetadata();
  if (!metadata.isTarget(target)) {
    Marker error=Markers.semantic(this.position,"String_Node_Str",this.type.getName());
    error.addInfo(Markers.getSemantic("String_Node_Str",target));
    error.addInfo(Markers.getSemantic("String_Node_Str",metadata.getTargets()));
    markers.add(error);
  }
}

Fixed version (ground truth):
@Override public void check(MarkerList markers,IContext context,ElementType target){
  if (this.type == null || !this.type.isResolved()) {
    return;
  }
  final IClass theClass=this.type.getTheClass();
  if (!theClass.hasModifier(Modifiers.ANNOTATION)) {
    markers.add(Markers.semanticError(this.position,"String_Node_Str",this.type.getName()));
    return;
  }
  if (target == null) {
    return;
  }
  final IClassMetadata metadata=theClass.getMetadata();
  if (!metadata.isTarget(target)) {
    final Marker error=Markers.semanticError(this.position,"String_Node_Str",this.type.getName());
    error.addInfo(Markers.getSemantic("String_Node_Str",target));
    error.addInfo(Markers.getSemantic("String_Node_Str",metadata.getTargets()));
    markers.add(error);
  }
}
Program: 84201
Project: 84201
Buggy source:
@Override public void checkTypes(MarkerList markers,IContext context){
  this.type.checkType(markers,context,TypePosition.CLASS);
  this.arguments.checkTypes(markers,context);
}

Fixed version (ground truth):
@Override public void checkTypes(MarkerList markers,IContext context){
  if (this.type != null) {
    this.type.checkType(markers,context,TypePosition.CLASS);
  }
  this.arguments.checkTypes(markers,context);
}
Program: 84202
Project: 84202
Buggy source:
@Override public void resolveTypes(MarkerList markers,IContext context){
  this.type=this.type.resolveType(markers,context);
  this.arguments.resolveTypes(markers,context);
}

Fixed version (ground truth):
@Override public void resolveTypes(MarkerList markers,IContext context){
  if (this.type != null) {
    this.type=this.type.resolveType(markers,context);
  }
 else {
    markers.add(Markers.semanticError(this.position,"String_Node_Str"));
  }
  this.arguments.resolveTypes(markers,context);
}
Program: 84203
Project: 84203
Buggy source:
public static void checkMethodModifiers(MarkerList markers,IClassMember member,int modifiers,boolean hasValue){
  boolean isStatic=(modifiers & Modifiers.STATIC) != 0;
  boolean isAbstract=(modifiers & Modifiers.ABSTRACT) != 0;
  boolean isNative=(modifiers & Modifiers.NATIVE) != 0;
  if (isStatic && isAbstract) {
    markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member)));
  }
 else   if (isAbstract && isNative) {
    markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member)));
  }
 else {
    if (isStatic) {
      if (!hasValue) {
        markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member)));
      }
    }
    if (isNative) {
      if (!hasValue) {
        markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member)));
      }
    }
    if (isAbstract) {
      IClass theClass=member.getEnclosingClass();
      if (!theClass.isAbstract()) {
        markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member),theClass.getName()));
      }
      if (hasValue) {
        markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member)));
      }
    }
  }
  if (!hasValue && !isAbstract && !isNative) {
    markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member)));
  }
}

Fixed version (ground truth):
public static void checkMethodModifiers(MarkerList markers,IClassMember member,int modifiers,boolean hasValue){
  boolean isStatic=(modifiers & Modifiers.STATIC) != 0;
  boolean isAbstract=(modifiers & Modifiers.ABSTRACT) != 0;
  boolean isNative=(modifiers & Modifiers.NATIVE) != 0;
  if (isStatic && isAbstract) {
    markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member)));
  }
 else   if (isAbstract && isNative) {
    markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member)));
  }
 else {
    if (isStatic) {
      if (!hasValue) {
        markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member)));
      }
    }
    if (isNative) {
      if (!hasValue) {
        markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member)));
      }
    }
    if (isAbstract) {
      IClass theClass=member.getEnclosingClass();
      if (!theClass.isAbstract()) {
        markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member),theClass.getName()));
      }
      if (hasValue) {
        markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member)));
      }
    }
  }
  if (!hasValue && !isAbstract && !isNative&& !isStatic) {
    markers.add(Markers.semanticError(member.getPosition(),"String_Node_Str",Util.memberNamed(member)));
  }
}
Program: 84204
Project: 84204
Buggy source:
protected void parseRemaining(IToken token){
  if (token == null || this.hasStopped) {
    return;
  }
  while (this.parser != null) {
    token=token.next();
    Parser prevParser=this.parser;
    int mode=prevParser.getMode();
    prevParser.parse(this,token);
    if (this.parser == prevParser && this.parser.getMode() == mode) {
      break;
    }
  }
}

Fixed version (ground truth):
protected void parseRemaining(IToken token){
  if (token == null || this.hasStopped) {
    return;
  }
  while (this.parser != null) {
    token=token.next();
    Parser prevParser=this.parser;
    int mode=prevParser.getMode();
    this.tryParse(token,prevParser);
    if (this.parser == prevParser && this.parser.getMode() == mode) {
      break;
    }
  }
}