nus-yam/ex-repair huggingface dataset:
Program: 84750
Project: 84750
Buggy source:
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type == Types.CHAR) {
    return this;
  }
  if (type.isSuperTypeOf(Types.CHAR)) {
    return new BoxedValue(this,Types.CHAR.boxMethod);
  }
  if (type.getTheClass().getAnnotation(CHAR_CONVERTIBLE) != null) {
    return new LiteralExpression(type,this);
  }
  return null;
}

Fixed version (ground truth):
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type == Types.CHAR) {
    return this;
  }
  if (type.isSuperTypeOf(Types.CHAR)) {
    return new BoxedValue(this,Types.CHAR.boxMethod);
  }
  if (type.getTheClass().getAnnotation(CHAR_CONVERTIBLE) != null) {
    return new LiteralExpression(this).withType(type,typeContext,markers,context);
  }
  return null;
}
Program: 84751
Project: 84751
Buggy source:
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type == Types.DOUBLE) {
    return this;
  }
  if (type.isSuperTypeOf(Types.DOUBLE)) {
    return new BoxedValue(this,Types.DOUBLE.boxMethod);
  }
  if (type.getTheClass().getAnnotation(DOUBLE_CONVERTIBLE) != null) {
    return new LiteralExpression(type,this);
  }
  return null;
}

Fixed version (ground truth):
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type == Types.DOUBLE) {
    return this;
  }
  if (type.isSuperTypeOf(Types.DOUBLE)) {
    return new BoxedValue(this,Types.DOUBLE.boxMethod);
  }
  if (type.getTheClass().getAnnotation(DOUBLE_CONVERTIBLE) != null) {
    return new LiteralExpression(this).withType(type,typeContext,markers,context);
  }
  return null;
}
Program: 84752
Project: 84752
Buggy source:
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type == Types.FLOAT) {
    return this;
  }
  if (type.isSuperTypeOf(Types.FLOAT)) {
    return new BoxedValue(this,Types.FLOAT.boxMethod);
  }
  if (type.getTheClass().getAnnotation(FLOAT_CONVERTIBLE) != null) {
    return new LiteralExpression(type,this);
  }
  return null;
}

Fixed version (ground truth):
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type == Types.FLOAT) {
    return this;
  }
  if (type.isSuperTypeOf(Types.FLOAT)) {
    return new BoxedValue(this,Types.FLOAT.boxMethod);
  }
  if (type.getTheClass().getAnnotation(FLOAT_CONVERTIBLE) != null) {
    return new LiteralExpression(this).withType(type,typeContext,markers,context);
  }
  return null;
}
Program: 84753
Project: 84753
Buggy source:
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type == Types.INT) {
    return this;
  }
  if (type.isSuperTypeOf(Types.INT)) {
    return new BoxedValue(this,Types.INT.boxMethod);
  }
  if (type.getTheClass().getAnnotation(INT_CONVERTIBLE) != null) {
    return new LiteralExpression(type,this);
  }
  return null;
}

Fixed version (ground truth):
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type == Types.INT) {
    return this;
  }
  if (type.isSuperTypeOf(Types.INT)) {
    return new BoxedValue(this,Types.INT.boxMethod);
  }
  if (type.getTheClass().getAnnotation(INT_CONVERTIBLE) != null) {
    return new LiteralExpression(this).withType(type,typeContext,markers,context);
  }
  return null;
}
Program: 84754
Project: 84754
Buggy source:
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type == Types.LONG) {
    return this;
  }
  if (type.isSuperTypeOf(Types.LONG)) {
    return new BoxedValue(this,Types.LONG.boxMethod);
  }
  if (type.getTheClass().getAnnotation(LONG_CONVERTIBLE) != null) {
    return new LiteralExpression(type,this);
  }
  return null;
}

Fixed version (ground truth):
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type == Types.LONG) {
    return this;
  }
  if (type.isSuperTypeOf(Types.LONG)) {
    return new BoxedValue(this,Types.LONG.boxMethod);
  }
  if (type.getTheClass().getAnnotation(LONG_CONVERTIBLE) != null) {
    return new LiteralExpression(this).withType(type,typeContext,markers,context);
  }
  return null;
}
Program: 84755
Project: 84755
Buggy source:
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type.isSuperTypeOf(Types.STRING)) {
    return this;
  }
  if (type.getTheClass().getAnnotation(STRING_CONVERTIBLE) != null) {
    return new LiteralExpression(type,this);
  }
  return null;
}

Fixed version (ground truth):
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type.isSuperTypeOf(Types.STRING)) {
    return this;
  }
  if (type.getTheClass().getAnnotation(STRING_CONVERTIBLE) != null) {
    return new LiteralExpression(this).withType(type,typeContext,markers,context);
  }
  return null;
}
Program: 84756
Project: 84756
Buggy source:
@Override public IValue withType(IType arrayType,ITypeContext typeContext,MarkerList markers,IContext context){
  if (!arrayType.isArrayType()) {
    IClass iclass=arrayType.getTheClass();
    if (iclass == Types.OBJECT_CLASS || iclass == null) {
      return this;
    }
    if (iclass.getAnnotation(ARRAY_CONVERTIBLE) != null) {
      return new LiteralExpression(arrayType,this);
    }
    return null;
  }
  IType elementType=arrayType.getElementType();
  for (int i=0; i < this.valueCount; i++) {
    if (!this.values[i].isType(elementType)) {
      return null;
    }
  }
  for (int i=0; i < this.valueCount; i++) {
    IValue value=this.values[i];
    IValue value1=value.withType(elementType,typeContext,markers,context);
    if (value1 == null) {
      Marker marker=markers.create(value.getPosition(),"String_Node_Str");
      marker.addInfo("String_Node_Str" + this.requiredType);
      marker.addInfo("String_Node_Str" + value.getType());
    }
 else {
      value=value1;
      this.values[i]=value1;
    }
  }
  this.elementType=elementType;
  this.requiredType=arrayType;
  return this;
}

Fixed version (ground truth):
@Override public IValue withType(IType arrayType,ITypeContext typeContext,MarkerList markers,IContext context){
  if (!arrayType.isArrayType()) {
    IClass iclass=arrayType.getTheClass();
    if (iclass == Types.OBJECT_CLASS || iclass == null) {
      return this;
    }
    if (iclass.getAnnotation(ARRAY_CONVERTIBLE) != null) {
      return new LiteralExpression(this).withType(arrayType,typeContext,markers,context);
    }
    return null;
  }
  IType elementType=arrayType.getElementType();
  for (int i=0; i < this.valueCount; i++) {
    if (!this.values[i].isType(elementType)) {
      return null;
    }
  }
  for (int i=0; i < this.valueCount; i++) {
    IValue value=this.values[i];
    IValue value1=value.withType(elementType,typeContext,markers,context);
    if (value1 == null) {
      Marker marker=markers.create(value.getPosition(),"String_Node_Str");
      marker.addInfo("String_Node_Str" + this.requiredType);
      marker.addInfo("String_Node_Str" + value.getType());
    }
 else {
      value=value1;
      this.values[i]=value1;
    }
  }
  this.elementType=elementType;
  this.requiredType=arrayType;
  return this;
}
Program: 84757
Project: 84757
Buggy source:
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type.isSuperTypeOf(Types.STRING)) {
    return this;
  }
  IClass iclass=type.getTheClass();
  if (iclass.getAnnotation(StringValue.STRING_CONVERTIBLE) != null) {
    return new LiteralExpression(type,this);
  }
  if (iclass.getAnnotation(FORMAT_STRING_CONVERTIBLE) != null) {
    StringValue string;
    int len=this.count / 2;
    if (len > 0) {
      StringBuilder builder=new StringBuilder();
      builder.append(this.strings[0]);
      for (int i=1; i <= len; i++) {
        builder.append('\\').append(i);
        builder.append(this.strings[i]);
      }
      string=new StringValue(this.position,builder.toString());
    }
 else {
      string=new StringValue("String_Node_Str");
    }
    ArgumentList list=new ArgumentList(1 + len);
    list.addValue(string);
    for (int i=0; i < len; i++) {
      list.addValue(this.values[i]);
    }
    return new LiteralExpression(type,list);
  }
  return null;
}

Fixed version (ground truth):
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type.isSuperTypeOf(Types.STRING)) {
    return this;
  }
  IClass iclass=type.getTheClass();
  if (iclass.getAnnotation(StringValue.STRING_CONVERTIBLE) != null) {
    return new LiteralExpression(this).withType(type,typeContext,markers,context);
  }
  if (iclass.getAnnotation(FORMAT_STRING_CONVERTIBLE) != null) {
    StringValue string;
    int len=this.count / 2;
    if (len > 0) {
      StringBuilder builder=new StringBuilder();
      builder.append(this.strings[0]);
      for (int i=1; i <= len; i++) {
        builder.append('\\').append(i);
        builder.append(this.strings[i]);
      }
      string=new StringValue(this.position,builder.toString());
    }
 else {
      string=new StringValue("String_Node_Str");
    }
    ArgumentList list=new ArgumentList(1 + len);
    list.addValue(string);
    for (int i=0; i < len; i++) {
      list.addValue(this.values[i]);
    }
    return new LiteralExpression(list).withType(type,typeContext,markers,context);
  }
  return null;
}
Program: 84759
Project: 84759
Buggy source:
@Override public boolean isType(IType type){
  if (this.type != null && type.isSuperTypeOf(this.type)) {
    return true;
  }
  IClass iclass=type.getTheClass();
  if (iclass == null) {
    return false;
  }
  IMethod method=iclass.getFunctionalMethod();
  if (method == null) {
    return false;
  }
  if (this.parameterCount != method.parameterCount()) {
    return false;
  }
  for (int i=0; i < this.parameterCount; i++) {
    IParameter lambdaParam=this.parameters[i];
    IParameter param=method.getParameter(i);
    IType paramType=lambdaParam.getType();
    if (paramType == null) {
      continue;
    }
    if (!param.getType().equals(paramType)) {
      return false;
    }
  }
  this.type=type;
  this.method=method;
  return true;
}

Fixed version (ground truth):
@Override public boolean isType(IType type){
  if (this.type != null && type.isSuperTypeOf(this.type)) {
    return true;
  }
  IClass iclass=type.getTheClass();
  if (iclass == null) {
    return false;
  }
  IMethod method=iclass.getFunctionalMethod();
  if (method == null) {
    return false;
  }
  if (this.parameterCount != method.parameterCount()) {
    return false;
  }
  for (int i=0; i < this.parameterCount; i++) {
    IParameter lambdaParam=this.parameters[i];
    IParameter param=method.getParameter(i);
    IType lambdaParamType=lambdaParam.getType();
    if (lambdaParamType == null) {
      continue;
    }
    if (!param.getType().equals(lambdaParamType)) {
      return false;
    }
  }
  return true;
}
Program: 84760
Project: 84760
Buggy source:
public LiteralExpression(IType type,IArguments arguments){
  this.type=type;
  this.arguments=arguments;
}

Fixed version (ground truth):
public LiteralExpression(IArguments arguments){
  this.arguments=arguments;
}
Program: 84761
Project: 84761
Buggy source:
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  return this;
}

Fixed version (ground truth):
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  IMethod method=IContext.resolveMethod(type,null,Name.apply,this.arguments);
  if (method == null) {
    IValue value=this.arguments.getFirstValue();
    StringBuilder builder=new StringBuilder();
    this.arguments.typesToString(builder);
    markers.add(value.getPosition(),"String_Node_Str",value.getType().getName(),this.type.toString(),builder);
    this.type=type;
  }
 else {
    this.method=method;
    GenericData data=method.getGenericData(null,null,this.arguments);
    method.checkArguments(markers,null,context,null,this.arguments,data);
    this.type=method.getType().getConcreteType(data);
    if (!type.isSuperTypeOf(this.type)) {
      Marker m=markers.create(this.arguments.getFirstValue().getPosition(),"String_Node_Str");
      m.addInfo("String_Node_Str" + type);
      m.addInfo("String_Node_Str" + this.type);
      StringBuilder sb=new StringBuilder("String_Node_Str");
      Util.methodSignatureToString(method,sb);
      m.addInfo(sb.toString());
    }
  }
  return this;
}
Program: 84762
Project: 84762
Buggy source:
@Override public void checkTypes(MarkerList markers,IContext context){
  IMethod match=IContext.resolveMethod(this.type,null,Name.apply,this.arguments);
  if (match == null) {
    IValue value=this.arguments.getFirstValue();
    StringBuilder builder=new StringBuilder();
    this.arguments.typesToString(builder);
    markers.add(value.getPosition(),"String_Node_Str",value.getType().getName(),this.type.toString(),builder);
  }
 else {
    this.method=match;
    GenericData data=match.getGenericData(null,null,this.arguments);
    match.checkArguments(markers,null,context,null,this.arguments,data);
    this.type=match.getType().getConcreteType(data);
  }
  this.arguments.checkTypes(markers,context);
}

Fixed version (ground truth):
@Override public void checkTypes(MarkerList markers,IContext context){
  this.arguments.checkTypes(markers,context);
}
Program: 84763
Project: 84763
Buggy source:
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type.isSuperTypeOf(Types.STRING)) {
    return this;
  }
  if (type.getTheClass().getAnnotation(StringValue.STRING_CONVERTIBLE) != null) {
    return new LiteralExpression(type,this);
  }
  return null;
}

Fixed version (ground truth):
@Override public IValue withType(IType type,ITypeContext typeContext,MarkerList markers,IContext context){
  if (type.isSuperTypeOf(Types.STRING)) {
    return this;
  }
  if (type.getTheClass().getAnnotation(StringValue.STRING_CONVERTIBLE) != null) {
    return new LiteralExpression(this).withType(type,typeContext,markers,context);
  }
  return null;
}
Program: 84764
Project: 84764
Buggy source:
public FieldVisitor visitField(int access,String name,String desc,String signature,Object value){
  Field field=new ExternalField(this);
  field.setName(Name.get(name));
  field.setModifiers(access);
  field.setType(ClassFormat.extendedToType(desc));
  if (value != null) {
    field.setValue(IValue.fromObject(value));
  }
  if ((this.modifiers & Modifiers.OBJECT_CLASS) != 0 && name.equals("String_Node_Str")) {
    this.metadata.setInstanceField(field);
    return null;
  }
  this.body.addField(field);
  return new SimpleFieldVisitor(field);
}

Fixed version (ground truth):
public FieldVisitor visitField(int access,String name,String desc,String signature,Object value){
  Field field=new ExternalField(this);
  field.setName(Name.get(name));
  field.setModifiers(access);
  field.setType(ClassFormat.extendedToType(signature == null ? desc : signature));
  if (value != null) {
    field.setValue(IValue.fromObject(value));
  }
  if ((this.modifiers & Modifiers.OBJECT_CLASS) != 0 && name.equals("String_Node_Str")) {
    this.metadata.setInstanceField(field);
    return null;
  }
  this.body.addField(field);
  return new SimpleFieldVisitor(field);
}
Program: 84765
Project: 84765
Buggy source:
private void resolveReturnType(){
  this.returnTypeResolved=true;
  this.type=this.type.resolve(null,Package.rootPackage);
}

Fixed version (ground truth):
private void resolveReturnType(){
  this.returnTypeResolved=true;
  this.type=this.type.resolve(null,this.theClass);
}
Program: 84767
Project: 84767
Buggy source:
protected boolean argumentsMatch(IType type){
  for (int i=0; i < this.typeArgumentCount; i++) {
    ITypeVariable typeVar=this.theClass.getTypeVariable(i);
    IType otherType=type.resolveType(typeVar);
    if (!this.typeArguments[i].equals(otherType)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
protected boolean argumentsMatch(IType type){
  int count=this.theClass.genericCount();
  for (int i=0; i < count; i++) {
    ITypeVariable typeVar=this.theClass.getTypeVariable(i);
    IType otherType=type.resolveType(typeVar);
    if (!this.typeArguments[i].equals(otherType)) {
      return false;
    }
  }
  return true;
}
Program: 84768
Project: 84768
Buggy source:
private static int getMode(char c,String code,int i){
switch (c) {
case '`':
    return SPECIAL_IDENTIFIER;
case '#':
  if (code.charAt(i + 1) == '[') {
    return GENERIC_CALL;
  }
return IDENTIFIER | MOD_SYMBOL;
case '"':
return STRING;
case '\'':
return CHAR;
case '/':
char n=code.charAt(i + 1);
if (n == '*') {
return BLOCK_COMMENT;
}
 else if (n == '/') {
return LINE_COMMENT;
}
 else {
return IDENTIFIER | MOD_SYMBOL;
}
case '@':
n=code.charAt(i + 1);
if (n == '"') {
return STRING_2;
}
return IDENTIFIER | MOD_SYMBOL;
case '0':
n=code.charAt(i + 1);
if (n == 'b') {
return INT | MOD_BIN;
}
 else if (n == 'x') {
return INT | MOD_HEX;
}
 else if (isDigit(n)) {
return INT | MOD_OCT;
}
return INT;
case '(':
return Symbols.OPEN_PARENTHESIS;
case ')':
return Symbols.CLOSE_PARENTHESIS;
case '[':
return Symbols.OPEN_SQUARE_BRACKET;
case ']':
return Symbols.CLOSE_SQUARE_BRACKET;
case '{':
return Symbols.OPEN_CURLY_BRACKET;
case '}':
return Symbols.CLOSE_CURLY_BRACKET;
case '.':
n=code.charAt(i + 1);
if (n == '.') {
return IDENTIFIER | MOD_DOTS;
}
return Symbols.DOT;
case ';':
return Symbols.SEMICOLON;
case ',':
return Symbols.COMMA;
}
if (isDigit(c)) {
return INT;
}
 else if (isIdentifierSymbol(c)) {
return IDENTIFIER | MOD_SYMBOL;
}
 else if (isIdentifierPart(c)) {
return IDENTIFIER | MOD_LETTER;
}
return 0;
}

Fixed version (ground truth):
private static int getMode(char c,String code,int i){
switch (c) {
case '`':
    return SPECIAL_IDENTIFIER;
case '#':
  if (code.charAt(i + 1) == '[') {
    return GENERIC_CALL;
  }
return IDENTIFIER | MOD_SYMBOL;
case '"':
return STRING;
case '\'':
return CHAR;
case '/':
char n=code.charAt(i + 1);
if (n == '*') {
return BLOCK_COMMENT;
}
 else if (n == '/') {
return LINE_COMMENT;
}
 else {
return IDENTIFIER | MOD_SYMBOL;
}
case '@':
n=code.charAt(i + 1);
if (n == '"') {
return STRING_2;
}
return IDENTIFIER | MOD_SYMBOL;
case '0':
n=code.charAt(i + 1);
if (n == 'b') {
return INT | MOD_BIN;
}
 else if (n == 'x') {
return INT | MOD_HEX;
}
 else if (isDigit(n)) {
return INT | MOD_OCT;
}
return INT;
case '(':
return Symbols.OPEN_PARENTHESIS;
case ')':
return Symbols.CLOSE_PARENTHESIS;
case '[':
return Symbols.OPEN_SQUARE_BRACKET;
case ']':
return Symbols.CLOSE_SQUARE_BRACKET;
case '{':
return Symbols.OPEN_CURLY_BRACKET;
case '}':
return Symbols.CLOSE_CURLY_BRACKET;
case '.':
n=code.charAt(i + 1);
if (n == '.') {
return IDENTIFIER | MOD_DOTS;
}
return Symbols.DOT;
case ';':
return Symbols.SEMICOLON;
case ',':
return Symbols.COMMA;
case '_':
case '$':
return IDENTIFIER | MOD_SYMBOL | MOD_LETTER;
}
if (isDigit(c)) {
return INT;
}
 else if (isIdentifierSymbol(c)) {
return IDENTIFIER | MOD_SYMBOL;
}
 else if (isIdentifierPart(c)) {
return IDENTIFIER | MOD_LETTER;
}
return 0;
}
Program: 84770
Project: 84770
Buggy source:
@Override public void parse(IParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
  if (type == Symbols.SEMICOLON && token.isInferred()) {
    pm.popParser(true);
    return;
  }
  if (this.mode == 0) {
    this.mode=1;
    pm.pushParser(new TypeParser(this),true);
    return;
  }
  if (this.mode == 1) {
    if (ParserUtil.isCloseBracket(type)) {
      pm.popParser(true);
      return;
    }
    this.mode=0;
    if (ParserUtil.isSeperator(type)) {
      return;
    }
    throw new SyntaxError(token,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void parse(IParserManager pm,IToken token) throws SyntaxError {
  int type=token.type();
  if ((type == Symbols.SEMICOLON && token.isInferred()) || type == Symbols.OPEN_CURLY_BRACKET) {
    pm.popParser(true);
    return;
  }
  if (this.mode == 0) {
    this.mode=1;
    pm.pushParser(new TypeParser(this),true);
    return;
  }
  if (this.mode == 1) {
    if (ParserUtil.isCloseBracket(type)) {
      pm.popParser(true);
      return;
    }
    this.mode=0;
    if (ParserUtil.isSeperator(type)) {
      return;
    }
    throw new SyntaxError(token,"String_Node_Str");
  }
}
Program: 84771
Project: 84771
Buggy source:
private boolean computeVariable(REPLVariable field){
  this.currentClassName="String_Node_Str" + classIndex++;
  MarkerList markers=new MarkerList();
  field.resolveTypes(markers,this);
  field.resolve(markers,this);
  field.checkTypes(markers,this);
  field.check(markers,this);
  if (this.reportErrors(markers)) {
    return false;
  }
  field.foldConstants();
  for (  IClassCompilable icc : this.innerClassList) {
    try {
      String fileName=icc.getFileName();
      byte[] bytes=ClassWriter.compile(icc);
      ReflectUtils.unsafe.defineClass(fileName,bytes,0,bytes.length,null,null);
    }
 catch (    Throwable t) {
      t.printStackTrace();
    }
  }
  field.compute(this.currentClassName,this.compilableList);
  this.compilableList.clear();
  this.innerClassList.clear();
  return true;
}

Fixed version (ground truth):
private boolean computeVariable(REPLVariable field){
  this.currentClassName="String_Node_Str" + classIndex++;
  MarkerList markers=new MarkerList();
  field.resolveTypes(markers,this);
  field.resolve(markers,this);
  field.checkTypes(markers,this);
  field.check(markers,this);
  if (this.reportErrors(markers)) {
    this.compilableList.clear();
    this.innerClassList.clear();
    return false;
  }
  field.foldConstants();
  for (  IClassCompilable icc : this.innerClassList) {
    try {
      String fileName=icc.getFileName();
      byte[] bytes=ClassWriter.compile(icc);
      ReflectUtils.unsafe.defineClass(fileName,bytes,0,bytes.length,null,null);
    }
 catch (    Throwable t) {
      t.printStackTrace();
    }
  }
  field.compute(this.currentClassName,this.compilableList);
  this.compilableList.clear();
  this.innerClassList.clear();
  return true;
}
Program: 84772
Project: 84772
Buggy source:
@Override public void addField(IField field){
  this.currentClassName="String_Node_Str" + classIndex++;
  REPLVariable var=new REPLVariable(field.getPosition(),field.getName(),field.getType(),field.getValue());
  if (this.computeVariable(var)) {
    this.variables.put(var.name,var);
    System.out.println(var.toString());
  }
}

Fixed version (ground truth):
@Override public void addField(IField field){
  this.currentClassName="String_Node_Str" + classIndex++;
  REPLVariable var=new REPLVariable(field.getPosition(),field.getName(),field.getType(),field.getValue());
  var.setAnnotations(field.getAnnotations(),field.annotationCount());
  var.modifiers=field.getModifiers();
  if (this.computeVariable(var)) {
    this.variables.put(var.name,var);
    System.out.println(var.toString());
  }
}
Program: 84773
Project: 84773
Buggy source:
@Override public void writeSet(MethodWriter writer,IValue instance,IValue value) throws BytecodeException {
  if (instance != null) {
    instance.writeExpression(writer);
    if (value != null) {
      value.writeExpression(writer);
    }
  }
  String owner=this.theClass.getInternalName();
  String name=this.name.qualified;
  String desc=this.type.getExtendedName();
  if ((this.modifiers & Modifiers.STATIC) != 0) {
    writer.writeFieldInsn(Opcodes.PUTSTATIC,owner,name,desc);
  }
 else {
    writer.writeFieldInsn(Opcodes.PUTFIELD,owner,name,desc);
  }
}

Fixed version (ground truth):
@Override public void writeSet(MethodWriter writer,IValue instance,IValue value) throws BytecodeException {
  if (instance != null) {
    instance.writeExpression(writer);
  }
  if (value != null) {
    value.writeExpression(writer);
  }
  String owner=this.theClass.getInternalName();
  String name=this.name.qualified;
  String desc=this.type.getExtendedName();
  if ((this.modifiers & Modifiers.STATIC) != 0) {
    writer.writeFieldInsn(Opcodes.PUTSTATIC,owner,name,desc);
  }
 else {
    writer.writeFieldInsn(Opcodes.PUTFIELD,owner,name,desc);
  }
}
Program: 84774
Project: 84774
Buggy source:
public void pop() throws StackUnderflowException {
  Object o=this.stack[--this.stackCount];
  if (o == LONG || o == DOUBLE) {
    this.actualStackCount-=2;
  }
 else {
    this.actualStackCount--;
  }
}

Fixed version (ground truth):
public void pop() throws StackUnderflowException {
  if (this.stackCount == 0) {
    throw new StackUnderflowException();
  }
  Object o=this.stack[--this.stackCount];
  if (o == LONG || o == DOUBLE) {
    this.actualStackCount-=2;
  }
 else {
    this.actualStackCount--;
  }
}
Program: 84776
Project: 84776
Buggy source:
@Override public void setValue(IValue value){
  if (this.mode == WHILE) {
    this.statement.action=value;
  }
 else   if (this.mode == CONDITION_END) {
    this.statement.condition=value;
  }
}

Fixed version (ground truth):
@Override public void setValue(IValue value){
  if (this.mode == WHILE) {
    this.statement.action=value;
  }
 else   if (this.mode == END) {
    this.statement.condition=value;
  }
}
Program: 84777
Project: 84777
Buggy source:
@Override public void parse(IParserManager pm,IToken token) throws SyntaxError {
  if (this.mode == DO) {
    pm.pushParser(new ExpressionParser(this),true);
    this.mode=WHILE;
    return;
  }
  int type=token.type();
  if (this.mode == WHILE) {
    if (type == Keywords.WHILE) {
      this.mode=CONDITION;
      return;
    }
    if (ParserUtil.isTerminator(type)) {
      if (token.next().type() == Keywords.WHILE) {
        pm.skip(1);
        this.mode=CONDITION;
        return;
      }
    }
    pm.popParser(true);
    return;
  }
  if (this.mode == CONDITION) {
    if (type == Symbols.OPEN_PARENTHESIS) {
      pm.pushParser(new ExpressionParser(this));
      this.mode=CONDITION_END;
      return;
    }
    pm.pushParser(new ExpressionParser(this));
    this.mode=CONDITION_END;
    throw new SyntaxError(token,"String_Node_Str");
  }
  if (this.mode == CONDITION_END) {
    if (type == Symbols.CLOSE_PARENTHESIS) {
      pm.popParser();
      return;
    }
    pm.popParser();
    throw new SyntaxError(token,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void parse(IParserManager pm,IToken token) throws SyntaxError {
  if (this.mode == DO) {
    pm.pushParser(new ExpressionParser(this),true);
    this.mode=WHILE;
    return;
  }
  int type=token.type();
  if (this.mode == WHILE) {
    if (type == Keywords.WHILE) {
      this.mode=END;
      pm.pushParser(new ExpressionParser(this));
      return;
    }
    if (type == Symbols.SEMICOLON) {
      if (token.next().type() == Keywords.WHILE) {
        this.mode=END;
        pm.skip(1);
        pm.pushParser(new ExpressionParser(this));
        return;
      }
    }
    pm.popParser(true);
    return;
  }
  if (this.mode == END) {
    pm.popParser(true);
    return;
  }
}
Program: 84778
Project: 84778
Buggy source:
@Override public void parse(IParserManager pm,IToken token) throws SyntaxError {
  if (this.mode == -1) {
    pm.popParser(true);
    return;
  }
  int type=token.type();
  if (this.mode == IF) {
    this.mode=CONDITION_END;
    pm.pushParser(new ExpressionParser(this));
    if (type == Symbols.OPEN_PARENTHESIS) {
      return;
    }
    throw new SyntaxError(token,"String_Node_Str",true);
  }
  if (this.mode == CONDITION_END) {
    this.mode=THEN;
    if (type == Symbols.CLOSE_PARENTHESIS) {
      return;
    }
    throw new SyntaxError(token,"String_Node_Str",true);
  }
  if (this.mode == THEN) {
    if (ParserUtil.isTerminator(type)) {
      pm.popParser(true);
      return;
    }
    pm.pushParser(new ExpressionParser(this),true);
    this.mode=ELSE;
    return;
  }
  if (this.mode == ELSE) {
    if (ParserUtil.isTerminator(type)) {
      if (token.next().type() == Keywords.ELSE) {
        return;
      }
      pm.popParser(true);
      return;
    }
    if (type == Keywords.ELSE) {
      pm.pushParser(new ExpressionParser(this));
      this.mode=-1;
      return;
    }
    pm.popParser(true);
    return;
  }
}

Fixed version (ground truth):
@Override public void parse(IParserManager pm,IToken token) throws SyntaxError {
  if (this.mode == -1) {
    pm.popParser(true);
    return;
  }
  int type=token.type();
  if (this.mode == IF) {
    this.mode=CONDITION_END;
    pm.pushParser(new ExpressionParser(this));
    if (type == Symbols.OPEN_PARENTHESIS) {
      return;
    }
    throw new SyntaxError(token,"String_Node_Str",true);
  }
  if (this.mode == CONDITION_END) {
    this.mode=THEN;
    if (type == Symbols.CLOSE_PARENTHESIS) {
      return;
    }
    throw new SyntaxError(token,"String_Node_Str",true);
  }
  if (this.mode == THEN) {
    if (ParserUtil.isTerminator(type)) {
      pm.popParser(true);
      return;
    }
    pm.pushParser(new ExpressionParser(this),true);
    this.mode=ELSE;
    return;
  }
  if (this.mode == ELSE) {
    if (ParserUtil.isTerminator(type)) {
      IToken next=token.getNext();
      if (next != null && next.type() == Keywords.ELSE) {
        return;
      }
      pm.popParser(true);
      return;
    }
    if (type == Keywords.ELSE) {
      pm.pushParser(new ExpressionParser(this));
      this.mode=-1;
      return;
    }
    pm.popParser(true);
    return;
  }
}
Program: 84779
Project: 84779
Buggy source:
@Override public boolean isSuperTypeOf(IType type){
  int arrayDims=type.getArrayDimensions();
  if (arrayDims == 0) {
    return false;
  }
  int thisDims=this.getArrayDimensions();
  if (arrayDims > thisDims) {
    return this.type.getTheClass() == Types.OBJECT_CLASS;
  }
  IType elementType=type.getElementType();
  if (elementType.isPrimitive() != this.type.isPrimitive()) {
    return false;
  }
  return this.type.isSuperTypeOf(elementType);
}

Fixed version (ground truth):
@Override public boolean isSuperTypeOf(IType type){
  if (!type.isArrayType()) {
    return false;
  }
  return this.type.isSuperTypeOf(type.getElementType());
}
Program: 84780
Project: 84780
Buggy source:
private Annotation[] getAnnotations(){
  Annotation[] a=new Annotation[this.annotationCount];
  System.arraycopy(this.annotations,0,a,0,this.annotationCount);
  return a;
}

Fixed version (ground truth):
@Override public Annotation[] getAnnotations(){
  Annotation[] a=new Annotation[this.annotationCount];
  System.arraycopy(this.annotations,0,a,0,this.annotationCount);
  return a;
}
Program: 84781
Project: 84781
Buggy source:
private Annotation[] getAnnotations(){
  Annotation[] a=new Annotation[this.annotationCount];
  System.arraycopy(this.annotations,0,a,0,this.annotationCount);
  return a;
}

Fixed version (ground truth):
@Override public Annotation[] getAnnotations(){
  Annotation[] a=new Annotation[this.annotationCount];
  System.arraycopy(this.annotations,0,a,0,this.annotationCount);
  return a;
}
Program: 84782
Project: 84782
Buggy source:
protected void processValue(){
  if (this.value == null) {
    return;
  }
  MarkerList markers=new MarkerList();
  this.currentClassName="String_Node_Str" + classIndex++;
  Name name=Name.getQualified("String_Node_Str" + resultIndex);
  IValue value=this.value;
  IType type=Types.UNKNOWN;
  ICodePosition position=CODE_POSITION;
  this.value=null;
  REPLVariable field=new REPLVariable(position,name,type,value);
  field.modifiers=Modifiers.FINAL;
  field.resolveTypes(markers,this);
  field.resolve(markers,this);
  field.checkTypes(markers,this);
  field.check(markers,this);
  if (this.reportErrors(markers)) {
    return;
  }
  field.foldConstants();
  for (  IClassCompilable icc : this.innerClassList) {
    try {
      String fileName=icc.getFileName();
      byte[] bytes=ClassWriter.compile(icc);
      ReflectUtils.unsafe.defineClass(fileName,bytes,0,bytes.length,null,null);
    }
 catch (    Throwable t) {
      t.printStackTrace();
    }
  }
  field.compute(this.currentClassName,this.compilableList);
  this.compilableList.clear();
  this.innerClassList.clear();
  if (field.getType() != Types.VOID) {
    this.variables.put(name,field);
    System.out.println(field.toString());
    resultIndex++;
  }
}

Fixed version (ground truth):
protected void processValue(){
  if (this.value == null) {
    return;
  }
  IValue value=this.value;
  MarkerList markers=new MarkerList();
  this.currentClassName="String_Node_Str" + classIndex++;
  this.value=null;
  Name name=Name.getQualified("String_Node_Str" + resultIndex);
  REPLVariable field=new REPLVariable(CODE_POSITION,name,Types.UNKNOWN,value);
  field.modifiers=Modifiers.FINAL;
  field.resolveTypes(markers,this);
  field.resolve(markers,this);
  field.checkTypes(markers,this);
  field.check(markers,this);
  if (this.reportErrors(markers)) {
    return;
  }
  field.foldConstants();
  for (  IClassCompilable icc : this.innerClassList) {
    try {
      String fileName=icc.getFileName();
      byte[] bytes=ClassWriter.compile(icc);
      ReflectUtils.unsafe.defineClass(fileName,bytes,0,bytes.length,null,null);
    }
 catch (    Throwable t) {
      t.printStackTrace();
    }
  }
  field.compute(this.currentClassName,this.compilableList);
  this.compilableList.clear();
  this.innerClassList.clear();
  if (field.getType() != Types.VOID) {
    this.variables.put(name,field);
    System.out.println(field.toString());
    resultIndex++;
  }
}
Program: 84783
Project: 84783
Buggy source:
@Override public void toString(String prefix,StringBuilder buffer){
  buffer.append(this.value);
}

Fixed version (ground truth):
@Override public void toString(String prefix,StringBuilder buffer){
  if (this.value.getClass().isArray()) {
    ObjectArray.toString(this.value,buffer);
    return;
  }
  buffer.append(this.value);
}
Program: 84784
Project: 84784
Buggy source:
@Override public void writeSet(MethodWriter writer,IValue instance,IValue value) throws BytecodeException {
}

Fixed version (ground truth):
@Override public void writeSet(MethodWriter writer,IValue instance,IValue value) throws BytecodeException {
  if (this.className == null) {
    writer.writeInsn(Opcodes.AUTO_POP);
    return;
  }
  String extended=this.type.getExtendedName();
  writer.writeFieldInsn(Opcodes.PUTSTATIC,this.className,"String_Node_Str",extended);
}
Program: 84785
Project: 84785
Buggy source:
@Override public ICompilationUnit createUnit(Package pack,CodeFile inputFile,File outputFile){
  return new DyvilHeader(pack,inputFile,outputFile);
}

Fixed version (ground truth):
@Override public ICompilationUnit createUnit(Package pack,CodeFile inputFile,File outputFile){
  DyvilHeader header=new DyvilHeader(pack,inputFile,outputFile);
  pack.addHeader(header);
  return header;
}
Program: 84786
Project: 84786
Buggy source:
public static void writeToString(MethodWriter writer,IType type) throws BytecodeException {
  if (type.isArrayType()) {
    writer.writeInsn(Opcodes.SWAP);
    writer.writeInsn(Opcodes.DUP_X1);
    writeArrayToString(writer,type.getElementType());
    return;
  }
  StringBuilder desc=new StringBuilder().append('(');
  if (type.isPrimitive()) {
    type.appendExtendedName(desc);
  }
 else   if (type.classEquals(Types.STRING)) {
    desc.append("String_Node_Str");
  }
 else {
    desc.append("String_Node_Str");
  }
  desc.append("String_Node_Str");
  writer.writeInvokeInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str",desc.toString(),false);
  return;
}

Fixed version (ground truth):
public static void writeToString(MethodWriter writer,IType type) throws BytecodeException {
  if (type.isArrayType()) {
    writer.writeInsn(Opcodes.SWAP);
    writer.writeInsn(Opcodes.DUP_X1);
    writeArrayToString(writer,type.getElementType());
    return;
  }
  StringBuilder desc=new StringBuilder().append('(');
  if (type.isPrimitive()) {
    type.appendExtendedName(desc);
  }
 else   if (type.equals(Types.STRING)) {
    desc.append("String_Node_Str");
  }
 else {
    desc.append("String_Node_Str");
  }
  desc.append("String_Node_Str");
  writer.writeInvokeInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str",desc.toString(),false);
  return;
}
Program: 84787
Project: 84787
Buggy source:
@Override public void writeInvJump(MethodWriter writer,Label dest,IValue instance,IArguments arguments) throws BytecodeException {
  if ((this.modifiers & Modifiers.STATIC) != 0) {
    if (this.intrinsicOpcodes != null) {
      this.writeInvIntrinsic(writer,dest,instance,arguments);
      return;
    }
  }
 else   if (this.intrinsicOpcodes != null && (instance == null || instance.isPrimitive())) {
    this.writeInvIntrinsic(writer,dest,instance,arguments);
    return;
  }
  this.writeArgumentsAndInvoke(writer,instance,arguments);
  writer.writeJumpInsn(IFNE,dest);
}

Fixed version (ground truth):
@Override public void writeInvJump(MethodWriter writer,Label dest,IValue instance,IArguments arguments) throws BytecodeException {
  if ((this.modifiers & Modifiers.STATIC) != 0) {
    if (this.intrinsicOpcodes != null) {
      this.writeInvIntrinsic(writer,dest,instance,arguments);
      return;
    }
  }
 else   if (this.intrinsicOpcodes != null && (instance == null || instance.isPrimitive())) {
    this.writeInvIntrinsic(writer,dest,instance,arguments);
    return;
  }
  this.writeArgumentsAndInvoke(writer,instance,arguments);
  writer.writeJumpInsn(IFEQ,dest);
}
Program: 84788
Project: 84788
Buggy source:
@Override public void writeJump(MethodWriter writer,Label dest,IValue instance,IArguments arguments) throws BytecodeException {
  if ((this.modifiers & Modifiers.STATIC) != 0) {
    if (this.intrinsicOpcodes != null) {
      this.writeIntrinsic(writer,dest,instance,arguments);
      return;
    }
  }
 else   if (this.intrinsicOpcodes != null && (instance == null || instance.isPrimitive())) {
    this.writeIntrinsic(writer,dest,instance,arguments);
    return;
  }
  this.writeArgumentsAndInvoke(writer,instance,arguments);
  writer.writeJumpInsn(IFEQ,dest);
}

Fixed version (ground truth):
@Override public void writeJump(MethodWriter writer,Label dest,IValue instance,IArguments arguments) throws BytecodeException {
  if ((this.modifiers & Modifiers.STATIC) != 0) {
    if (this.intrinsicOpcodes != null) {
      this.writeIntrinsic(writer,dest,instance,arguments);
      return;
    }
  }
 else   if (this.intrinsicOpcodes != null && (instance == null || instance.isPrimitive())) {
    this.writeIntrinsic(writer,dest,instance,arguments);
    return;
  }
  this.writeArgumentsAndInvoke(writer,instance,arguments);
  writer.writeJumpInsn(IFNE,dest);
}
Program: 84789
Project: 84789
Buggy source:
public static String frameTypeName(Object o){
  if (o == BYTE) {
    return "String_Node_Str";
  }
  if (o == SHORT) {
    return "String_Node_Str";
  }
  if (o == CHAR) {
    return "String_Node_Str";
  }
  if (o == INT) {
    return "String_Node_Str";
  }
  if (o == LONG) {
    return "String_Node_Str";
  }
  if (o == FLOAT) {
    return "String_Node_Str";
  }
  if (o == DOUBLE) {
    return "String_Node_Str";
  }
  if (o == NULL) {
    return "String_Node_Str";
  }
  if (o == UNINITIALIZED_THIS) {
    return "String_Node_Str";
  }
  if (o == null) {
    return "String_Node_Str";
  }
  return o.toString();
}

Fixed version (ground truth):
public static String frameTypeName(Object o){
  if (o == BOOLEAN) {
    return "String_Node_Str";
  }
  if (o == BYTE) {
    return "String_Node_Str";
  }
  if (o == SHORT) {
    return "String_Node_Str";
  }
  if (o == CHAR) {
    return "String_Node_Str";
  }
  if (o == INT) {
    return "String_Node_Str";
  }
  if (o == LONG) {
    return "String_Node_Str";
  }
  if (o == FLOAT) {
    return "String_Node_Str";
  }
  if (o == DOUBLE) {
    return "String_Node_Str";
  }
  if (o == NULL) {
    return "String_Node_Str";
  }
  if (o == UNINITIALIZED_THIS) {
    return "String_Node_Str";
  }
  if (o == null) {
    return "String_Node_Str";
  }
  return o.toString();
}
Program: 84790
Project: 84790
Buggy source:
@Override public Iterator<T> iterator(){
  return new Iterator<T>(){
    private T current=SimpleRange.this.first;
    @Override public T next(){
      if (this.current.$gt(SimpleRange.this.last)) {
        throw new NoSuchElementException("String_Node_Str");
      }
      T c=this.current;
      this.current=this.current.next();
      return c;
    }
    @Override public boolean hasNext(){
      return this.current.$lt$eq(SimpleRange.this.last);
    }
  }
;
}

Fixed version (ground truth):
@Override public Iterator<T> iterator(){
  return new Iterator<T>(){
    private T current=SimpleRange.this.first;
    @Override public T next(){
      if (this.current.$gt(SimpleRange.this.last)) {
        throw new NoSuchElementException("String_Node_Str");
      }
      T c=this.current;
      this.current=this.current.next();
      return c;
    }
    @Override public boolean hasNext(){
      return this.current.$lt$eq(SimpleRange.this.last);
    }
    @Override public String toString(){
      return "String_Node_Str" + SimpleRange.this + "String_Node_Str";
    }
  }
;
}
Program: 84791
Project: 84791
Buggy source:
@Override public void checkTypes(MarkerList markers,IContext context){
  if (this.instance != null) {
    this.instance.checkTypes(markers,context);
  }
  if (this.method != null) {
    this.method.checkArguments(markers,this.position,context,this.instance,this.arguments,this.getGenericData());
  }
  this.arguments.check(markers,context);
}

Fixed version (ground truth):
@Override public void checkTypes(MarkerList markers,IContext context){
  if (this.instance != null) {
    this.instance.checkTypes(markers,context);
  }
  if (this.method != null) {
    this.method.checkArguments(markers,this.position,context,this.instance,this.arguments,this.getGenericData());
  }
  this.arguments.checkTypes(markers,context);
}
Program: 84792
Project: 84792
Buggy source:
@Override public IValue resolve(MarkerList markers,IContext context){
  this.value=this.value.resolve(markers,context);
  if (this.type == Types.VOID) {
    markers.add(this.position,"String_Node_Str");
    this.value.checkTypes(markers,context);
    return this;
  }
  if (!this.type.isResolved()) {
    return this;
  }
  if (!this.typeHint && this.type.equals(this.value.getType())) {
    markers.add(this.position,"String_Node_Str");
    this.typeHint=true;
  }
  IValue value1=this.value.withType(this.type);
  if (value1 != null && value1 != this.value) {
    this.value=value1;
    this.typeHint=true;
    this.value.checkTypes(markers,context);
    this.type=value1.getType();
    return this;
  }
  this.value.checkTypes(markers,context);
  return this;
}

Fixed version (ground truth):
@Override public IValue resolve(MarkerList markers,IContext context){
  this.value=this.value.resolve(markers,context);
  if (this.type == Types.VOID) {
    markers.add(this.position,"String_Node_Str");
    this.value.checkTypes(markers,context);
    return this;
  }
  if (!this.type.isResolved()) {
    return this;
  }
  IValue value1=this.value.withType(this.type);
  if (value1 != null && value1 != this.value) {
    this.value=value1;
    this.typeHint=true;
    this.value.checkTypes(markers,context);
    this.type=value1.getType();
    return this;
  }
  if (!this.typeHint && this.type.equals(this.value.getType())) {
    markers.add(this.position,"String_Node_Str");
    this.typeHint=true;
  }
  this.value.checkTypes(markers,context);
  return this;
}
Program: 84793
Project: 84793
Buggy source:
private IValue withElementType(IType type,IType elementType){
  IValue value1=this.value1.withType(elementType);
  if (value1 == null) {
    return null;
  }
  IValue value2=this.value2.withType(elementType);
  if (value2 == null) {
    return null;
  }
  this.value1=value1;
  this.value2=value2;
  this.type=type;
  this.elementType=elementType;
  return this;
}

Fixed version (ground truth):
private IValue withElementType(IType type,IType elementType){
  if (!this.value1.isType(elementType)) {
    return null;
  }
  if (!this.value2.isType(elementType)) {
    return null;
  }
  this.type=type;
  this.elementType=elementType;
  return this;
}
Program: 84794
Project: 84794
Buggy source:
@Override public void checkTypes(MarkerList markers,IContext context){
  this.value1.checkTypes(markers,context);
  this.value2.checkTypes(markers,context);
}

Fixed version (ground truth):
@Override public void checkTypes(MarkerList markers,IContext context){
  IValue value1=this.value1.withType(this.elementType);
  if (value1 == null) {
  }
 else {
    this.value1=value1;
  }
  value1=this.value2.withType(this.elementType);
  if (value1 == null) {
  }
 else {
    this.value2=value1;
  }
  this.value1.checkTypes(markers,context);
  this.value2.checkTypes(markers,context);
}
Program: 84795
Project: 84795
Buggy source:
@Override public void checkTypes(MarkerList markers,IContext context){
  if (this.instance != null) {
    this.instance.checkTypes(markers,context);
  }
  if (this.method != null) {
    this.method.checkArguments(markers,this.position,context,this.instance,this.arguments,this.getGenericData());
  }
  this.arguments.checkTypes(markers,context);
}

Fixed version (ground truth):
@Override public void checkTypes(MarkerList markers,IContext context){
  if (this.instance != null) {
    this.instance.checkTypes(markers,context);
  }
  if (this.method != null) {
    this.instance=this.method.checkArguments(markers,this.position,context,this.instance,this.arguments,this.getGenericData());
  }
  this.arguments.checkTypes(markers,context);
}
Program: 84796
Project: 84796
Buggy source:
public static void writeToString(MethodWriter writer,IType type) throws BytecodeException {
  if (type.isArrayType()) {
    writer.writeInsn(Opcodes.SWAP);
    writer.writeInsn(Opcodes.DUP_X1);
    writeArrayToString(writer,type.getElementType());
    return;
  }
  StringBuilder desc=new StringBuilder().append('(');
  if (type.isPrimitive()) {
    type.appendExtendedName(desc);
  }
 else   if (type.equals(Types.STRING)) {
    desc.append("String_Node_Str");
  }
 else {
    desc.append("String_Node_Str");
  }
  desc.append("String_Node_Str");
  writer.writeInvokeInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str",desc.toString(),false);
  return;
}

Fixed version (ground truth):
public static void writeToString(MethodWriter writer,IType type) throws BytecodeException {
  if (type.isArrayType()) {
    writer.writeInsn(Opcodes.SWAP);
    writer.writeInsn(Opcodes.DUP_X1);
    writeArrayToString(writer,type.getElementType());
    return;
  }
  StringBuilder desc=new StringBuilder().append('(');
  if (type.isPrimitive()) {
    type.appendExtendedName(desc);
  }
 else   if (type.classEquals(Types.STRING)) {
    desc.append("String_Node_Str");
  }
 else {
    desc.append("String_Node_Str");
  }
  desc.append("String_Node_Str");
  writer.writeInvokeInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str",desc.toString(),false);
  return;
}