nus-yam/ex-repair huggingface dataset:
Program: 62061
Project: 62061
Buggy source:
@Override public BufferedImage getImage(List<Tag> tags){
  BufferedImage bi=new BufferedImage(bitmapWidth,bitmapHeight,BufferedImage.TYPE_INT_ARGB);
  Graphics g=bi.getGraphics();
  ALPHACOLORMAPDATA colorMapData=null;
  ALPHABITMAPDATA bitmapData=null;
  if (bitmapFormat == DefineBitsLossless2Tag.FORMAT_8BIT_COLORMAPPED) {
    colorMapData=getColorMapData();
  }
  if (bitmapFormat == DefineBitsLossless2Tag.FORMAT_32BIT_ARGB) {
    bitmapData=getBitmapData();
  }
  int pos32aligned=0;
  int pos=0;
  for (int y=0; y < bitmapHeight; y++) {
    for (int x=0; x < bitmapWidth; x++) {
      if ((bitmapFormat == DefineBitsLossless2Tag.FORMAT_8BIT_COLORMAPPED)) {
        RGBA color=colorMapData.colorTableRGB[colorMapData.colorMapPixelData[pos32aligned] & 0xff];
        g.setColor(new Color(color.red,color.green,color.blue,color.alpha));
      }
      if ((bitmapFormat == DefineBitsLossless2Tag.FORMAT_32BIT_ARGB)) {
        g.setColor(new Color(bitmapData.bitmapPixelData[pos].red,bitmapData.bitmapPixelData[pos].green,bitmapData.bitmapPixelData[pos].blue,bitmapData.bitmapPixelData[pos].alpha));
      }
      g.fillRect(x,y,1,1);
      pos32aligned++;
      pos++;
    }
    while ((pos32aligned % 4 != 0)) {
      pos32aligned++;
    }
  }
  return bi;
}

Fixed version (ground truth):
@Override public BufferedImage getImage(List<Tag> tags){
  BufferedImage bi=new BufferedImage(bitmapWidth,bitmapHeight,BufferedImage.TYPE_INT_ARGB);
  Graphics g=bi.getGraphics();
  ALPHACOLORMAPDATA colorMapData=null;
  ALPHABITMAPDATA bitmapData=null;
  if (bitmapFormat == DefineBitsLossless2Tag.FORMAT_8BIT_COLORMAPPED) {
    colorMapData=getColorMapData();
  }
  if (bitmapFormat == DefineBitsLossless2Tag.FORMAT_32BIT_ARGB) {
    bitmapData=getBitmapData();
  }
  int pos32aligned=0;
  int pos=0;
  for (int y=0; y < bitmapHeight; y++) {
    for (int x=0; x < bitmapWidth; x++) {
      if ((bitmapFormat == DefineBitsLossless2Tag.FORMAT_8BIT_COLORMAPPED)) {
        g.setColor(multiplyAlpha(colorMapData.colorTableRGB[colorMapData.colorMapPixelData[pos32aligned] & 0xff].toColor()));
      }
      if ((bitmapFormat == DefineBitsLossless2Tag.FORMAT_32BIT_ARGB)) {
        g.setColor(multiplyAlpha(bitmapData.bitmapPixelData[pos].toColor()));
      }
      g.fillRect(x,y,1,1);
      pos32aligned++;
      pos++;
    }
    while ((pos32aligned % 4 != 0)) {
      pos32aligned++;
    }
  }
  return bi;
}
Program: 62062
Project: 62062
Buggy source:
@Override public void setImage(byte data[]) throws IOException {
  BufferedImage image=ImageIO.read(new ByteArrayInputStream(data));
  ALPHABITMAPDATA bitmapData=new ALPHABITMAPDATA();
  bitmapFormat=DefineBitsLosslessTag.FORMAT_24BIT_RGB;
  bitmapWidth=image.getWidth();
  bitmapHeight=image.getHeight();
  bitmapData.bitmapPixelData=new ARGB[bitmapWidth * bitmapHeight];
  int pos=0;
  for (int y=0; y < bitmapHeight; y++) {
    for (int x=0; x < bitmapWidth; x++) {
      int argb=image.getRGB(x,y);
      int a=(argb >> 24) & 0xff;
      int r=(argb >> 16) & 0xff;
      int g=(argb >> 8) & 0xff;
      int b=(argb >> 0) & 0xff;
      bitmapData.bitmapPixelData[pos]=new ARGB();
      bitmapData.bitmapPixelData[pos].alpha=a;
      bitmapData.bitmapPixelData[pos].red=r;
      bitmapData.bitmapPixelData[pos].green=g;
      bitmapData.bitmapPixelData[pos].blue=b;
      pos++;
    }
  }
  ByteArrayOutputStream bitmapDataOS=new ByteArrayOutputStream();
  SWFOutputStream sos=new SWFOutputStream(bitmapDataOS,SWF.DEFAULT_VERSION);
  sos.writeALPHABITMAPDATA(bitmapData,bitmapFormat,bitmapWidth,bitmapHeight);
  ByteArrayOutputStream zlibOS=new ByteArrayOutputStream();
  SWFOutputStream sos2=new SWFOutputStream(zlibOS,SWF.DEFAULT_VERSION);
  sos2.writeBytesZlib(bitmapDataOS.toByteArray());
  zlibBitmapData=zlibOS.toByteArray();
  decompressed=false;
}

Fixed version (ground truth):
@Override public void setImage(byte data[]) throws IOException {
  BufferedImage image=ImageIO.read(new ByteArrayInputStream(data));
  ALPHABITMAPDATA bitmapData=new ALPHABITMAPDATA();
  bitmapFormat=DefineBitsLosslessTag.FORMAT_24BIT_RGB;
  bitmapWidth=image.getWidth();
  bitmapHeight=image.getHeight();
  bitmapData.bitmapPixelData=new ARGB[bitmapWidth * bitmapHeight];
  int pos=0;
  for (int y=0; y < bitmapHeight; y++) {
    for (int x=0; x < bitmapWidth; x++) {
      int argb=image.getRGB(x,y);
      int a=(argb >> 24) & 0xff;
      int r=(argb >> 16) & 0xff;
      int g=(argb >> 8) & 0xff;
      int b=(argb >> 0) & 0xff;
      r=r * a / 255;
      g=g * a / 255;
      b=b * a / 255;
      bitmapData.bitmapPixelData[pos]=new ARGB();
      bitmapData.bitmapPixelData[pos].alpha=a;
      bitmapData.bitmapPixelData[pos].red=r;
      bitmapData.bitmapPixelData[pos].green=g;
      bitmapData.bitmapPixelData[pos].blue=b;
      pos++;
    }
  }
  ByteArrayOutputStream bitmapDataOS=new ByteArrayOutputStream();
  SWFOutputStream sos=new SWFOutputStream(bitmapDataOS,SWF.DEFAULT_VERSION);
  sos.writeALPHABITMAPDATA(bitmapData,bitmapFormat,bitmapWidth,bitmapHeight);
  ByteArrayOutputStream zlibOS=new ByteArrayOutputStream();
  SWFOutputStream sos2=new SWFOutputStream(zlibOS,SWF.DEFAULT_VERSION);
  sos2.writeBytesZlib(bitmapDataOS.toByteArray());
  zlibBitmapData=zlibOS.toByteArray();
  decompressed=false;
}
Program: 62063
Project: 62063
Buggy source:
private static boolean isDirectAncestor(int currentIp,int ancestor,HashMap<Integer,List<Integer>> refs,List<Integer> visited){
  do {
    if (currentIp == ancestor) {
      return true;
    }
    if (visited.contains(currentIp)) {
      return false;
    }
    visited.add(currentIp);
    if (refs.containsKey(currentIp)) {
      List<Integer> currentRefs=refs.get(currentIp);
      if ((currentRefs != null) && (!currentRefs.isEmpty())) {
        for (int i=1; i < currentRefs.size(); i++) {
          if (!isDirectAncestor(currentRefs.get(i),ancestor,refs,visited)) {
            return false;
          }
        }
        currentIp=currentRefs.get(0);
        continue;
      }
    }
    currentIp--;
  }
 while (currentIp >= 0);
  return false;
}

Fixed version (ground truth):
private static boolean isDirectAncestor(int currentIp,int ancestor,HashMap<Integer,List<Integer>> refs,List<Integer> visited){
  do {
    if (currentIp == ancestor) {
      return true;
    }
    if (visited.contains(currentIp)) {
      return true;
    }
    visited.add(currentIp);
    if (refs.containsKey(currentIp)) {
      List<Integer> currentRefs=refs.get(currentIp);
      if ((currentRefs != null) && (!currentRefs.isEmpty())) {
        for (int i=1; i < currentRefs.size(); i++) {
          if (!isDirectAncestor(currentRefs.get(i),ancestor,refs,visited)) {
            return false;
          }
        }
        currentIp=currentRefs.get(0);
        continue;
      }
    }
    currentIp--;
  }
 while (currentIp >= 0);
  return false;
}
Program: 62064
Project: 62064
Buggy source:
public int removeTraps(ConstantPool constants,ABC abc,int scriptIndex,int classIndex,boolean isStatic,String path){
  return code.removeTraps(constants,this,abc,scriptIndex,classIndex,isStatic,path,code.visitCode(this));
}

Fixed version (ground truth):
public int removeTraps(ConstantPool constants,ABC abc,int scriptIndex,int classIndex,boolean isStatic,String path){
  return code.removeTraps(constants,this,abc,scriptIndex,classIndex,isStatic,path);
}
Program: 62065
Project: 62065
Buggy source:
public String toString(String path,boolean pcode,boolean isStatic,int scriptIndex,int classIndex,ABC abc,ConstantPool constants,MethodInfo method_info[],Stack<GraphTargetItem> scopeStack,boolean isStaticInitializer,boolean hilight,List<String> fullyQualifiedNames,Traits initTraits){
  if (debugMode) {
    System.err.println("String_Node_Str" + path);
  }
  String s="String_Node_Str";
  if (!(Boolean)Configuration.getConfig("String_Node_Str",Boolean.TRUE)) {
    s="String_Node_Str";
    if (hilight) {
      s=Highlighting.hilighMethod(s,this.method_info);
    }
    return s;
  }
  if (pcode) {
    s+=code.toASMSource(constants,this,false);
  }
 else {
    AVM2Code deobfuscated=null;
    MethodBody b=(MethodBody)Helper.deepCopy(this);
    deobfuscated=b.code;
    deobfuscated.markMappedOffsets();
    if ((Boolean)Configuration.getConfig("String_Node_Str",true)) {
      try {
        deobfuscated.removeTraps(constants,b,abc,scriptIndex,classIndex,isStatic,path,deobfuscated.visitCode(b));
      }
 catch (      Exception ex) {
        Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
      }
    }
    s+=deobfuscated.toSource(path,isStatic,scriptIndex,classIndex,abc,constants,method_info,b,hilight,getLocalRegNames(abc),scopeStack,isStaticInitializer,fullyQualifiedNames,initTraits,Graph.SOP_USE_STATIC,new HashMap<Integer,Integer>(),deobfuscated.visitCode(b));
    s=s.trim();
    if (hilight) {
      s=Highlighting.hilighMethod(s,this.method_info);
    }
  }
  return s;
}

Fixed version (ground truth):
public String toString(String path,boolean pcode,boolean isStatic,int scriptIndex,int classIndex,ABC abc,ConstantPool constants,MethodInfo method_info[],Stack<GraphTargetItem> scopeStack,boolean isStaticInitializer,boolean hilight,List<String> fullyQualifiedNames,Traits initTraits){
  if (debugMode) {
    System.err.println("String_Node_Str" + path);
  }
  String s="String_Node_Str";
  if (!(Boolean)Configuration.getConfig("String_Node_Str",Boolean.TRUE)) {
    s="String_Node_Str";
    if (hilight) {
      s=Highlighting.hilighMethod(s,this.method_info);
    }
    return s;
  }
  if (pcode) {
    s+=code.toASMSource(constants,this,false);
  }
 else {
    AVM2Code deobfuscated=null;
    MethodBody b=(MethodBody)Helper.deepCopy(this);
    deobfuscated=b.code;
    deobfuscated.markMappedOffsets();
    if ((Boolean)Configuration.getConfig("String_Node_Str",true)) {
      try {
        deobfuscated.removeTraps(constants,b,abc,scriptIndex,classIndex,isStatic,path);
      }
 catch (      Exception ex) {
        Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
      }
    }
    s+=deobfuscated.toSource(path,isStatic,scriptIndex,classIndex,abc,constants,method_info,b,hilight,getLocalRegNames(abc),scopeStack,isStaticInitializer,fullyQualifiedNames,initTraits,Graph.SOP_USE_STATIC,new HashMap<Integer,Integer>(),deobfuscated.visitCode(b));
    s=s.trim();
    if (hilight) {
      s=Highlighting.hilighMethod(s,this.method_info);
    }
  }
  return s;
}
Program: 62066
Project: 62066
Buggy source:
public String toString(String path,boolean pcode,boolean isStatic,int scriptIndex,int classIndex,ABC abc,ConstantPool constants,MethodInfo method_info[],Stack<GraphTargetItem> scopeStack,boolean isStaticInitializer,boolean hilight,List<String> fullyQualifiedNames,Traits initTraits){
  if (debugMode) {
    System.err.println("String_Node_Str" + path);
  }
  String s="String_Node_Str";
  if (!(Boolean)Configuration.getConfig("String_Node_Str",Boolean.TRUE)) {
    s="String_Node_Str";
    if (hilight) {
      s=Highlighting.hilighMethod(s,this.method_info);
    }
    return s;
  }
  if (pcode) {
    s+=code.toASMSource(constants,this,false);
  }
 else {
    AVM2Code deobfuscated=null;
    MethodBody b=(MethodBody)Helper.deepCopy(this);
    deobfuscated=b.code;
    deobfuscated.markMappedOffsets();
    if ((Boolean)Configuration.getConfig("String_Node_Str",true)) {
      try {
        deobfuscated.removeTraps(constants,b,abc,scriptIndex,classIndex,isStatic,path);
      }
 catch (      Exception ex) {
        Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
      }
    }
    s+=deobfuscated.toSource(path,isStatic,scriptIndex,classIndex,abc,constants,method_info,b,hilight,getLocalRegNames(abc),scopeStack,isStaticInitializer,fullyQualifiedNames,initTraits,Graph.SOP_USE_STATIC,new HashMap<Integer,Integer>(),deobfuscated.visitCode(b));
    s=s.trim();
    if (hilight) {
      s=Highlighting.hilighMethod(s,this.method_info);
    }
  }
  return s;
}

Fixed version (ground truth):
public String toString(String path,boolean pcode,boolean isStatic,int scriptIndex,int classIndex,ABC abc,ConstantPool constants,MethodInfo method_info[],Stack<GraphTargetItem> scopeStack,boolean isStaticInitializer,boolean hilight,List<String> fullyQualifiedNames,Traits initTraits){
  if (debugMode) {
    System.err.println("String_Node_Str" + path);
  }
  String s="String_Node_Str";
  if (!(Boolean)Configuration.getConfig("String_Node_Str",Boolean.TRUE)) {
    s="String_Node_Str";
    if (hilight) {
      s=Highlighting.hilighMethod(s,this.method_info);
    }
    return s;
  }
  if (pcode) {
    s+=code.toASMSource(constants,this,false);
  }
 else {
    AVM2Code deobfuscated=null;
    MethodBody b=(MethodBody)Helper.deepCopy(this);
    deobfuscated=b.code;
    deobfuscated.markMappedOffsets();
    if ((Boolean)Configuration.getConfig("String_Node_Str",true)) {
      try {
        deobfuscated.removeTraps(constants,b,abc,scriptIndex,classIndex,isStatic,path);
      }
 catch (      Exception ex) {
        Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
      }
    }
    s+=deobfuscated.toSource(path,isStatic,scriptIndex,classIndex,abc,constants,method_info,b,hilight,getLocalRegNames(abc),scopeStack,isStaticInitializer,fullyQualifiedNames,initTraits,Graph.SOP_USE_STATIC,new HashMap<Integer,Integer>(),deobfuscated.visitCode(b));
    s=s.trim();
    if (s.equals("String_Node_Str")) {
      s="String_Node_Str";
    }
    if (hilight) {
      s=Highlighting.hilighMethod(s,this.method_info);
    }
  }
  return s;
}
Program: 62068
Project: 62068
Buggy source:
public SlotConstTraitDetailPanel(){
  slotConstEditor=new JEditorPane();
  setLayout(new BorderLayout());
  add(new JLabel(translate("String_Node_Str")),BorderLayout.NORTH);
  add(new JScrollPane(slotConstEditor),BorderLayout.CENTER);
  slotConstEditor.setContentType("String_Node_Str");
  Flasm3MethodInfoSyntaxKit sk=(Flasm3MethodInfoSyntaxKit)slotConstEditor.getEditorKit();
  sk.deinstallComponent(slotConstEditor,"String_Node_Str");
}

Fixed version (ground truth):
public SlotConstTraitDetailPanel(){
  slotConstEditor=new JEditorPane();
  setLayout(new BorderLayout());
  add(new JLabel(translate("String_Node_Str")),BorderLayout.NORTH);
  add(new JScrollPane(slotConstEditor),BorderLayout.CENTER);
  warnLabel=new JTextPane();
  warnLabel.setText("String_Node_Str");
  StyledDocument doc=warnLabel.getStyledDocument();
  SimpleAttributeSet center=new SimpleAttributeSet();
  StyleConstants.setAlignment(center,StyleConstants.ALIGN_CENTER);
  doc.setParagraphAttributes(0,doc.getLength(),center,false);
  warnLabel.setOpaque(false);
  warnLabel.setFocusable(false);
  warnLabel.setFont(new JLabel().getFont().deriveFont(Font.BOLD));
  add(warnLabel,BorderLayout.SOUTH);
  slotConstEditor.setContentType("String_Node_Str");
  Flasm3MethodInfoSyntaxKit sk=(Flasm3MethodInfoSyntaxKit)slotConstEditor.getEditorKit();
  sk.deinstallComponent(slotConstEditor,"String_Node_Str");
}
Program: 62069
Project: 62069
Buggy source:
public void load(TraitSlotConst trait,ABC abc){
  this.abc=abc;
  this.trait=trait;
  String s;
  String typeStr;
  if (trait.type_index > 0) {
    typeStr="String_Node_Str" + trait.type_index + "String_Node_Str"+ Helper.escapeString(abc.constants.constant_multiname[trait.type_index].toString(abc.constants,new ArrayList<String>()))+ "String_Node_Str";
  }
 else {
    typeStr="String_Node_Str";
  }
  String valueStr="String_Node_Str";
  if (trait.value_kind != 0) {
    valueStr="String_Node_Str" + (new ValueKind(trait.value_index,trait.value_kind)).toString(abc.constants);
  }
  s=typeStr + valueStr;
  slotConstEditor.setText(s);
}

Fixed version (ground truth):
public void load(TraitSlotConst trait,ABC abc,boolean isStatic){
  this.abc=abc;
  this.trait=trait;
  String s;
  String typeStr;
  if (trait.type_index > 0) {
    typeStr="String_Node_Str" + trait.type_index + "String_Node_Str"+ Helper.escapeString(abc.constants.constant_multiname[trait.type_index].toString(abc.constants,new ArrayList<String>()))+ "String_Node_Str";
  }
 else {
    typeStr="String_Node_Str";
  }
  String valueStr="String_Node_Str";
  if (trait.value_kind != 0) {
    valueStr="String_Node_Str" + (new ValueKind(trait.value_index,trait.value_kind)).toString(abc.constants);
  }
  s=typeStr + valueStr;
  warnLabel.setVisible(trait.isConst() || isStatic);
  slotConstEditor.setText(s);
}
Program: 62070
Project: 62070
Buggy source:
@Override public String toString(ConstantPool constants,HashMap<Integer,String> localRegNames,List<String> fullyQualifiedNames){
  return hilight("String_Node_Str") + value.toString(constants,localRegNames,fullyQualifiedNames);
}

Fixed version (ground truth):
@Override public String toString(ConstantPool constants,HashMap<Integer,String> localRegNames,List<String> fullyQualifiedNames){
  String vaStr=value.toString(constants,localRegNames,fullyQualifiedNames);
  String prefix="String_Node_Str" + Graph.INDENTOPEN + "String_Node_Str";
  if (vaStr.startsWith(prefix)) {
    vaStr=vaStr.substring(prefix.length());
  }
  return hilight("String_Node_Str") + vaStr;
}
Program: 62072
Project: 62072
Buggy source:
/** 
 * Constructor
 * @param actionCode Action type identifier
 * @param actionLength Length of action data
 */
public Action(int actionCode,int actionLength){
  this.actionCode=actionCode;
  this.actionLength=actionLength;
}

Fixed version (ground truth):
public Action(){
}
Program: 62074
Project: 62074
Buggy source:
@Override public String toString(ConstantPool constants){
  if (value instanceof Double) {
    if (Double.compare((double)(Double)value,0) == 0) {
      return hilight("String_Node_Str");
    }
  }
  if (value instanceof Float) {
    if (Float.compare((float)(Float)value,0) == 0) {
      return hilight("String_Node_Str");
    }
  }
  if (value instanceof String) {
    return hilight("String_Node_Str" + Helper.escapeString((String)value) + "String_Node_Str");
  }
  if (value instanceof ConstantIndex) {
    return hilight("String_Node_Str" + Helper.escapeString(this.constants.get(((ConstantIndex)value).index)) + "String_Node_Str");
  }
  return hilight(value.toString());
}

Fixed version (ground truth):
@Override public String toString(ConstantPool constants){
  if (value instanceof Double) {
    if (Double.compare((double)(Double)value,0) == 0) {
      return hilight("String_Node_Str");
    }
  }
  if (value instanceof Float) {
    if (Float.compare((float)(Float)value,0) == 0) {
      return hilight("String_Node_Str");
    }
  }
  if (value instanceof String) {
    return hilight("String_Node_Str" + Helper.escapeString((String)value) + "String_Node_Str");
  }
  if (value instanceof ConstantIndex) {
    return hilight("String_Node_Str" + Helper.escapeString(this.constants.get(((ConstantIndex)value).index)) + "String_Node_Str");
  }
  if (value instanceof RegisterNumber) {
    return hilight(((RegisterNumber)value).translate());
  }
  return hilight(value.toString());
}
Program: 62075
Project: 62075
Buggy source:
@Override public String toString(ConstantPool constants){
  return (define ? hilight("String_Node_Str") : "String_Node_Str") + hilight(register.toString() + "String_Node_Str") + value.toString(constants);
}

Fixed version (ground truth):
@Override public String toString(ConstantPool constants){
  return (define ? hilight("String_Node_Str") : "String_Node_Str") + hilight(register.translate() + "String_Node_Str") + value.toString(constants);
}
Program: 62077
Project: 62077
Buggy source:
public static Object deepCopy(Object o){
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    try (ObjectOutputStream oos=new ObjectOutputStream(baos)){
      oos.writeObject(o);
      oos.flush();
    }
     Object copy;
    try (ObjectInputStream ois=new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))){
      copy=ois.readObject();
    }
     return copy;
  }
 catch (  Exception ex) {
    return null;
  }
}

Fixed version (ground truth):
public static Object deepCopy(Object o){
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    try (ObjectOutputStream oos=new ObjectOutputStream(baos)){
      oos.writeObject(o);
      oos.flush();
    }
     Object copy;
    try (ObjectInputStream ois=new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))){
      copy=ois.readObject();
    }
     return copy;
  }
 catch (  Exception ex) {
    Logger.getLogger(Helper.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
    return null;
  }
}
Program: 62078
Project: 62078
Buggy source:
@Override public void addCharacter(List<Tag> tags,char character){
  int fontStyle=getFontStyle();
  String fname=getFontName(tags);
  SHAPE shp=SHAPERECORD.systemFontCharacterToSHAPE(fname,fontStyle,getDivider() * 1000,character);
  glyphShapeTable.add(shp);
  fontBoundsTable.add(shp.getBounds());
  codeTable.add((int)character);
  Font fnt=new Font(fname,fontStyle,getDivider() * 1000);
  fontAdvanceTable.add((new JPanel()).getFontMetrics(fnt).charWidth(character));
  numGlyphs++;
}

Fixed version (ground truth):
@Override public void addCharacter(List<Tag> tags,char character){
  int fontStyle=getFontStyle();
  String fname=getFontName(tags);
  SHAPE shp=SHAPERECORD.systemFontCharacterToSHAPE(fname,fontStyle,getDivider() * 1024,character);
  glyphShapeTable.add(shp);
  codeTable.add((int)character);
  if (fontFlagsHasLayout) {
    fontBoundsTable.add(shp.getBounds());
    Font fnt=new Font(fname,fontStyle,getDivider() * 1024);
    fontAdvanceTable.add((new JPanel()).getFontMetrics(fnt).charWidth(character));
  }
  numGlyphs++;
}
Program: 62080
Project: 62080
Buggy source:
@Override public void addCharacter(List<Tag> tags,char character){
  int fontStyle=getFontStyle();
  String fname=getFontName(tags);
  SHAPE shp=SHAPERECORD.systemFontCharacterToSHAPE(fname,fontStyle,getDivider() * 1000,character);
  glyphShapeTable.add(shp);
  fontBoundsTable.add(new RECT());
  codeTable.add((int)character);
  Font fnt=new Font(fname,fontStyle,getDivider() * 1000);
  fontAdvanceTable.add((new JPanel()).getFontMetrics(fnt).charWidth(character));
  numGlyphs++;
}

Fixed version (ground truth):
@Override public void addCharacter(List<Tag> tags,char character){
  int fontStyle=getFontStyle();
  String fname=getFontName(tags);
  SHAPE shp=SHAPERECORD.systemFontCharacterToSHAPE(fname,fontStyle,getDivider() * 1024,character);
  glyphShapeTable.add(shp);
  codeTable.add((int)character);
  if (fontFlagsHasLayout) {
    fontBoundsTable.add(shp.getBounds());
    Font fnt=new Font(fname,fontStyle,getDivider() * 1024);
    fontAdvanceTable.add((new JPanel()).getFontMetrics(fnt).charWidth(character));
  }
  numGlyphs++;
}
Program: 62081
Project: 62081
Buggy source:
@Override public void addCharacter(List<Tag> tags,char character){
  glyphShapeTable.add(SHAPERECORD.systemFontCharacterToSHAPE(getFontName(tags),getFontStyle(),getDivider() * 1000,character));
  ensureFontInfo(tags);
  if (fontInfoTag != null) {
    fontInfoTag.codeTable.add((int)character);
  }
  if (fontInfo2Tag != null) {
    fontInfo2Tag.codeTable.add((int)character);
  }
}

Fixed version (ground truth):
@Override public void addCharacter(List<Tag> tags,char character){
  glyphShapeTable.add(SHAPERECORD.systemFontCharacterToSHAPE(getFontName(tags),getFontStyle(),getDivider() * 1024,character));
  ensureFontInfo(tags);
  if (fontInfoTag != null) {
    fontInfoTag.codeTable.add((int)character);
  }
  if (fontInfo2Tag != null) {
    fontInfo2Tag.codeTable.add((int)character);
  }
}
Program: 62086
Project: 62086
Buggy source:
@Override public String toString(List<Object> localData){
  if (!(getLeftMostItem(rightSide) instanceof NegAVM2Item)) {
    return super.toString(localData);
  }
  String ret="String_Node_Str";
  if (leftSide.getPrecedence() > precedence) {
    ret+="String_Node_Str" + leftSide.toString(localData) + "String_Node_Str";
  }
 else {
    ret+=leftSide.toString(localData);
  }
  ret+=hilight(operator);
  ret+="String_Node_Str" + rightSide.toString(localData) + "String_Node_Str";
  return ret;
}

Fixed version (ground truth):
@Override public String toString(List<Object> localData){
  if (rightSide.precedence >= precedence) {
    String ret="String_Node_Str";
    if (leftSide.precedence > precedence) {
      ret+="String_Node_Str" + leftSide.toString(localData) + "String_Node_Str";
    }
 else {
      ret+=leftSide.toString(localData);
    }
    ret+="String_Node_Str";
    ret+=hilight(operator);
    ret+="String_Node_Str";
    ret+="String_Node_Str" + rightSide.toString(localData) + "String_Node_Str";
    return ret;
  }
 else {
    return super.toString(localData);
  }
}
Program: 62087
Project: 62087
Buggy source:
@Override public String toString(List<Object> localData){
  if (rightSide instanceof DirectValueActionItem) {
    return super.toString(localData);
  }
  String ret="String_Node_Str";
  if (leftSide.getPrecedence() > precedence) {
    ret+="String_Node_Str" + leftSide.toString(localData) + "String_Node_Str";
  }
 else {
    ret+=leftSide.toString(localData);
  }
  ret+=hilight(operator);
  ret+="String_Node_Str" + rightSide.toString(localData) + "String_Node_Str";
  return ret;
}

Fixed version (ground truth):
@Override public String toString(List<Object> localData){
  if (rightSide.precedence >= precedence) {
    String ret="String_Node_Str";
    if (leftSide.precedence > precedence) {
      ret+="String_Node_Str" + leftSide.toString(localData) + "String_Node_Str";
    }
 else {
      ret+=leftSide.toString(localData);
    }
    ret+="String_Node_Str";
    ret+=hilight(operator);
    ret+="String_Node_Str";
    ret+="String_Node_Str" + rightSide.toString(localData) + "String_Node_Str";
    return ret;
  }
 else {
    return super.toString(localData);
  }
}
Program: 62088
Project: 62088
Buggy source:
@Override public String toString(List<Object> localData){
  String ret="String_Node_Str";
  if (leftSide.getPrecedence() > precedence) {
    ret+="String_Node_Str" + leftSide.toString(localData) + "String_Node_Str";
  }
 else {
    ret+=leftSide.toString(localData);
  }
  ret+=hilight(operator);
  if (rightSide.getPrecedence() > precedence) {
    ret+="String_Node_Str" + rightSide.toString(localData) + "String_Node_Str";
  }
 else {
    ret+=rightSide.toString(localData);
  }
  return ret;
}

Fixed version (ground truth):
@Override public String toString(List<Object> localData){
  String ret="String_Node_Str";
  if (leftSide.getPrecedence() > precedence) {
    ret+="String_Node_Str" + leftSide.toString(localData) + "String_Node_Str";
  }
 else {
    ret+=leftSide.toString(localData);
  }
  ret+="String_Node_Str";
  ret+=hilight(operator);
  ret+="String_Node_Str";
  if (rightSide.getPrecedence() > precedence) {
    ret+="String_Node_Str" + rightSide.toString(localData) + "String_Node_Str";
  }
 else {
    ret+=rightSide.toString(localData);
  }
  return ret;
}
Program: 62091
Project: 62091
Buggy source:
public static int removeTraps(List<Object> localData,AVM2GraphSource code,int addr,String path){
  HashMap<GraphSourceItem,AVM2Code.Decision> decisions=new HashMap<>();
  HashMap<Integer,List<Integer>> refs=new HashMap<>();
  code.getCode().visitCode(0,code.size() - 1,refs);
  removeTraps(refs,false,false,localData,new Stack<GraphTargetItem>(),new ArrayList<GraphTargetItem>(),code,code.adr2pos(addr),new HashMap<Integer,Integer>(),new HashMap<Integer,HashMap<Integer,GraphTargetItem>>(),decisions,path);
  localData.set(2,new HashMap<Integer,GraphTargetItem>());
  return removeTraps(refs,true,false,localData,new Stack<GraphTargetItem>(),new ArrayList<GraphTargetItem>(),code,code.adr2pos(addr),new HashMap<Integer,Integer>(),new HashMap<Integer,HashMap<Integer,GraphTargetItem>>(),decisions,path);
}

Fixed version (ground truth):
public static int removeTraps(ConstantPool constants,MethodBody body,List<Object> localData,AVM2GraphSource code,int addr,String path){
  HashMap<GraphSourceItem,AVM2Code.Decision> decisions=new HashMap<>();
  HashMap<Integer,List<Integer>> refs=new HashMap<>();
  code.getCode().visitCode(0,code.size() - 1,refs);
  removeTraps(refs,false,false,localData,new Stack<GraphTargetItem>(),new ArrayList<GraphTargetItem>(),code,code.adr2pos(addr),new HashMap<Integer,Integer>(),new HashMap<Integer,HashMap<Integer,GraphTargetItem>>(),decisions,path);
  localData.set(2,new HashMap<Integer,GraphTargetItem>());
  int cnt=removeTraps(refs,true,false,localData,new Stack<GraphTargetItem>(),new ArrayList<GraphTargetItem>(),code,code.adr2pos(addr),new HashMap<Integer,Integer>(),new HashMap<Integer,HashMap<Integer,GraphTargetItem>>(),decisions,path);
  code.getCode().removeIgnored(constants,body);
  return cnt;
}
Program: 62094
Project: 62094
Buggy source:
/** 
 * Converts list of actions to ActionScript source code
 * @param actions List of actions
 * @param version SWF version
 * @param path
 * @return String with Source code
 */
public static String actionsToSource(List<Action> actions,int version,String path){
  try {
    int staticOperation=(Boolean)Configuration.getConfig("String_Node_Str",true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC;
    List<GraphTargetItem> tree=actionsToTree(new HashMap<Integer,String>(),new HashMap<String,GraphTargetItem>(),new HashMap<String,GraphTargetItem>(),actions,version,staticOperation,path);
    return Graph.graphToString(tree);
  }
 catch (  Exception|OutOfMemoryError|StackOverflowError ex2) {
    Logger.getLogger(Action.class.getName()).log(Level.SEVERE,"String_Node_Str",ex2);
    if (ex2 instanceof OutOfMemoryError) {
      System.gc();
    }
    return "String_Node_Str" + ex2.getClass().getSimpleName() + "String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * Converts list of actions to ActionScript source code
 * @param actions List of actions
 * @param version SWF version
 * @param path
 * @return String with Source code
 */
public static String actionsToSource(List<Action> actions,int version,String path){
  try {
    int staticOperation=Graph.SOP_USE_STATIC;
    List<GraphTargetItem> tree=actionsToTree(new HashMap<Integer,String>(),new HashMap<String,GraphTargetItem>(),new HashMap<String,GraphTargetItem>(),actions,version,staticOperation,path);
    return Graph.graphToString(tree);
  }
 catch (  Exception|OutOfMemoryError|StackOverflowError ex2) {
    Logger.getLogger(Action.class.getName()).log(Level.SEVERE,"String_Node_Str",ex2);
    if (ex2 instanceof OutOfMemoryError) {
      System.gc();
    }
    return "String_Node_Str" + ex2.getClass().getSimpleName() + "String_Node_Str";
  }
}
Program: 62098
Project: 62098
Buggy source:
@Override public String toString(ConstantPool constants){
  String ret;
  ret=hilight("String_Node_Str") + className.toStringNoQuotes(Helper.toList(constants));
  if (extendsOp != null) {
    ret+=hilight("String_Node_Str") + extendsOp.toStringNoQuotes(Helper.toList(constants));
  }
  if (!implementsOp.isEmpty()) {
    ret+=hilight("String_Node_Str");
    boolean first=true;
    for (    GraphTargetItem t : implementsOp) {
      if (!first) {
        ret+="String_Node_Str";
      }
      first=false;
      ret+=Action.getWithoutGlobal(t).toString(constants);
    }
  }
  ret+="String_Node_Str";
  for (  GraphTargetItem f : functions) {
    ret+=f.toString(constants) + "String_Node_Str";
  }
  for (  GraphTargetItem f : staticFunctions) {
    ret+="String_Node_Str" + f.toString(constants) + "String_Node_Str";
  }
  for (  GraphTargetItem v : vars.keySet()) {
    ret+="String_Node_Str" + v.toStringNoQuotes(constants) + "String_Node_Str"+ vars.get(v).toStringNoQuotes(constants)+ "String_Node_Str";
  }
  for (  GraphTargetItem v : staticVars.keySet()) {
    ret+="String_Node_Str" + v.toStringNoQuotes(constants) + "String_Node_Str"+ staticVars.get(v).toStringNoQuotes(constants)+ "String_Node_Str";
  }
  ret+="String_Node_Str";
  return ret;
}

Fixed version (ground truth):
@Override public String toString(ConstantPool constants){
  String ret;
  ret=hilight("String_Node_Str") + className.toStringNoQuotes(Helper.toList(constants));
  if (extendsOp != null) {
    ret+=hilight("String_Node_Str") + extendsOp.toStringNoQuotes(Helper.toList(constants));
  }
  if (!implementsOp.isEmpty()) {
    ret+=hilight("String_Node_Str");
    boolean first=true;
    for (    GraphTargetItem t : implementsOp) {
      if (!first) {
        ret+="String_Node_Str";
      }
      first=false;
      ret+=Action.getWithoutGlobal(t).toString(constants);
    }
  }
  ret+="String_Node_Str";
  for (  GraphTargetItem f : functions) {
    ret+=f.toString(constants) + "String_Node_Str";
  }
  for (  GraphTargetItem f : staticFunctions) {
    ret+="String_Node_Str" + f.toString(constants) + "String_Node_Str";
  }
  for (  KeyValue<GraphTargetItem,GraphTargetItem> item : vars) {
    ret+="String_Node_Str" + item.key.toStringNoQuotes(constants) + "String_Node_Str"+ item.value.toStringNoQuotes(constants)+ "String_Node_Str";
  }
  for (  KeyValue<GraphTargetItem,GraphTargetItem> item : staticVars) {
    ret+="String_Node_Str" + item.key.toStringNoQuotes(constants) + "String_Node_Str"+ item.value.toStringNoQuotes(constants)+ "String_Node_Str";
  }
  ret+="String_Node_Str";
  return ret;
}
Program: 62099
Project: 62099
Buggy source:
public ClassTreeItem(GraphTargetItem className,GraphTargetItem extendsOp,List<GraphTargetItem> implementsOp,List<GraphTargetItem> functions,HashMap<GraphTargetItem,GraphTargetItem> vars,List<GraphTargetItem> staticFunctions,HashMap<GraphTargetItem,GraphTargetItem> staticVars){
  super(null,NOPRECEDENCE);
  this.className=className;
  this.functions=functions;
  this.vars=vars;
  this.extendsOp=extendsOp;
  this.implementsOp=implementsOp;
  this.staticFunctions=staticFunctions;
  this.staticVars=staticVars;
}

Fixed version (ground truth):
public ClassTreeItem(GraphTargetItem className,GraphTargetItem extendsOp,List<GraphTargetItem> implementsOp,List<GraphTargetItem> functions,List<KeyValue<GraphTargetItem,GraphTargetItem>> vars,List<GraphTargetItem> staticFunctions,List<KeyValue<GraphTargetItem,GraphTargetItem>> staticVars){
  super(null,NOPRECEDENCE);
  this.className=className;
  this.functions=functions;
  this.vars=vars;
  this.extendsOp=extendsOp;
  this.implementsOp=implementsOp;
  this.staticFunctions=staticFunctions;
  this.staticVars=staticVars;
}
Program: 62103
Project: 62103
Buggy source:
@Override public String toString(ConstantPool constants){
  String ret;
  ret=hilight("String_Node_Str") + className.toStringNoQuotes(Helper.toList(constants));
  if (extendsOp != null) {
    ret+=hilight("String_Node_Str") + extendsOp.toStringNoQuotes(Helper.toList(constants));
  }
  if (!implementsOp.isEmpty()) {
    ret+=hilight("String_Node_Str");
    boolean first=true;
    for (    GraphTargetItem t : implementsOp) {
      if (!first) {
        ret+="String_Node_Str";
      }
      first=false;
      ret+=Action.getWithoutGlobal(t).toString(constants);
    }
  }
  ret+="String_Node_Str";
  for (  GraphTargetItem f : functions) {
    ret+=f.toString(constants) + "String_Node_Str";
  }
  for (  GraphTargetItem f : staticFunctions) {
    ret+="String_Node_Str" + f.toString(constants) + "String_Node_Str";
  }
  for (  KeyValue<GraphTargetItem,GraphTargetItem> item : vars) {
    ret+="String_Node_Str" + item.key.toStringNoQuotes(constants) + "String_Node_Str"+ item.value.toStringNoQuotes(constants)+ "String_Node_Str";
  }
  for (  KeyValue<GraphTargetItem,GraphTargetItem> item : staticVars) {
    ret+="String_Node_Str" + item.key.toStringNoQuotes(constants) + "String_Node_Str"+ item.value.toStringNoQuotes(constants)+ "String_Node_Str";
  }
  ret+="String_Node_Str";
  return ret;
}

Fixed version (ground truth):
@Override public String toString(ConstantPool constants){
  String ret;
  ret=hilight("String_Node_Str") + className.toStringNoQuotes(Helper.toList(constants));
  if (extendsOp != null) {
    ret+=hilight("String_Node_Str") + extendsOp.toStringNoQuotes(Helper.toList(constants));
  }
  if (!implementsOp.isEmpty()) {
    ret+=hilight("String_Node_Str");
    boolean first=true;
    for (    GraphTargetItem t : implementsOp) {
      if (!first) {
        ret+="String_Node_Str";
      }
      first=false;
      ret+=Action.getWithoutGlobal(t).toString(constants);
    }
  }
  ret+="String_Node_Str";
  for (  GraphTargetItem f : functions) {
    ret+=f.toString(constants) + "String_Node_Str";
  }
  for (  GraphTargetItem f : staticFunctions) {
    ret+="String_Node_Str" + f.toString(constants) + "String_Node_Str";
  }
  for (  KeyValue<GraphTargetItem,GraphTargetItem> item : vars) {
    ret+="String_Node_Str" + item.key.toStringNoQuotes(constants) + "String_Node_Str"+ item.value.toString(constants)+ "String_Node_Str";
  }
  for (  KeyValue<GraphTargetItem,GraphTargetItem> item : staticVars) {
    ret+="String_Node_Str" + item.key.toStringNoQuotes(constants) + "String_Node_Str"+ item.value.toString(constants)+ "String_Node_Str";
  }
  ret+="String_Node_Str";
  return ret;
}
Program: 62104
Project: 62104
Buggy source:
@Override public String toString(ConstantPool constants){
  String paramStr="String_Node_Str";
  for (int t=0; t < arguments.size(); t++) {
    if (t > 0) {
      paramStr+=hilight("String_Node_Str");
    }
    paramStr+=arguments.get(t).toStringNL(constants);
  }
  boolean blankMethod=false;
  if (methodName instanceof DirectValueTreeItem) {
    if (((DirectValueTreeItem)methodName).value instanceof Undefined) {
      blankMethod=true;
    }
    if (((DirectValueTreeItem)methodName).value instanceof String) {
      if (((DirectValueTreeItem)methodName).value.equals("String_Node_Str")) {
        blankMethod=true;
      }
    }
  }
  if (blankMethod) {
    return scriptObject.toString(constants) + hilight("String_Node_Str") + paramStr+ hilight("String_Node_Str");
  }
  return scriptObject.toString(constants) + hilight("String_Node_Str") + stripQuotes(methodName,constants)+ hilight("String_Node_Str")+ paramStr+ hilight("String_Node_Str");
}

Fixed version (ground truth):
@Override public String toString(ConstantPool constants){
  String paramStr="String_Node_Str";
  for (int t=0; t < arguments.size(); t++) {
    if (t > 0) {
      paramStr+=hilight("String_Node_Str");
    }
    paramStr+=arguments.get(t).toStringNL(constants);
  }
  boolean blankMethod=false;
  if (methodName instanceof DirectValueTreeItem) {
    if (((DirectValueTreeItem)methodName).value instanceof Undefined) {
      blankMethod=true;
    }
    if (((DirectValueTreeItem)methodName).value instanceof String) {
      if (((DirectValueTreeItem)methodName).value.equals("String_Node_Str")) {
        blankMethod=true;
      }
    }
  }
  if (blankMethod) {
    return scriptObject.toString(constants) + hilight("String_Node_Str") + paramStr+ hilight("String_Node_Str");
  }
  String soStr=scriptObject.toString(constants);
  if (scriptObject.precedence > this.precedence) {
    soStr="String_Node_Str" + soStr + "String_Node_Str";
  }
  return soStr + hilight("String_Node_Str") + stripQuotes(methodName,constants)+ hilight("String_Node_Str")+ paramStr+ hilight("String_Node_Str");
}
Program: 62105
Project: 62105
Buggy source:
public boolean contains(Object key){
  return cacheFiles.containsKey(key);
}

Fixed version (ground truth):
public boolean contains(Object key){
  if (storageType == STORAGE_FILES) {
    return cacheFiles.containsKey(key);
  }
 else   if (storageType == STORAGE_MEMORY) {
    return cacheMemory.containsKey(key);
  }
  return false;
}
Program: 62106
Project: 62106
Buggy source:
public void setScript(ScriptPack scriptLeaf,List<ABCContainerTag> abcList){
  int scriptIndex=scriptLeaf.scriptIndex;
  ScriptInfo script=null;
  ABC abc=scriptLeaf.abc;
  if (scriptIndex > -1) {
    script=abc.script_info[scriptIndex];
  }
  if (script == null) {
    highlights=new ArrayList<>();
    traitHighlights=new ArrayList<>();
    methodHighlights=new ArrayList<>();
    this.script=scriptLeaf;
    return;
  }
  setText("String_Node_Str" + translate("String_Node_Str") + "String_Node_Str");
  String hilightedCode="String_Node_Str";
  cacheScriptPack(scriptLeaf,abcList);
  CachedDecompilation cd=getCached(scriptLeaf);
  hilightedCode=cd.text;
  highlights=cd.getHighlights();
  traitHighlights=cd.getTraitHighlights();
  methodHighlights=cd.getMethodHighlights();
  classHighlights=cd.getClassHighlights();
  this.abc=abc;
  this.abcList=abcList;
  this.script=scriptLeaf;
  setText(hilightedCode);
}

Fixed version (ground truth):
public void setScript(ScriptPack scriptLeaf,List<ABCContainerTag> abcList){
  int scriptIndex=scriptLeaf.scriptIndex;
  ScriptInfo script=null;
  ABC abc=scriptLeaf.abc;
  if (scriptIndex > -1) {
    script=abc.script_info[scriptIndex];
  }
  if (script == null) {
    highlights=new ArrayList<>();
    traitHighlights=new ArrayList<>();
    methodHighlights=new ArrayList<>();
    this.script=scriptLeaf;
    return;
  }
  setText("String_Node_Str" + translate("String_Node_Str") + "String_Node_Str");
  this.abc=abc;
  this.abcList=abcList;
  this.script=scriptLeaf;
  String hilightedCode="String_Node_Str";
  cacheScriptPack(scriptLeaf,abcList);
  CachedDecompilation cd=getCached(scriptLeaf);
  hilightedCode=cd.text;
  highlights=cd.getHighlights();
  traitHighlights=cd.getTraitHighlights();
  methodHighlights=cd.getMethodHighlights();
  classHighlights=cd.getClassHighlights();
  setText(hilightedCode);
}
Program: 62107
Project: 62107
Buggy source:
public Object get(Object key){
  if (storageType == STORAGE_FILES) {
    if (!cacheFiles.containsKey(key)) {
      return null;
    }
    File f=cacheFiles.get(key);
    try (FileInputStream fis=new FileInputStream(f)){
      ObjectInputStream ois=new ObjectInputStream(fis);
      return ois.readObject();
    }
 catch (    IOException|ClassNotFoundException ex) {
      Logger.getLogger(Helper.class.getName()).log(Level.SEVERE,null,ex);
    }
    return null;
  }
 else   if (storageType == STORAGE_MEMORY) {
    if (!cacheMemory.containsKey(key)) {
      return cacheMemory.get(key);
    }
    return null;
  }
  return null;
}

Fixed version (ground truth):
public Object get(Object key){
  if (storageType == STORAGE_FILES) {
    if (!cacheFiles.containsKey(key)) {
      return null;
    }
    File f=cacheFiles.get(key);
    try (FileInputStream fis=new FileInputStream(f)){
      ObjectInputStream ois=new ObjectInputStream(fis);
      return ois.readObject();
    }
 catch (    IOException|ClassNotFoundException ex) {
      Logger.getLogger(Helper.class.getName()).log(Level.SEVERE,null,ex);
    }
    return null;
  }
 else   if (storageType == STORAGE_MEMORY) {
    if (cacheMemory.containsKey(key)) {
      return cacheMemory.get(key);
    }
    return null;
  }
  return null;
}
Program: 62108
Project: 62108
Buggy source:
/** 
 * Reads one PIX24 value from the stream
 * @return PIX24 value
 * @throws IOException
 */
public PIX24 readPIX24() throws IOException {
  PIX24 ret=new PIX24();
  readUI8();
  ret.red=readUI8();
  ret.green=readUI8();
  ret.blue=readUI8();
  return ret;
}

Fixed version (ground truth):
/** 
 * Reads one PIX24 value from the stream
 * @return PIX24 value
 * @throws IOException
 */
public PIX24 readPIX24() throws IOException {
  PIX24 ret=new PIX24();
  ret.reserved=readUI8();
  ret.red=readUI8();
  ret.green=readUI8();
  ret.blue=readUI8();
  return ret;
}
Program: 62109
Project: 62109
Buggy source:
/** 
 * Writes PIX24 value to the stream
 * @param value PIX24 value
 * @throws IOException
 */
public void writePIX24(PIX24 value) throws IOException {
  writeUI8(0);
  writeUI8(value.red);
  writeUI8(value.green);
  writeUI8(value.blue);
}

Fixed version (ground truth):
/** 
 * Writes PIX24 value to the stream
 * @param value PIX24 value
 * @throws IOException
 */
public void writePIX24(PIX24 value) throws IOException {
  writeUI8(value.reserved);
  writeUI8(value.red);
  writeUI8(value.green);
  writeUI8(value.blue);
}
Program: 62113
Project: 62113
Buggy source:
private static String convertVideoInstance(MATRIX matrix,DefineVideoStreamTag video){
  String ret="String_Node_Str" + video.characterID + "String_Node_Str"+ (20 * video.width)+ "String_Node_Str"+ (20 * video.height)+ "String_Node_Str";
  ret+="String_Node_Str";
  ret+=convertMatrix(matrix);
  ret+="String_Node_Str";
  ret+="String_Node_Str";
  ret+="String_Node_Str";
  ret+="String_Node_Str";
  ret+="String_Node_Str";
  return ret;
}

Fixed version (ground truth):
private static String convertVideoInstance(String instanceName,MATRIX matrix,DefineVideoStreamTag video){
  String ret="String_Node_Str" + video.characterID + "String_Node_Str"+ (20 * video.width)+ "String_Node_Str"+ (20 * video.height)+ "String_Node_Str";
  if (instanceName != null) {
    ret+="String_Node_Str" + xmlString(instanceName) + "String_Node_Str";
  }
  ret+="String_Node_Str";
  ret+="String_Node_Str";
  ret+=convertMatrix(matrix);
  ret+="String_Node_Str";
  ret+="String_Node_Str";
  ret+="String_Node_Str";
  ret+="String_Node_Str";
  ret+="String_Node_Str";
  return ret;
}
Program: 62119
Project: 62119
Buggy source:
public AVM2Code deepCopy(){
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    try (ObjectOutputStream oos=new ObjectOutputStream(baos)){
      oos.writeObject(this);
      oos.flush();
    }
     AVM2Code copy;
    try (ObjectInputStream ois=new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))){
      copy=(AVM2Code)ois.readObject();
    }
     return copy;
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
public AVM2Code deepCopy(){
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    try (ObjectOutputStream oos=new ObjectOutputStream(baos)){
      oos.writeObject(this);
      oos.flush();
    }
     AVM2Code copy;
    try (ObjectInputStream ois=new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()))){
      copy=(AVM2Code)ois.readObject();
    }
     return copy;
  }
 catch (  Exception ex) {
    Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
    return null;
  }
}
Program: 62121
Project: 62121
Buggy source:
@Override public boolean toBoolean(){
  return (leftSide.toBoolean() != rightSide.toBoolean()) && (leftSide.toNumber() != rightSide.toNumber());
}

Fixed version (ground truth):
@Override public boolean toBoolean(){
  return !((leftSide.toBoolean() == rightSide.toBoolean()) && (leftSide.toNumber() == rightSide.toNumber()));
}
Program: 62127
Project: 62127
Buggy source:
private void assignClassesToSymbols(){
  HashMap<Integer,String> classes=new HashMap<>();
  for (  Tag t : tags) {
    if (t instanceof SymbolClassTag) {
      SymbolClassTag sct=(SymbolClassTag)t;
      for (int i=0; i < sct.tagIDs.length; i++) {
        if ((!classes.containsKey(sct.tagIDs[i])) && (!classes.containsValue(sct.classNames[i]))) {
          classes.put(sct.tagIDs[i],sct.classNames[i]);
        }
      }
    }
  }
  for (  Tag t : tags) {
    if (t instanceof CharacterIdTag) {
      CharacterIdTag ct=(CharacterIdTag)t;
      if (classes.containsKey(ct.getCharacterID())) {
        ct.setClassName(classes.get(ct.getCharacterID()));
      }
    }
  }
}

Fixed version (ground truth):
public void assignClassesToSymbols(){
  HashMap<Integer,String> classes=new HashMap<>();
  for (  Tag t : tags) {
    if (t instanceof SymbolClassTag) {
      SymbolClassTag sct=(SymbolClassTag)t;
      for (int i=0; i < sct.tagIDs.length; i++) {
        if ((!classes.containsKey(sct.tagIDs[i])) && (!classes.containsValue(sct.classNames[i]))) {
          classes.put(sct.tagIDs[i],sct.classNames[i]);
        }
      }
    }
  }
  for (  Tag t : tags) {
    if (t instanceof CharacterIdTag) {
      CharacterIdTag ct=(CharacterIdTag)t;
      if (classes.containsKey(ct.getCharacterID())) {
        ct.setClassName(classes.get(ct.getCharacterID()));
      }
    }
  }
}