nus-yam/ex-repair huggingface dataset:
Program: 85180
Project: 85180
Buggy source:
@Override public void checkArguments(List<Marker> markers,IValue instance,IArguments arguments,ITypeContext typeContext){
  int pOff=0;
  int len=arguments.size();
  Parameter par;
  IType parType;
  if (instance != null && (this.modifiers & Modifiers.INFIX) == Modifiers.INFIX) {
    par=this.parameters[0];
    parType=par.getType(typeContext);
    IValue instance1=instance.withType(parType);
    if (instance1 == null) {
      Marker marker=Markers.create(instance.getPosition(),"String_Node_Str",par.name);
      marker.addInfo("String_Node_Str" + parType);
      marker.addInfo("String_Node_Str" + instance.getType());
      markers.add(marker);
    }
    pOff=1;
  }
 else   if (instance == null && (this.modifiers & Modifiers.PREFIX) == Modifiers.PREFIX) {
    parType=this.theClass.getType();
    instance=arguments.getFirstValue();
    IValue instance1=instance.withType(parType);
    if (instance1 == null) {
      Marker marker=Markers.create(instance.getPosition(),"String_Node_Str",this.name);
      marker.addInfo("String_Node_Str" + parType);
      marker.addInfo("String_Node_Str" + instance.getType());
      markers.add(marker);
    }
    return;
  }
  if ((this.modifiers & Modifiers.VARARGS) != 0) {
    len=this.parameterCount - 1;
    par=this.parameters[len];
    par.index=len;
    arguments.checkVarargsValue(markers,par,typeContext);
  }
  for (int i=0; i < len; i++) {
    par=this.parameters[i + pOff];
    par.index=i;
    arguments.checkValue(markers,par,typeContext);
  }
}

Fixed version (ground truth):
@Override public void checkArguments(List<Marker> markers,IValue instance,IArguments arguments,ITypeContext typeContext){
  int pOff=0;
  int len=arguments.size();
  Parameter par;
  IType parType;
  if (instance != null && (this.modifiers & Modifiers.INFIX) == Modifiers.INFIX) {
    par=this.parameters[0];
    parType=par.getType(typeContext);
    IValue instance1=instance.withType(parType);
    if (instance1 == null) {
      Marker marker=Markers.create(instance.getPosition(),"String_Node_Str",par.name);
      marker.addInfo("String_Node_Str" + parType);
      marker.addInfo("String_Node_Str" + instance.getType());
      markers.add(marker);
    }
    pOff=1;
  }
 else   if (instance == null && (this.modifiers & Modifiers.PREFIX) == Modifiers.PREFIX) {
    parType=this.theClass.getType();
    instance=arguments.getFirstValue();
    IValue instance1=instance.withType(parType);
    if (instance1 == null) {
      Marker marker=Markers.create(instance.getPosition(),"String_Node_Str",this.name);
      marker.addInfo("String_Node_Str" + parType);
      marker.addInfo("String_Node_Str" + instance.getType());
      markers.add(marker);
    }
    return;
  }
  if ((this.modifiers & Modifiers.VARARGS) != 0) {
    len=this.parameterCount - 1;
    par=this.parameters[len];
    par.index=len;
    arguments.checkVarargsValue(markers,par,typeContext);
  }
  for (int i=0; i < this.parameterCount; i++) {
    par=this.parameters[i + pOff];
    par.index=i;
    arguments.checkValue(markers,par,typeContext);
  }
}
Program: 85181
Project: 85181
Buggy source:
@Override public int getTypeMatch(Parameter param){
  if (param.index > this.size) {
    return 0;
  }
  return this.values[param.index].getTypeMatch(param.type);
}

Fixed version (ground truth):
@Override public int getTypeMatch(Parameter param){
  if (param.index >= this.size) {
    return param.defaultValue != null ? 3 : 0;
  }
  return this.values[param.index].getTypeMatch(param.type);
}
Program: 85182
Project: 85182
Buggy source:
@Override public void writeValue(Parameter param,MethodWriter writer){
  if (param.varargs) {
    IType type=param.type.getElementType();
    int len=this.size - param.index;
    int opcode=type.getArrayStoreOpcode();
    writer.visitLdcInsn(len);
    writer.visitTypeInsn(Opcodes.ANEWARRAY,type);
    for (int i=0; i < len; i++) {
      writer.visitInsn(Opcodes.DUP);
      IValue value=this.values[param.index + i];
      writer.visitLdcInsn(i);
      value.writeExpression(writer);
      writer.visitInsn(opcode);
    }
    return;
  }
  this.values[param.index].writeExpression(writer);
}

Fixed version (ground truth):
@Override public void writeValue(Parameter param,MethodWriter writer){
  if (param.varargs) {
    IType type=param.type.getElementType();
    int len=this.size - param.index;
    int opcode=type.getArrayStoreOpcode();
    writer.visitLdcInsn(len);
    writer.visitTypeInsn(Opcodes.ANEWARRAY,type);
    for (int i=0; i < len; i++) {
      writer.visitInsn(Opcodes.DUP);
      IValue value=this.values[param.index + i];
      writer.visitLdcInsn(i);
      value.writeExpression(writer);
      writer.visitInsn(opcode);
    }
    return;
  }
  if (param.index < this.size) {
    this.values[param.index].writeExpression(writer);
    return;
  }
  param.defaultValue.writeExpression(writer);
}
Program: 85183
Project: 85183
Buggy source:
@Override public Iterator<IValue> iterator(){
  return new ArrayIterator(this.values);
}

Fixed version (ground truth):
@Override public Iterator<IValue> iterator(){
  return new ArrayIterator(this.values,this.size);
}
Program: 85184
Project: 85184
Buggy source:
@Override public int getTypeMatch(Parameter param){
  return param.index == 0 ? this.value.getTypeMatch(param.type) : 0;
}

Fixed version (ground truth):
@Override public int getTypeMatch(Parameter param){
  if (param.index == 0) {
    return this.value.getTypeMatch(param.type);
  }
  return param.defaultValue != null ? 3 : 0;
}
Program: 85185
Project: 85185
Buggy source:
@Override public void writeValue(Parameter param,MethodWriter writer){
  if (param.index == 0) {
    this.value.writeExpression(writer);
  }
}

Fixed version (ground truth):
@Override public void writeValue(Parameter param,MethodWriter writer){
  if (param.index == 0) {
    this.value.writeExpression(writer);
    return;
  }
  param.defaultValue.writeExpression(writer);
}
Program: 85186
Project: 85186
Buggy source:
public static void typesToString(String prefix,Iterable<? extends ITyped> list,String seperator,StringBuilder buffer){
  Iterator<? extends ITyped> iterator=list.iterator();
  while (true) {
    IType type=iterator.next().getType();
    if (type == null) {
      buffer.append("String_Node_Str");
    }
 else {
      type.toString(prefix,buffer);
    }
    if (iterator.hasNext()) {
      buffer.append(seperator);
    }
 else {
      break;
    }
  }
}

Fixed version (ground truth):
public static void typesToString(String prefix,Iterable<? extends ITyped> list,String seperator,StringBuilder buffer){
  Iterator<? extends ITyped> iterator=list.iterator();
  if (!iterator.hasNext()) {
    return;
  }
  while (true) {
    IType type=iterator.next().getType();
    if (type == null) {
      buffer.append("String_Node_Str");
    }
 else {
      type.toString(prefix,buffer);
    }
    if (iterator.hasNext()) {
      buffer.append(seperator);
    }
 else {
      break;
    }
  }
}
Program: 85187
Project: 85187
Buggy source:
@Override public boolean parse(ParserManager pm,IToken token) throws SyntaxError {
  if (this.mode == NAME) {
    this.annotation=new Annotation(token.raw(),token.value().substring(1));
    this.mode=PARAMETERS_START;
    if (!token.next().isType(Tokens.OPEN_PARENTHESIS)) {
      this.annotatable.addAnnotation(this.annotation);
      pm.popParser();
    }
    return true;
  }
  if (this.isInMode(PARAMETERS_START)) {
    if (token.isType(Tokens.OPEN_PARENTHESIS)) {
      pm.pushParser(new ExpressionMapParser(this.annotation));
      this.mode=PARAMETERS_END;
      return true;
    }
  }
  if (this.isInMode(PARAMETERS_END)) {
    if (token.isType(Tokens.CLOSE_PARENTHESIS)) {
      this.annotation.expandPosition(token);
      this.annotatable.addAnnotation(this.annotation);
      pm.popParser();
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean parse(ParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
  if (this.mode == NAME) {
    if (ParserUtil.isIdentifier(type)) {
      this.annotation=new Annotation(token.raw(),token.value().substring(1));
      this.mode=PARAMETERS_START;
      if (token.next().type() != Tokens.OPEN_PARENTHESIS) {
        this.annotatable.addAnnotation(this.annotation);
        pm.popParser();
      }
      return true;
    }
    throw new SyntaxError(token,"String_Node_Str");
  }
  if (this.mode == PARAMETERS_START) {
    if (type == Tokens.OPEN_PARENTHESIS) {
      pm.pushParser(new ExpressionMapParser(this.annotation));
      this.mode=PARAMETERS_END;
      return true;
    }
    throw new SyntaxError(token,"String_Node_Str");
  }
  if (this.mode == PARAMETERS_END) {
    if (type == Tokens.CLOSE_PARENTHESIS) {
      this.annotation.expandPosition(token);
      this.annotatable.addAnnotation(this.annotation);
      pm.popParser();
      return true;
    }
    throw new SyntaxError(token,"String_Node_Str");
  }
  return false;
}
Program: 85188
Project: 85188
Buggy source:
@Override public boolean parse(ParserManager pm,IToken token) throws SyntaxError {
  if (this.isInMode(LABEL)) {
    if (token.next().isType(Tokens.COLON)) {
      this.label=token.value();
      pm.skip();
      return true;
    }
  }
  int type=token.type();
  if (this.isInMode(INSTRUCTION)) {
    if (ParserUtil.isIdentifier(type)) {
      String name=token.value();
      Instruction insn=Instruction.parse(name);
      if (insn == null) {
        this.mode=INSTRUCTION | LABEL;
        throw new SyntaxError(token,"String_Node_Str" + name + "String_Node_Str");
      }
      if (this.label != null) {
        this.bytecode.addInstruction(insn,this.label);
        this.label=null;
      }
 else {
        this.bytecode.addInstruction(insn);
      }
      insn.setPosition(token);
      this.instruction=insn;
      this.mode=ARGUMENTS;
      return true;
    }
  }
  if (this.isInMode(ARGUMENTS)) {
    if (type == Tokens.SEMICOLON) {
      this.mode=INSTRUCTION | LABEL;
      return true;
    }
    if (type == Tokens.COMMA) {
      return true;
    }
    if (!ParserUtil.isTerminator(type)) {
      if (this.instruction == null) {
        throw new SyntaxError(token,"String_Node_Str" + token.value() + "String_Node_Str");
      }
 else       if (!this.instruction.addArgument(token.object())) {
        throw new SyntaxError(token,"String_Node_Str" + token.value() + "String_Node_Str"+ this.instruction.getName());
      }
      return true;
    }
  }
  pm.popParser(true);
  return true;
}

Fixed version (ground truth):
@Override public boolean parse(ParserManager pm,IToken token) throws SyntaxError {
  if (this.isInMode(LABEL)) {
    if (token.next().type() == Tokens.COLON) {
      this.label=token.value();
      pm.skip();
      return true;
    }
  }
  int type=token.type();
  if (this.isInMode(INSTRUCTION)) {
    if (ParserUtil.isIdentifier(type)) {
      String name=token.value();
      Instruction insn=Instruction.parse(name);
      if (insn == null) {
        this.mode=INSTRUCTION | LABEL;
        throw new SyntaxError(token,"String_Node_Str" + name + "String_Node_Str");
      }
      if (this.label != null) {
        this.bytecode.addInstruction(insn,this.label);
        this.label=null;
      }
 else {
        this.bytecode.addInstruction(insn);
      }
      insn.setPosition(token);
      this.instruction=insn;
      this.mode=ARGUMENTS;
      return true;
    }
  }
  if (this.isInMode(ARGUMENTS)) {
    if (type == Tokens.SEMICOLON) {
      this.mode=INSTRUCTION | LABEL;
      return true;
    }
    if (type == Tokens.COMMA) {
      return true;
    }
    if (!ParserUtil.isTerminator(type)) {
      if (this.instruction == null) {
        throw new SyntaxError(token,"String_Node_Str" + token.value() + "String_Node_Str");
      }
 else       if (!this.instruction.addArgument(token.object())) {
        throw new SyntaxError(token,"String_Node_Str" + token.value() + "String_Node_Str"+ this.instruction.getName());
      }
      return true;
    }
  }
  pm.popParser(true);
  return true;
}
Program: 85191
Project: 85191
Buggy source:
@Override public boolean parse(ParserManager jcp,IToken token) throws SyntaxError {
  String value=token.value();
  if (this.isInMode(PACKAGE)) {
    if ("String_Node_Str".equals(value)) {
      this.mode=IMPORT | CLASS;
      jcp.pushParser(new PackageParser(this.unit));
      return true;
    }
  }
  if (this.isInMode(IMPORT)) {
    if ("String_Node_Str".equals(value)) {
      this.mode=IMPORT | CLASS;
      Import i=new Import(token.raw());
      this.unit.addImport(i);
      jcp.pushParser(new ImportParser(null,i));
      return true;
    }
    if ("String_Node_Str".equals(value)) {
      this.mode=IMPORT | CLASS;
      Import i=new Import(token.raw());
      i.isStatic=true;
      this.unit.addStaticImport(i);
      jcp.pushParser(new ImportParser(null,i));
      return true;
    }
  }
  if (this.isInMode(CLASS)) {
    if (token.isType(Tokens.SEMICOLON)) {
      return true;
    }
    jcp.pushParser(new ClassDeclParser(this.unit),true);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean parse(ParserManager jcp,IToken token) throws SyntaxError {
  String value=token.value();
  if (this.isInMode(PACKAGE)) {
    if ("String_Node_Str".equals(value)) {
      this.mode=IMPORT | CLASS;
      jcp.pushParser(new PackageParser(this.unit));
      return true;
    }
  }
  if (this.isInMode(IMPORT)) {
    if ("String_Node_Str".equals(value)) {
      this.mode=IMPORT | CLASS;
      Import i=new Import(token.raw());
      this.unit.addImport(i);
      jcp.pushParser(new ImportParser(null,i));
      return true;
    }
    if ("String_Node_Str".equals(value)) {
      this.mode=IMPORT | CLASS;
      Import i=new Import(token.raw());
      i.isStatic=true;
      this.unit.addStaticImport(i);
      jcp.pushParser(new ImportParser(null,i));
      return true;
    }
  }
  if (this.isInMode(CLASS)) {
    if (token.type() == Tokens.SEMICOLON) {
      return true;
    }
    jcp.pushParser(new ClassDeclParser(this.unit),true);
    return true;
  }
  return false;
}
Program: 85192
Project: 85192
Buggy source:
@Override public boolean parse(ParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
  if (this.mode == VALUE) {
    if (ParserUtil.isIdentifier(type)) {
      if (token.next().isType(Tokens.OPEN_CURLY_BRACKET)) {
        DWTNode node=new DWTNode(token.raw(),token.value());
        this.valued.setValue(node);
        pm.popParser();
        pm.pushParser(new DWTParser(node),true);
        return true;
      }
      this.valued.setValue(new DWTReference(token.raw(),token.value()));
      pm.popParser();
      return true;
    }
    if (type == Tokens.OPEN_SQUARE_BRACKET) {
      ValueList list=new DWTList(token);
      this.mode=LIST_END;
      this.valued.setValue(list);
      pm.pushParser(new DWTListParser(list));
      return true;
    }
    IValue primitive=parsePrimitive(token,type);
    if (primitive != null) {
      this.valued.setValue(primitive);
      pm.popParser();
      return true;
    }
    throw new SyntaxError(token,"String_Node_Str");
  }
  if (this.mode == LIST_END) {
    if (type == Tokens.CLOSE_SQUARE_BRACKET) {
      pm.popParser();
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean parse(ParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
  if (this.mode == VALUE) {
    if (ParserUtil.isIdentifier(type)) {
      if (token.next().type() == Tokens.OPEN_CURLY_BRACKET) {
        DWTNode node=new DWTNode(token.raw(),token.value());
        this.valued.setValue(node);
        pm.popParser();
        pm.pushParser(new DWTParser(node),true);
        return true;
      }
      this.valued.setValue(new DWTReference(token.raw(),token.value()));
      pm.popParser();
      return true;
    }
    if (type == Tokens.OPEN_SQUARE_BRACKET) {
      ValueList list=new DWTList(token);
      this.mode=LIST_END;
      this.valued.setValue(list);
      pm.pushParser(new DWTListParser(list));
      return true;
    }
    IValue primitive=parsePrimitive(token,type);
    if (primitive != null) {
      this.valued.setValue(primitive);
      pm.popParser();
      return true;
    }
    throw new SyntaxError(token,"String_Node_Str");
  }
  if (this.mode == LIST_END) {
    if (type == Tokens.CLOSE_SQUARE_BRACKET) {
      pm.popParser();
      return true;
    }
  }
  return false;
}
Program: 85193
Project: 85193
Buggy source:
@Override public boolean parse(ParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
  if (ParserUtil.isCloseBracket(type)) {
    pm.popParser(true);
    return true;
  }
  if (this.mode == 0) {
    if (token.next().isType(Tokens.COLON)) {
      this.label=token.value();
      pm.skip();
      return true;
    }
    this.mode=1;
    pm.pushParser(new ExpressionParser(this),true);
    return true;
  }
  if (this.mode == 1) {
    if (type == Tokens.COMMA) {
      this.valueList.setArray(true);
      this.mode=0;
      return true;
    }
    if (type == Tokens.SEMICOLON) {
      this.mode=0;
      return true;
    }
    if (token.prev().isType(Tokens.CLOSE_CURLY_BRACKET)) {
      pm.pushParser(new ExpressionParser(this),true);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean parse(ParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
  if (ParserUtil.isCloseBracket(type)) {
    pm.popParser(true);
    return true;
  }
  if (this.mode == 0) {
    if (token.next().type() == Tokens.COLON) {
      this.label=token.value();
      pm.skip();
      return true;
    }
    this.mode=1;
    pm.pushParser(new ExpressionParser(this),true);
    return true;
  }
  if (this.mode == 1) {
    if (type == Tokens.COMMA) {
      this.valueList.setArray(true);
      this.mode=0;
      return true;
    }
    if (type == Tokens.SEMICOLON) {
      this.mode=0;
      return true;
    }
    if (token.prev().type() == Tokens.CLOSE_CURLY_BRACKET) {
      pm.pushParser(new ExpressionParser(this),true);
      return true;
    }
  }
  return false;
}
Program: 85194
Project: 85194
Buggy source:
@Override public boolean parse(ParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
  if (ParserUtil.isCloseBracket(type)) {
    pm.popParser(true);
    return true;
  }
  if (this.mode == NAME) {
    if (token.next().isType(Tokens.EQUALS)) {
      this.key=token.value();
      pm.skip();
      return true;
    }
    this.mode=VALUE;
  }
  if (this.mode == VALUE) {
    this.mode=SEPERATOR;
    pm.pushTryParser(new ExpressionParser(this),token,true);
    return true;
  }
  if (this.mode == SEPERATOR) {
    if (type == Tokens.COMMA) {
      this.mode=NAME | VALUE;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean parse(ParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
  if (ParserUtil.isCloseBracket(type)) {
    pm.popParser(true);
    return true;
  }
  if (this.mode == NAME) {
    if (token.next().type() == Tokens.EQUALS) {
      this.key=token.value();
      pm.skip();
      return true;
    }
    this.mode=VALUE;
  }
  if (this.mode == VALUE) {
    this.mode=SEPERATOR;
    pm.pushTryParser(new ExpressionParser(this),token,true);
    return true;
  }
  if (this.mode == SEPERATOR) {
    if (type == Tokens.COMMA) {
      this.mode=NAME | VALUE;
      return true;
    }
  }
  return false;
}
Program: 85198
Project: 85198
Buggy source:
@Override public void check(List<Marker> markers,IContext context){
  if (this.instance != null) {
    this.instance.check(markers,context);
  }
  for (  IValue v : this.arguments) {
    v.check(markers,context);
  }
  if (this.method != null) {
    if (this.method.hasTypeVariables()) {
      this.typeArguments=this.method.getTypeMap(this.instance,this.arguments,this.generics);
    }
    this.method.checkArguments(markers,this.instance,this.arguments,this.typeArguments);
    if (this.method.hasModifier(Modifiers.DEPRECATED)) {
      markers.add(Markers.create(this.position,"String_Node_Str",this.name));
    }
    byte access=context.getAccessibility(this.method);
    if (access == IContext.STATIC) {
      markers.add(Markers.create(this.position,"String_Node_Str",this.name));
    }
 else     if (access == IContext.SEALED) {
      markers.add(Markers.create(this.position,"String_Node_Str",this.name));
    }
 else     if ((access & IContext.READ_ACCESS) == 0) {
      markers.add(Markers.create(this.position,"String_Node_Str",this.name));
    }
  }
}

Fixed version (ground truth):
@Override public void check(List<Marker> markers,IContext context){
  if (this.instance != null) {
    this.instance.check(markers,context);
  }
  for (  IValue v : this.arguments) {
    v.check(markers,context);
  }
  if (this.method != null) {
    if (this.typeArguments == null && this.method.hasTypeVariables()) {
      this.typeArguments=this.method.getTypeMap(this.instance,this.arguments,this.generics);
    }
    this.method.checkArguments(markers,this.instance,this.arguments,this.typeArguments);
    if (this.method.hasModifier(Modifiers.DEPRECATED)) {
      markers.add(Markers.create(this.position,"String_Node_Str",this.name));
    }
    byte access=context.getAccessibility(this.method);
    if (access == IContext.STATIC) {
      markers.add(Markers.create(this.position,"String_Node_Str",this.name));
    }
 else     if (access == IContext.SEALED) {
      markers.add(Markers.create(this.position,"String_Node_Str",this.name));
    }
 else     if ((access & IContext.READ_ACCESS) == 0) {
      markers.add(Markers.create(this.position,"String_Node_Str",this.name));
    }
  }
}
Program: 85199
Project: 85199
Buggy source:
@Override public boolean isType(IType type){
  if (type == Type.NONE || type == Type.VOID) {
    return true;
  }
  if (this.method == null) {
    return false;
  }
  if (this.type == null) {
    this.type=this.typeArguments != null ? this.method.getType(this.typeArguments) : this.method.getType();
  }
  return Type.isSuperType(type,this.type);
}

Fixed version (ground truth):
@Override public boolean isType(IType type){
  if (type == Type.NONE || type == Type.VOID) {
    return true;
  }
  if (this.method == null) {
    return false;
  }
  return Type.isSuperType(type,this.getType());
}
Program: 85200
Project: 85200
Buggy source:
@Override public IType getType(){
  if (this.method == null) {
    return Type.NONE;
  }
  if (this.type == null) {
    this.type=this.typeArguments != null ? this.method.getType(this.typeArguments) : this.method.getType();
  }
  return this.type;
}

Fixed version (ground truth):
@Override public IType getType(){
  if (this.method == null) {
    return Type.NONE;
  }
  if (this.type == null) {
    if (this.method.hasTypeVariables()) {
      if (this.typeArguments == null) {
        this.typeArguments=this.method.getTypeMap(this.instance,this.arguments,this.generics);
      }
      return this.type=this.method.getType(this.typeArguments);
    }
    return this.type=this.method.getType();
  }
  return this.type;
}
Program: 85201
Project: 85201
Buggy source:
@Override public void check(List<Marker> markers,IContext context){
  if (this.annotations != null) {
    for (    Annotation a : this.annotations) {
      a.check(markers,context);
    }
  }
  this.value.check(markers,context);
  IValue value1=this.value.withType(this.type);
  if (value1 == null) {
    Marker marker=Markers.create(this.value.getPosition(),"String_Node_Str",this.name);
    marker.addInfo("String_Node_Str" + this.type);
    marker.addInfo("String_Node_Str" + this.value.getType());
    markers.add(marker);
  }
 else {
    this.value=value1;
  }
}

Fixed version (ground truth):
@Override public void check(List<Marker> markers,IContext context){
  if (this.annotations != null) {
    for (    Annotation a : this.annotations) {
      a.check(markers,context);
    }
  }
  IValue value1=this.value.withType(this.type);
  if (value1 == null) {
    Marker marker=Markers.create(this.value.getPosition(),"String_Node_Str",this.name);
    marker.addInfo("String_Node_Str" + this.type);
    marker.addInfo("String_Node_Str" + this.value.getType());
    markers.add(marker);
  }
 else {
    this.value=value1;
  }
  this.value.check(markers,context);
}
Program: 85202
Project: 85202
Buggy source:
@Override public Map<String,IType> getTypeMap(IValue instance,List<IValue> arguments,List<IType> typeArguments){
  Map<String,IType> map=new HashMap();
  if (typeArguments != null) {
    int len=Math.min(generics.size(),typeArguments.size());
    for (int i=0; i < len; i++) {
      ITypeVariable var=generics.get(i);
      IType type=typeArguments.get(i);
      map.put(var.getQualifiedName(),type);
    }
  }
  int len=arguments.size();
  int mods=this.modifiers & Modifiers.INFIX;
  if (instance != null && mods == Modifiers.INFIX) {
    instance.addGenerics(this.parameters.get(0).type,map);
    len--;
    for (int i=0; i < len; i++) {
      Parameter par=this.parameters.get(i + 1);
      IValue v=arguments.get(i);
      v.addGenerics(par.type,map);
    }
    return map;
  }
  if (instance == null && len == 1 && (this.modifiers & Modifiers.PREFIX) != 0) {
    arguments.get(0).addGenerics(this.parameters.get(0).type,map);
    return map;
  }
  if (instance != null) {
    instance.addGenerics(this.theClass.getThisType(),map);
  }
  for (int i=0; i < len; i++) {
    Parameter par=this.parameters.get(i);
    IValue v=arguments.get(i);
    v.addGenerics(par.type,map);
  }
  return map;
}

Fixed version (ground truth):
@Override public Map<String,IType> getTypeMap(IValue instance,List<IValue> arguments,List<IType> typeArguments){
  Map<String,IType> map=new HashMap();
  if (typeArguments != null) {
    int len=Math.min(generics.size(),typeArguments.size());
    for (int i=0; i < len; i++) {
      ITypeVariable var=generics.get(i);
      IType type=typeArguments.get(i);
      map.put(var.getQualifiedName(),type);
    }
  }
  int len=arguments.size();
  int mods=this.modifiers & Modifiers.INFIX;
  if (instance != null && mods == Modifiers.INFIX) {
    instance.addTypeVariables(this.parameters.get(0).type,map);
    len--;
    for (int i=0; i < len; i++) {
      Parameter par=this.parameters.get(i + 1);
      IValue v=arguments.get(i);
      v.addTypeVariables(par.type,map);
    }
    return map;
  }
  if (instance == null && len == 1 && (this.modifiers & Modifiers.PREFIX) != 0) {
    arguments.get(0).addTypeVariables(this.parameters.get(0).type,map);
    return map;
  }
  if (instance != null) {
    instance.addTypeVariables(this.theClass.getThisType(),map);
  }
  for (int i=0; i < len; i++) {
    Parameter par=this.parameters.get(i);
    IValue v=arguments.get(i);
    v.addTypeVariables(par.type,map);
  }
  return map;
}
Program: 85204
Project: 85204
Buggy source:
@Override public void addTypeVariables(Map<String,IType> types){
  List<ITypeVariable> variables=this.theClass.getTypeVariables();
  if (variables != null) {
    int len=Math.min(this.generics.size(),variables.size());
    for (int i=0; i < len; i++) {
      ITypeVariable var=variables.get(i);
      IType type=this.generics.get(i);
      types.put(var.getQualifiedName(),type);
    }
  }
}

Fixed version (ground truth):
@Override public void addTypeVariables(IType type,Map<String,IType> typeVariables){
  if (type instanceof ITypeVariable) {
    if (type.isSuperTypeOf(this)) {
      if (this.arrayDimensions > 0) {
        typeVariables.put(type.getQualifiedName(),this.getArrayType(this.arrayDimensions - type.getArrayDimensions()));
      }
 else {
        typeVariables.put(type.getQualifiedName(),this);
      }
    }
  }
 else   if (type instanceof GenericType) {
    List<IType> types=((GenericType)type).generics;
    int len=Math.min(this.generics.size(),types.size());
    for (int i=0; i < len; i++) {
      IType t1=types.get(i);
      IType t2=this.generics.get(i);
      System.out.println(t1 + "String_Node_Str" + t2);
      t1.addTypeVariables(t2,typeVariables);
      t2.addTypeVariables(t1,typeVariables);
    }
  }
}
Program: 85205
Project: 85205
Buggy source:
public default void addTypeVariables(Map<String,IType> typeVariables){
}

Fixed version (ground truth):
public default void addTypeVariables(IType type,Map<String,IType> typeVariables){
}
Program: 85206
Project: 85206
Buggy source:
public static void findUnits(File source,File output,Package pack){
  if (!source.exists()) {
    logger.warning(source.getPath() + "String_Node_Str");
    return;
  }
 else   if (source.isDirectory()) {
    String name=source.getName();
    for (    String s : source.list()) {
      findUnits(new CodeFile(source,s),new File(output,s),pack.createSubPackage(name));
    }
    return;
  }
 else {
    String fileName=source.getPath();
    if (!config.compileFile(fileName)) {
      return;
    }
    if (fileName.endsWith("String_Node_Str") || fileName.endsWith("String_Node_Str")) {
      return;
    }
 else     if (fileName.endsWith("String_Node_Str")) {
      CompilationUnit unit=new CompilationUnit(pack,(CodeFile)source,output);
      output=unit.outputFile;
      pack.addCompilationUnit(unit);
      units.add(unit);
    }
    files.add(output);
  }
}

Fixed version (ground truth):
public static void findUnits(File source,File output,Package pack){
  if (source.isDirectory()) {
    String name=source.getName();
    for (    String s : source.list()) {
      findUnits(new CodeFile(source,s),new File(output,s),pack.createSubPackage(name));
    }
    return;
  }
  String fileName=source.getPath();
  if (!config.compileFile(fileName)) {
    return;
  }
  if (fileName.endsWith("String_Node_Str") || fileName.endsWith("String_Node_Str")) {
    return;
  }
 else   if (fileName.endsWith("String_Node_Str")) {
    CompilationUnit unit=new CompilationUnit(pack,(CodeFile)source,output);
    output=unit.outputFile;
    pack.addCompilationUnit(unit);
    units.add(unit);
  }
  files.add(output);
}
Program: 85208
Project: 85208
Buggy source:
public static IClass loadClass(BytecodeClass bclass,InputStream is,boolean decompile){
  try {
    jdk.internal.org.objectweb.asm.ClassReader reader=new jdk.internal.org.objectweb.asm.ClassReader(is);
    ClassReader visitor=new ClassReader(bclass);
    reader.accept(visitor,0);
    return bclass;
  }
 catch (  IOException ex) {
    ex.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public static IClass loadClass(BytecodeClass bclass,InputStream is,boolean decompile){
  try {
    jdk.internal.org.objectweb.asm.ClassReader reader=new jdk.internal.org.objectweb.asm.ClassReader(is);
    ClassReader visitor=new ClassReader(bclass);
    reader.accept(visitor,0);
    return bclass;
  }
 catch (  IOException ex) {
    DyvilCompiler.logger.throwing("String_Node_Str","String_Node_Str",ex);
  }
  return null;
}
Program: 85209
Project: 85209
Buggy source:
public static void saveClass(File file,IClass iclass){
  createFile(file);
  try (OutputStream os=new BufferedOutputStream(new FileOutputStream(file))){
    jdk.internal.org.objectweb.asm.ClassWriter writer=new jdk.internal.org.objectweb.asm.ClassWriter(Opcodes.ASM5);
    iclass.write(writer);
    writer.visitEnd();
    byte[] bytes=writer.toByteArray();
    os.write(bytes,0,bytes.length);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    DyvilCompiler.logger.throwing("String_Node_Str","String_Node_Str",ex);
  }
}

Fixed version (ground truth):
public static void saveClass(File file,IClass iclass){
  createFile(file);
  try (OutputStream os=new BufferedOutputStream(new FileOutputStream(file))){
    jdk.internal.org.objectweb.asm.ClassWriter writer=new jdk.internal.org.objectweb.asm.ClassWriter(Opcodes.ASM5);
    iclass.write(writer);
    writer.visitEnd();
    byte[] bytes=writer.toByteArray();
    os.write(bytes,0,bytes.length);
  }
 catch (  Exception ex) {
    DyvilCompiler.logger.throwing("String_Node_Str","String_Node_Str",ex);
  }
}
Program: 85210
Project: 85210
Buggy source:
public void load(){
  try {
    this.code=new String(Files.readAllBytes(this.toPath()));
  }
 catch (  IOException ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public void load(){
  try {
    this.code=new String(Files.readAllBytes(this.toPath()),StandardCharsets.UTF_8);
  }
 catch (  IOException ex) {
    DyvilCompiler.logger.throwing("String_Node_Str","String_Node_Str",ex);
  }
}
Program: 85211
Project: 85211
Buggy source:
protected void parseToken(Parser parser,IToken token) throws SyntaxError {
  boolean parsed;
  try {
    parsed=parser.parse(this,token);
  }
 catch (  SyntaxError error) {
    throw error;
  }
catch (  Exception ex) {
    String message=ex.getMessage();
    if (message == null) {
      message=ex.getClass().getName();
    }
    ex.printStackTrace();
    throw new SyntaxError(token,"String_Node_Str" + token.getText() + "String_Node_Str"+ message);
  }
  if (!parsed) {
    throw new SyntaxError(token,"String_Node_Str" + token.getText() + "String_Node_Str");
  }
}

Fixed version (ground truth):
protected void parseToken(Parser parser,IToken token) throws SyntaxError {
  boolean parsed;
  try {
    parsed=parser.parse(this,token);
  }
 catch (  SyntaxError error) {
    throw error;
  }
catch (  Exception ex) {
    String message=ex.getMessage();
    if (message == null) {
      message=ex.getClass().getName();
    }
    DyvilCompiler.logger.throwing("String_Node_Str","String_Node_Str",ex);
    throw new SyntaxError(token,"String_Node_Str" + token.getText() + "String_Node_Str"+ message);
  }
  if (!parsed) {
    throw new SyntaxError(token,"String_Node_Str" + token.getText() + "String_Node_Str");
  }
}
Program: 85212
Project: 85212
Buggy source:
public final void parse(CodeFile file,TokenIterator tokens){
  IToken token=null;
  this.tokens=tokens;
  this.file=file;
  try {
    IToken prev=null;
    while (tokens.hasNext()) {
      token=tokens.next();
      if (!this.retainToken((Token)token,prev)) {
        tokens.remove();
      }
      prev=token;
    }
    int index=0;
    tokens.reset();
    while (tokens.hasNext()) {
      token=tokens.next();
      token.setIndex(index);
      token.setPrev(prev);
      index++;
      prev=token;
    }
    tokens.reset();
    while (tokens.hasNext()) {
      token=this.currentToken=tokens.next();
      if (this.skip > 0) {
        this.skip--;
        continue;
      }
      Parser parser=this.currentParser;
      try {
        this.parseToken(parser,token);
      }
 catch (      SyntaxError ex) {
        if (this.jumpBackToken != null) {
          tokens.jump(this.jumpBackToken);
          this.popParser();
          this.jumpBackToken=null;
        }
 else {
          this.file.markers.add(ex);
        }
      }
      if (DyvilCompiler.parseStack) {
        System.out.println(token + "String_Node_Str" + parser.name+ "String_Node_Str"+ parser.mode);
      }
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public final void parse(CodeFile file,TokenIterator tokens){
  IToken token=null;
  this.tokens=tokens;
  this.file=file;
  try {
    IToken prev=null;
    while (tokens.hasNext()) {
      token=tokens.next();
      if (!this.retainToken((Token)token,prev)) {
        tokens.remove();
      }
      prev=token;
    }
    int index=0;
    tokens.reset();
    while (tokens.hasNext()) {
      token=tokens.next();
      token.setIndex(index);
      token.setPrev(prev);
      index++;
      prev=token;
    }
    tokens.reset();
    while (tokens.hasNext()) {
      token=this.currentToken=tokens.next();
      if (this.skip > 0) {
        this.skip--;
        continue;
      }
      Parser parser=this.currentParser;
      try {
        this.parseToken(parser,token);
      }
 catch (      SyntaxError ex) {
        if (this.jumpBackToken != null) {
          tokens.jump(this.jumpBackToken);
          this.popParser();
          this.jumpBackToken=null;
        }
 else {
          this.file.markers.add(ex);
        }
      }
      if (DyvilCompiler.parseStack) {
        System.out.println(token + "String_Node_Str" + parser.name+ "String_Node_Str"+ parser.mode);
      }
    }
  }
 catch (  Exception ex) {
    DyvilCompiler.logger.throwing("String_Node_Str","String_Node_Str",ex);
  }
}
Program: 85213
Project: 85213
Buggy source:
@Override public void writeExpression(MethodWriter writer){
  this.method.writeCall(writer,this.instance,this.arguments);
  if (this.type != null && this.type != this.method.getType()) {
    writer.visitTypeInsn(Opcodes.CHECKCAST,this.type);
  }
}

Fixed version (ground truth):
@Override public void writeExpression(MethodWriter writer){
  this.method.writeCall(writer,this.instance,this.arguments);
  if (this.type != null) {
    IType methodType=this.method.getType();
    if (this.type != methodType && !Type.isSuperType(this.type,methodType)) {
      writer.visitTypeInsn(Opcodes.CHECKCAST,this.type);
    }
  }
}
Program: 85214
Project: 85214
Buggy source:
@Override public void resolveTypes(List<Marker> markers,IContext context){
  this.typesResolved=true;
  if (this.generics != null) {
    for (    ITypeVariable v : this.generics) {
      v.resolveTypes(markers,context);
    }
  }
  if (this.superType != null) {
    if (this.superType.isName("String_Node_Str")) {
      this.superType=null;
    }
 else {
      this.superType=this.superType.resolve(markers,context);
    }
  }
  for (ListIterator<IType> iterator=this.interfaces.listIterator(); iterator.hasNext(); ) {
    IType i1=iterator.next();
    IType i2=i1.resolve(markers,context);
    if (i1 != i2) {
      iterator.set(i2);
    }
  }
  if (this.annotations != null) {
    for (    Annotation a : this.annotations) {
      a.resolveTypes(markers,context);
    }
  }
  this.body.resolveTypes(markers,this);
  if (this.outerType != null) {
    this.outerClass=this.outerType.resolve(markers,context).getTheClass();
  }
  if (this.innerTypes != null) {
    for (    IType t : this.innerTypes) {
      IClass iclass=t.resolve(markers,context).getTheClass();
      this.body.addClass(iclass);
    }
    this.innerTypes=null;
  }
}

Fixed version (ground truth):
@Override public void resolveTypes(List<Marker> markers,IContext context){
  this.typesResolved=true;
  if (this.generics != null) {
    GenericType type=new GenericType(this);
    for (    ITypeVariable v : this.generics) {
      v.resolveTypes(markers,context);
      type.addType(new WildcardType(null,0,v.getCaptureClass()));
    }
    this.type=type;
  }
  if (this.superType != null) {
    if (this.superType.isName("String_Node_Str")) {
      this.superType=null;
    }
 else {
      this.superType=this.superType.resolve(markers,context);
    }
  }
  for (ListIterator<IType> iterator=this.interfaces.listIterator(); iterator.hasNext(); ) {
    IType i1=iterator.next();
    IType i2=i1.resolve(markers,context);
    if (i1 != i2) {
      iterator.set(i2);
    }
  }
  if (this.annotations != null) {
    for (    Annotation a : this.annotations) {
      a.resolveTypes(markers,context);
    }
  }
  this.body.resolveTypes(markers,this);
  if (this.outerType != null) {
    this.outerClass=this.outerType.resolve(markers,context).getTheClass();
  }
  if (this.innerTypes != null) {
    for (    IType t : this.innerTypes) {
      IClass iclass=t.resolve(markers,context).getTheClass();
      this.body.addClass(iclass);
    }
    this.innerTypes=null;
  }
}
Program: 85215
Project: 85215
Buggy source:
@Override public void resolveTypes(List<Marker> markers,IContext context){
  if (this.generics != null) {
    for (    ITypeVariable v : this.generics) {
      v.resolveTypes(markers,context);
    }
  }
  if (this.superType != null) {
    if (this.superType.isName("String_Node_Str")) {
      this.superType=null;
    }
 else {
      this.superType=this.superType.resolve(markers,context);
    }
  }
  for (ListIterator<IType> iterator=this.interfaces.listIterator(); iterator.hasNext(); ) {
    IType i1=iterator.next();
    IType i2=i1.resolve(markers,context);
    if (i1 != i2) {
      iterator.set(i2);
    }
  }
  if (this.annotations != null) {
    for (    Annotation a : this.annotations) {
      a.resolveTypes(markers,this);
    }
  }
  if (this.body != null) {
    this.body.resolveTypes(markers,this);
    for (    IMethod m : this.body.methods) {
      if (m.isName("String_Node_Str")) {
        return;
      }
    }
  }
  Method constructor=new Method(this);
  constructor.setName("String_Node_Str","String_Node_Str");
  constructor.setType(Type.VOID);
  constructor.setModifiers(Modifiers.PUBLIC | Modifiers.SYNTHETIC);
  this.constructor=constructor;
  if (this.superType != null) {
    MethodMatch match=this.superType.resolveConstructor(Util.EMPTY_VALUES);
    if (match != null) {
      this.superConstructor=match.theMethod;
    }
  }
}

Fixed version (ground truth):
@Override public void resolveTypes(List<Marker> markers,IContext context){
  if (this.generics != null) {
    GenericType type=new GenericType(this);
    for (    ITypeVariable v : this.generics) {
      v.resolveTypes(markers,context);
      type.addType(new WildcardType(null,0,v.getCaptureClass()));
    }
    this.type=type;
  }
  if (this.superType != null) {
    if (this.superType.isName("String_Node_Str")) {
      this.superType=null;
    }
 else {
      this.superType=this.superType.resolve(markers,context);
    }
  }
  for (ListIterator<IType> iterator=this.interfaces.listIterator(); iterator.hasNext(); ) {
    IType i1=iterator.next();
    IType i2=i1.resolve(markers,context);
    if (i1 != i2) {
      iterator.set(i2);
    }
  }
  if (this.annotations != null) {
    for (    Annotation a : this.annotations) {
      a.resolveTypes(markers,this);
    }
  }
  if (this.body != null) {
    this.body.resolveTypes(markers,this);
    for (    IMethod m : this.body.methods) {
      if (m.isName("String_Node_Str")) {
        return;
      }
    }
  }
  Method constructor=new Method(this);
  constructor.setName("String_Node_Str","String_Node_Str");
  constructor.setType(Type.VOID);
  constructor.setModifiers(Modifiers.PUBLIC | Modifiers.SYNTHETIC);
  this.constructor=constructor;
  if (this.superType != null) {
    MethodMatch match=this.superType.resolveConstructor(Util.EMPTY_VALUES);
    if (match != null) {
      this.superConstructor=match.theMethod;
    }
  }
}
Program: 85216
Project: 85216
Buggy source:
@Override public Type getThisType(){
  return new Type(this);
}

Fixed version (ground truth):
@Override public Type getThisType(){
  return this.type;
}
Program: 85217
Project: 85217
Buggy source:
public IClass getCaptureClass();

Fixed version (ground truth):
public CaptureClass getCaptureClass();
Program: 85218
Project: 85218
Buggy source:
@Override public IClass getCaptureClass(){
  return this.captureClass;
}

Fixed version (ground truth):
@Override public CaptureClass getCaptureClass(){
  return this.captureClass;
}
Program: 85219
Project: 85219
Buggy source:
@Override public IType getConcreteType(Map<String,IType> typeVariables){
  if (this.name != null) {
    IType t=typeVariables.get(this.name);
    if (t != null) {
      if (this.arrayDimensions > 0) {
        return t.getArrayType(this.arrayDimensions);
      }
      return t;
    }
  }
  return this;
}

Fixed version (ground truth):
@Override public IType getConcreteType(Map<String,IType> typeVariables){
  if (this.name != null) {
    IType t=typeVariables.get(this.name);
    if (t != null) {
      if (this.arrayDimensions > 0) {
        return t.getArrayType(this.arrayDimensions);
      }
      return t;
    }
  }
  WildcardType type=new WildcardType(this.position);
  if (this.lowerBound != null) {
    type.lowerBound=this.lowerBound.getConcreteType(typeVariables);
  }
  if (this.upperBound != null) {
    type.upperBound=this.upperBound.getConcreteType(typeVariables);
  }
  if (this.upperBounds != null) {
    int len=this.upperBounds.size();
    if (len > 0) {
      type.upperBounds=new ArrayList(len);
      for (int i=0; i < len; i++) {
        type.upperBounds.add(this.upperBounds.get(i).getConcreteType(typeVariables));
      }
    }
  }
  return type;
}
Program: 85220
Project: 85220
Buggy source:
@Override public void addTypeVariables(IType type,Map<String,IType> typeVariables){
  if (this.name != null && this.isSuperTypeOf(type)) {
    typeVariables.put(this.name,type);
  }
  if (this.upperBound != null) {
    this.upperBound.addTypeVariables(type,typeVariables);
  }
  for (  IType t : this.upperBounds) {
    t.addTypeVariables(type,typeVariables);
  }
}

Fixed version (ground truth):
@Override public void addTypeVariables(IType type,Map<String,IType> typeVariables){
  if (this.name != null) {
    typeVariables.put(this.name,type);
  }
  if (this.upperBound != null) {
    type.addTypeVariables(this.upperBound,typeVariables);
  }
  if (this.upperBounds != null) {
    for (    IType t : this.upperBounds) {
      type.addTypeVariables(t,typeVariables);
    }
  }
}
Program: 85221
Project: 85221
Buggy source:
@Override public String getInternalName(){
  return this.upperBound == null ? "String_Node_Str" : this.upperBound.getInternalName();
}

Fixed version (ground truth):
@Override public String getInternalName(){
  if (this.upperBound != null) {
    return this.upperBound.getInternalName();
  }
  if (this.upperBounds != null && !this.upperBounds.isEmpty()) {
    return this.upperBounds.get(0).getInternalName();
  }
  return "String_Node_Str";
}
Program: 85222
Project: 85222
Buggy source:
@Override public GenericType clone(){
  GenericType t=new GenericType();
  t.theClass=this.theClass;
  t.name=this.name;
  t.qualifiedName=this.qualifiedName;
  t.fullName=this.fullName;
  t.arrayDimensions=this.arrayDimensions;
  t.generics=new ArrayList(this.generics);
  return t;
}

Fixed version (ground truth):
@Override public GenericType clone(){
  GenericType t=new GenericType();
  t.theClass=this.theClass;
  t.name=this.name;
  t.qualifiedName=this.qualifiedName;
  t.fullName=this.fullName;
  t.arrayDimensions=this.arrayDimensions;
  if (this.generics != null) {
    t.generics=new ArrayList(this.generics);
  }
  return t;
}
Program: 85223
Project: 85223
Buggy source:
@Override public IType getConcreteType(Map<String,IType> typeVariables){
  IType t=super.getConcreteType(typeVariables);
  if (t != this) {
    return t;
  }
  GenericType copy=this.clone();
  int len=this.generics.size();
  for (int i=0; i < len; i++) {
    IType t1=this.generics.get(i);
    copy.generics.set(i,t1.getConcreteType(typeVariables));
  }
  return copy;
}

Fixed version (ground truth):
@Override public IType getConcreteType(Map<String,IType> typeVariables){
  IType t=super.getConcreteType(typeVariables);
  if (t != this) {
    return t;
  }
  GenericType copy=this.clone();
  if (this.generics != null) {
    int len=this.generics.size();
    for (int i=0; i < len; i++) {
      IType t1=this.generics.get(i);
      copy.generics.set(i,t1.getConcreteType(typeVariables));
    }
  }
  return copy;
}
Program: 85224
Project: 85224
Buggy source:
@Override public void addTypeVariables(IType type,Map<String,IType> typeVariables){
  if (type instanceof ITypeVariable) {
    if (type.isSuperTypeOf(this)) {
      if (this.arrayDimensions > 0) {
        typeVariables.put(type.getQualifiedName(),this.getArrayType(this.arrayDimensions - type.getArrayDimensions()));
      }
 else {
        typeVariables.put(type.getQualifiedName(),this);
      }
    }
  }
  if (this.generics != null) {
    if (type instanceof GenericType) {
      List<IType> types=((GenericType)type).generics;
      int len=Math.min(this.generics.size(),types.size());
      for (int i=0; i < len; i++) {
        IType t1=types.get(i);
        IType t2=this.generics.get(i);
        t1.addTypeVariables(t2,typeVariables);
        t2.addTypeVariables(t1,typeVariables);
      }
    }
    List<ITypeVariable> variables=this.theClass.getTypeVariables();
    if (variables != null) {
      int len=Math.min(this.generics.size(),variables.size());
      for (int i=0; i < len; i++) {
        ITypeVariable var=variables.get(i);
        IType type1=this.generics.get(i);
        typeVariables.put(var.getQualifiedName(),type);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void addTypeVariables(IType type,Map<String,IType> typeVariables){
  if (this.generics != null) {
    if (type instanceof GenericType) {
      List<IType> types=((GenericType)type).generics;
      int len=Math.min(this.generics.size(),types.size());
      for (int i=0; i < len; i++) {
        IType t1=types.get(i);
        IType t2=this.generics.get(i);
        if (!t2.equals(t1) && !t1.equals(t2)) {
          return;
        }
        t2.addTypeVariables(t1,typeVariables);
      }
      return;
    }
  }
  if (type instanceof ITypeVariable) {
    type.addTypeVariables(this,typeVariables);
  }
}