Program: 170719
Project: 170719
Buggy source:
private static void addOpcode(OpcodeHBox text,AbstractInsnNode ain,MethodNode method){
  if (!OpcodeUtil.isolated(ain)) {
    int spaces=String.valueOf(OpcodeUtil.getSize(ain,method)).length();
    String index=pad(String.valueOf(OpcodeUtil.index(ain,method)),spaces);
    addRaw(text,index);
    addRaw(text,"String_Node_Str");
  }
  String opName=OpcodeUtil.opcodeToName(ain.getOpcode());
  if (ain.getType() == AbstractInsnNode.LINE) {
    opName="String_Node_Str";
  }
 else   if (ain.getType() == AbstractInsnNode.LABEL) {
    opName="String_Node_Str";
  }
  text.append(opName);
  Label op=text(opName);
  style(op,"String_Node_Str");
  add(text,op);
  if (ain.getType() != AbstractInsnNode.INSN) {
    addRaw(text,"String_Node_Str");
  }
switch (ain.getType()) {
case AbstractInsnNode.FIELD_INSN:
{
      FieldInsnNode fin=(FieldInsnNode)ain;
      addType(text,Type.getObjectType(fin.owner));
      addRaw(text,"String_Node_Str");
      addName(text,fin.name);
      addRaw(text,"String_Node_Str");
      addType(text,Type.getType(fin.desc));
      break;
    }
case AbstractInsnNode.METHOD_INSN:
{
    MethodInsnNode min=(MethodInsnNode)ain;
    addType(text,Type.getObjectType(min.owner));
    addRaw(text,"String_Node_Str");
    addName(text,min.name);
    addMethodType(text,Type.getType(min.desc));
    break;
  }
case AbstractInsnNode.TYPE_INSN:
{
  TypeInsnNode tin=(TypeInsnNode)ain;
  String desc=tin.desc;
  addType(text,Type.getObjectType(desc));
  if (ain.getOpcode() == Opcodes.ANEWARRAY) {
    addRaw(text,"String_Node_Str");
  }
  break;
}
case AbstractInsnNode.INT_INSN:
{
IntInsnNode iin=(IntInsnNode)ain;
addValue(text,String.valueOf(iin.operand));
break;
}
case AbstractInsnNode.LDC_INSN:
{
LdcInsnNode ldc=(LdcInsnNode)ain;
if (ldc.cst instanceof String) {
String value=String.valueOf(ldc.cst);
if (value.length() > MAX_LDC_LENGTH) {
  value=value.substring(0,MAX_LDC_LENGTH) + "String_Node_Str";
}
addString(text,"String_Node_Str" + value + "String_Node_Str");
}
 else if (ldc.cst instanceof Type) {
addType(text,TypeUtil.parse(ldc.cst.toString()));
}
 else {
addValue(text,String.valueOf(ldc.cst));
}
break;
}
case AbstractInsnNode.LINE:
{
LineNumberNode line=(LineNumberNode)ain;
addValue(text,String.valueOf(line.line));
if (line.start != null) {
addRaw(text,"String_Node_Str");
addOpcode(text,line.start,method);
addRaw(text,"String_Node_Str");
}
break;
}
case AbstractInsnNode.JUMP_INSN:
{
JumpInsnNode jin=(JumpInsnNode)ain;
if (ConfDisplay.instance().jumpHelp) {
String z="String_Node_Str";
switch (ain.getOpcode()) {
case IFEQ:
z+="String_Node_Str";
break;
case IFNE:
z+="String_Node_Str";
break;
case IFLE:
z+="String_Node_Str";
break;
case IFLT:
z+="String_Node_Str";
break;
case IFGE:
z+="String_Node_Str";
break;
case IFGT:
z+="String_Node_Str";
break;
case IF_ACMPNE:
z+="String_Node_Str";
break;
case IF_ACMPEQ:
z+="String_Node_Str";
break;
case IF_ICMPEQ:
z+="String_Node_Str";
break;
case IF_ICMPNE:
z+="String_Node_Str";
break;
case IF_ICMPLE:
z+="String_Node_Str";
break;
case IF_ICMPLT:
z+="String_Node_Str";
break;
case IF_ICMPGE:
z+="String_Node_Str";
break;
case IF_ICMPGT:
z+="String_Node_Str";
break;
case GOTO:
z+="String_Node_Str";
break;
case JSR:
z+="String_Node_Str";
break;
case IFNULL:
z+="String_Node_Str";
break;
case IFNONNULL:
z+="String_Node_Str";
break;
}
addNote(text,z);
}
addRaw(text,"String_Node_Str");
addOpcode(text,jin.label,method);
addRaw(text,"String_Node_Str");
break;
}
case AbstractInsnNode.VAR_INSN:
{
VarInsnNode vin=(VarInsnNode)ain;
addValue(text,String.valueOf(vin.var));
if (method != null && method.localVariables != null && vin.var < method.localVariables.size()) {
LocalVariableNode lvn=method.localVariables.get(vin.var);
addRaw(text,"String_Node_Str");
addName(text,lvn.name);
addRaw(text,"String_Node_Str");
addType(text,Type.getType(lvn.desc));
addRaw(text,"String_Node_Str");
}
break;
}
case AbstractInsnNode.TABLESWITCH_INSN:
{
TableSwitchInsnNode tsin=(TableSwitchInsnNode)ain;
StringBuilder lbls=new StringBuilder();
for (LabelNode label : tsin.labels) {
lbls.append(OpcodeUtil.index(label,method)).append("String_Node_Str");
}
if (lbls.toString().endsWith("String_Node_Str")) {
lbls=new StringBuilder(lbls.substring(0,lbls.length() - 2));
}
int dfltOff=OpcodeUtil.index(tsin.dflt,method);
addNote(text,"String_Node_Str" + tsin.min + "String_Node_Str"+ tsin.max+ "String_Node_Str");
addNote(text,"String_Node_Str" + lbls + "String_Node_Str");
addNote(text,"String_Node_Str" + dfltOff);
break;
}
case AbstractInsnNode.LOOKUPSWITCH_INSN:
{
LookupSwitchInsnNode lsin=(LookupSwitchInsnNode)ain;
String lbls="String_Node_Str";
int cap=Math.min(lsin.keys.size(),lsin.labels.size());
for (int i=0; i < cap; i++) {
int offset=OpcodeUtil.index(lsin.labels.get(i),method);
lbls+=lsin.keys.get(i) + "String_Node_Str" + offset+ "String_Node_Str";
}
if (lsin.dflt != null) {
int offset=OpcodeUtil.index(lsin.dflt,method);
lbls+="String_Node_Str" + offset;
}
if (lbls.endsWith("String_Node_Str")) {
lbls=lbls.substring(0,lbls.length() - 2);
}
addNote(text,"String_Node_Str" + lbls + "String_Node_Str");
break;
}
case AbstractInsnNode.MULTIANEWARRAY_INSN:
{
MultiANewArrayInsnNode manain=(MultiANewArrayInsnNode)ain;
addType(text,Type.getType(manain.desc));
addNote(text,"String_Node_Str" + manain.dims);
break;
}
case AbstractInsnNode.INVOKE_DYNAMIC_INSN:
{
InvokeDynamicInsnNode insnIndy=(InvokeDynamicInsnNode)ain;
if (insnIndy.bsmArgs.length >= 2 && insnIndy.bsmArgs[1] instanceof Handle) {
Handle handle=(Handle)insnIndy.bsmArgs[1];
Type typeIndyOwner=Type.getObjectType(handle.getOwner());
Type typeIndyDesc=Type.getMethodType(handle.getDesc());
addType(text,typeIndyDesc.getReturnType());
addRaw(text,"String_Node_Str");
addType(text,typeIndyOwner);
addRaw(text,"String_Node_Str");
addName(text,handle.getName());
addRaw(text,"String_Node_Str");
Type[] args=typeIndyDesc.getArgumentTypes();
for (int i=0; i < args.length; i++) {
Type t=args[i];
addType(text,t);
if (i < args.length - 1) {
addRaw(text,"String_Node_Str");
}
}
addRaw(text,"String_Node_Str");
}
 else {
addNote(text,"String_Node_Str");
}
break;
}
case AbstractInsnNode.LABEL:
{
addRaw(text,OpcodeUtil.labelName(ain));
break;
}
case AbstractInsnNode.FRAME:
{
break;
}
}
}

Fixed version (ground truth):
private static void addOpcode(OpcodeHBox text,AbstractInsnNode ain,MethodNode method){
  if (!OpcodeUtil.isolated(ain)) {
    int spaces=String.valueOf(OpcodeUtil.getSize(ain,method)).length();
    String index=pad(String.valueOf(OpcodeUtil.index(ain,method)),spaces);
    addRaw(text,index);
    addRaw(text,"String_Node_Str");
  }
  String opName=OpcodeUtil.opcodeToName(ain.getOpcode());
  if (ain.getType() == AbstractInsnNode.LINE) {
    opName="String_Node_Str";
  }
 else   if (ain.getType() == AbstractInsnNode.LABEL) {
    opName="String_Node_Str";
  }
  text.append(opName);
  Label op=text(opName);
  style(op,"String_Node_Str");
  add(text,op);
  if (ain.getType() != AbstractInsnNode.INSN) {
    addRaw(text,"String_Node_Str");
  }
switch (ain.getType()) {
case AbstractInsnNode.FIELD_INSN:
{
      FieldInsnNode fin=(FieldInsnNode)ain;
      addType(text,Type.getObjectType(fin.owner));
      addRaw(text,"String_Node_Str");
      addName(text,fin.name);
      addRaw(text,"String_Node_Str");
      addType(text,Type.getType(fin.desc));
      break;
    }
case AbstractInsnNode.METHOD_INSN:
{
    MethodInsnNode min=(MethodInsnNode)ain;
    addType(text,Type.getObjectType(min.owner));
    addRaw(text,"String_Node_Str");
    addName(text,min.name);
    addMethodType(text,Type.getType(min.desc));
    break;
  }
case AbstractInsnNode.TYPE_INSN:
{
  TypeInsnNode tin=(TypeInsnNode)ain;
  String desc=tin.desc;
  addType(text,Type.getObjectType(desc));
  if (ain.getOpcode() == Opcodes.ANEWARRAY) {
    addRaw(text,"String_Node_Str");
  }
  break;
}
case AbstractInsnNode.INT_INSN:
{
IntInsnNode iin=(IntInsnNode)ain;
addValue(text,String.valueOf(iin.operand));
break;
}
case AbstractInsnNode.LDC_INSN:
{
LdcInsnNode ldc=(LdcInsnNode)ain;
if (ldc.cst instanceof String) {
String value=String.valueOf(ldc.cst);
if (value.length() > MAX_LDC_LENGTH) {
  value=value.substring(0,MAX_LDC_LENGTH) + "String_Node_Str";
}
addString(text,"String_Node_Str" + value + "String_Node_Str");
}
 else if (ldc.cst instanceof Type) {
addType(text,TypeUtil.parse(ldc.cst.toString()));
}
 else {
addValue(text,String.valueOf(ldc.cst));
}
break;
}
case AbstractInsnNode.LINE:
{
LineNumberNode line=(LineNumberNode)ain;
addValue(text,String.valueOf(line.line));
if (line.start != null) {
addRaw(text,"String_Node_Str");
addOpcode(text,line.start,method);
addRaw(text,"String_Node_Str");
}
break;
}
case AbstractInsnNode.JUMP_INSN:
{
JumpInsnNode jin=(JumpInsnNode)ain;
if (ConfDisplay.instance().jumpHelp) {
String z="String_Node_Str";
switch (ain.getOpcode()) {
case IFEQ:
z+="String_Node_Str";
break;
case IFNE:
z+="String_Node_Str";
break;
case IFLE:
z+="String_Node_Str";
break;
case IFLT:
z+="String_Node_Str";
break;
case IFGE:
z+="String_Node_Str";
break;
case IFGT:
z+="String_Node_Str";
break;
case IF_ACMPNE:
z+="String_Node_Str";
break;
case IF_ACMPEQ:
z+="String_Node_Str";
break;
case IF_ICMPEQ:
z+="String_Node_Str";
break;
case IF_ICMPNE:
z+="String_Node_Str";
break;
case IF_ICMPLE:
z+="String_Node_Str";
break;
case IF_ICMPLT:
z+="String_Node_Str";
break;
case IF_ICMPGE:
z+="String_Node_Str";
break;
case IF_ICMPGT:
z+="String_Node_Str";
break;
case GOTO:
z+="String_Node_Str";
break;
case JSR:
z+="String_Node_Str";
break;
case IFNULL:
z+="String_Node_Str";
break;
case IFNONNULL:
z+="String_Node_Str";
break;
}
addNote(text,z);
}
addRaw(text,"String_Node_Str");
addOpcode(text,jin.label,method);
addRaw(text,"String_Node_Str");
break;
}
case AbstractInsnNode.VAR_INSN:
{
VarInsnNode vin=(VarInsnNode)ain;
addValue(text,String.valueOf(vin.var));
if (method != null && method.localVariables != null && vin.var < method.localVariables.size()) {
LocalVariableNode lvn=Asm.getLocal(method,vin.var);
addRaw(text,"String_Node_Str");
addName(text,lvn.name);
addRaw(text,"String_Node_Str");
addType(text,Type.getType(lvn.desc));
addRaw(text,"String_Node_Str");
}
break;
}
case AbstractInsnNode.TABLESWITCH_INSN:
{
TableSwitchInsnNode tsin=(TableSwitchInsnNode)ain;
StringBuilder lbls=new StringBuilder();
for (LabelNode label : tsin.labels) {
lbls.append(OpcodeUtil.index(label,method)).append("String_Node_Str");
}
if (lbls.toString().endsWith("String_Node_Str")) {
lbls=new StringBuilder(lbls.substring(0,lbls.length() - 2));
}
int dfltOff=OpcodeUtil.index(tsin.dflt,method);
addNote(text,"String_Node_Str" + tsin.min + "String_Node_Str"+ tsin.max+ "String_Node_Str");
addNote(text,"String_Node_Str" + lbls + "String_Node_Str");
addNote(text,"String_Node_Str" + dfltOff);
break;
}
case AbstractInsnNode.LOOKUPSWITCH_INSN:
{
LookupSwitchInsnNode lsin=(LookupSwitchInsnNode)ain;
String lbls="String_Node_Str";
int cap=Math.min(lsin.keys.size(),lsin.labels.size());
for (int i=0; i < cap; i++) {
int offset=OpcodeUtil.index(lsin.labels.get(i),method);
lbls+=lsin.keys.get(i) + "String_Node_Str" + offset+ "String_Node_Str";
}
if (lsin.dflt != null) {
int offset=OpcodeUtil.index(lsin.dflt,method);
lbls+="String_Node_Str" + offset;
}
if (lbls.endsWith("String_Node_Str")) {
lbls=lbls.substring(0,lbls.length() - 2);
}
addNote(text,"String_Node_Str" + lbls + "String_Node_Str");
break;
}
case AbstractInsnNode.MULTIANEWARRAY_INSN:
{
MultiANewArrayInsnNode manain=(MultiANewArrayInsnNode)ain;
addType(text,Type.getType(manain.desc));
addNote(text,"String_Node_Str" + manain.dims);
break;
}
case AbstractInsnNode.INVOKE_DYNAMIC_INSN:
{
InvokeDynamicInsnNode insnIndy=(InvokeDynamicInsnNode)ain;
if (insnIndy.bsmArgs.length >= 2 && insnIndy.bsmArgs[1] instanceof Handle) {
Handle handle=(Handle)insnIndy.bsmArgs[1];
Type typeIndyOwner=Type.getObjectType(handle.getOwner());
Type typeIndyDesc=Type.getMethodType(handle.getDesc());
addType(text,typeIndyDesc.getReturnType());
addRaw(text,"String_Node_Str");
addType(text,typeIndyOwner);
addRaw(text,"String_Node_Str");
addName(text,handle.getName());
addRaw(text,"String_Node_Str");
Type[] args=typeIndyDesc.getArgumentTypes();
for (int i=0; i < args.length; i++) {
Type t=args[i];
addType(text,t);
if (i < args.length - 1) {
addRaw(text,"String_Node_Str");
}
}
addRaw(text,"String_Node_Str");
}
 else {
addNote(text,"String_Node_Str");
}
break;
}
case AbstractInsnNode.LABEL:
{
addRaw(text,OpcodeUtil.labelName(ain));
break;
}
case AbstractInsnNode.FRAME:
{
break;
}
}
}