Program: 82931
Project: 82931
Buggy source:
@Override public IValue checkArguments(MarkerList markers,ICodePosition position,IContext context,IValue instance,IArguments arguments,ITypeContext typeContext){
  int len=arguments.size();
  if (this.modifiers.hasIntModifier(Modifiers.PREFIX) && !this.isStatic()) {
    IValue argument=arguments.getFirstValue();
    arguments.setFirstValue(instance);
    instance=argument;
  }
  if (instance != null) {
    int mod=this.modifiers.toFlags() & Modifiers.INFIX;
    if (mod == Modifiers.INFIX && instance.valueTag() != IValue.CLASS_ACCESS) {
      IParameter par=this.parameters[0];
      IValue instance1=IType.convertValue(instance,par.getType(),typeContext,markers,context);
      if (instance1 == null) {
        Util.createTypeError(markers,instance,par.getType(),typeContext,"String_Node_Str",par.getName());
      }
 else {
        instance=instance1;
      }
      if (this.isVarargs()) {
        arguments.checkVarargsValue(this.parameterCount - 2,this.parameters[this.parameterCount - 1],typeContext,markers,context);
        for (int i=0; i < this.parameterCount - 2; i++) {
          arguments.checkValue(i,this.parameters[i + 1],typeContext,markers,context);
        }
        this.checkTypeVarsInferred(markers,position,typeContext);
        return instance;
      }
      for (int i=0; i < this.parameterCount - 1; i++) {
        arguments.checkValue(i,this.parameters[i + 1],typeContext,markers,context);
      }
      this.checkTypeVarsInferred(markers,position,typeContext);
      return instance;
    }
    if ((mod & Modifiers.STATIC) != 0) {
      if (instance.valueTag() != IValue.CLASS_ACCESS) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name));
      }
 else       if (instance.getType().getTheClass() != this.theClass) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name,this.theClass.getFullName()));
      }
      instance=null;
    }
 else     if (instance.valueTag() == IValue.CLASS_ACCESS) {
      if (!instance.getType().getTheClass().isObject()) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name));
      }
    }
 else {
      IValue instance1=IType.convertValue(instance,this.receiverType,typeContext,markers,context);
      if (instance1 == null) {
        Util.createTypeError(markers,instance,this.receiverType,typeContext,"String_Node_Str",this.name);
      }
 else {
        instance=instance1;
      }
    }
  }
 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));
      instance=new ThisExpr(position,this.theClass.getType(),context,markers);
    }
  }
  if (this.isVarargs()) {
    len=this.parameterCount - 1;
    arguments.checkVarargsValue(len,this.parameters[len],typeContext,markers,null);
    for (int i=0; i < len; i++) {
      arguments.checkValue(i,this.parameters[i],typeContext,markers,context);
    }
    this.checkTypeVarsInferred(markers,position,typeContext);
    return instance;
  }
  for (int i=0; i < this.parameterCount; i++) {
    arguments.checkValue(i,this.parameters[i],typeContext,markers,context);
  }
  this.checkTypeVarsInferred(markers,position,typeContext);
  return instance;
}

Fixed version (ground truth):
@Override public IValue checkArguments(MarkerList markers,ICodePosition position,IContext context,IValue receiver,IArguments arguments,ITypeContext typeContext){
  int len=arguments.size();
  if (this.modifiers.hasIntModifier(Modifiers.PREFIX) && !this.isStatic()) {
    IValue argument=arguments.getFirstValue();
    arguments.setFirstValue(receiver);
    receiver=argument;
  }
  if (receiver != null) {
    int mod=this.modifiers.toFlags() & Modifiers.INFIX;
    if (mod == Modifiers.INFIX && receiver.valueTag() != IValue.CLASS_ACCESS) {
      IParameter par=this.parameters[0];
      IValue instance1=IType.convertValue(receiver,par.getType(),typeContext,markers,context);
      if (instance1 == null) {
        Util.createTypeError(markers,receiver,par.getType(),typeContext,"String_Node_Str",par.getName());
      }
 else {
        receiver=instance1;
      }
      if (this.isVarargs()) {
        arguments.checkVarargsValue(this.parameterCount - 2,this.parameters[this.parameterCount - 1],typeContext,markers,context);
        for (int i=0; i < this.parameterCount - 2; i++) {
          arguments.checkValue(i,this.parameters[i + 1],typeContext,markers,context);
        }
        this.checkTypeVarsInferred(markers,position,typeContext);
        return receiver;
      }
      for (int i=0; i < this.parameterCount - 1; i++) {
        arguments.checkValue(i,this.parameters[i + 1],typeContext,markers,context);
      }
      this.checkTypeVarsInferred(markers,position,typeContext);
      return receiver;
    }
    if ((mod & Modifiers.STATIC) != 0) {
      if (receiver.valueTag() != IValue.CLASS_ACCESS) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name));
      }
 else       if (receiver.getType().getTheClass() != this.theClass) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name,this.theClass.getFullName()));
      }
      receiver=null;
    }
 else     if (receiver.valueTag() == IValue.CLASS_ACCESS) {
      if (!receiver.getType().getTheClass().isObject()) {
        markers.add(Markers.semantic(position,"String_Node_Str",this.name));
      }
    }
 else {
      final IValue typedReceiver=IType.convertValue(receiver,this.receiverType,typeContext,markers,context);
      if (typedReceiver == null) {
        Util.createTypeError(markers,receiver,this.receiverType,typeContext,"String_Node_Str",this.name);
      }
 else {
        receiver=typedReceiver;
      }
    }
  }
 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.theClass.getType(),context,markers);
    }
  }
  if (this.isVarargs()) {
    len=this.parameterCount - 1;
    arguments.checkVarargsValue(len,this.parameters[len],typeContext,markers,null);
    for (int i=0; i < len; i++) {
      arguments.checkValue(i,this.parameters[i],typeContext,markers,context);
    }
    this.checkTypeVarsInferred(markers,position,typeContext);
    return receiver;
  }
  for (int i=0; i < this.parameterCount; i++) {
    arguments.checkValue(i,this.parameters[i],typeContext,markers,context);
  }
  this.checkTypeVarsInferred(markers,position,typeContext);
  return receiver;
}