nus-yam/ex-repair huggingface dataset:
Program: 62013
Project: 62013
Buggy source:
public ActionDefineFunction2(long containerSWFPos,boolean ignoreNops,List<Label> labels,long address,FlasmLexer lexer,List<String> constantPool,int version) throws IOException, ParseException {
  super(0x8E,-1);
  functionName=lexString(lexer);
  int numParams=(int)lexLong(lexer);
  registerCount=(int)lexLong(lexer);
  preloadParentFlag=lexBoolean(lexer);
  preloadRootFlag=lexBoolean(lexer);
  suppressSuperFlag=lexBoolean(lexer);
  preloadSuperFlag=lexBoolean(lexer);
  suppressArgumentsFlag=lexBoolean(lexer);
  preloadArgumentsFlag=lexBoolean(lexer);
  suppressThisFlag=lexBoolean(lexer);
  preloadThisFlag=lexBoolean(lexer);
  preloadGlobalFlag=lexBoolean(lexer);
  for (int i=0; i < numParams; i++) {
    paramRegisters.add((int)lexLong(lexer));
    paramNames.add(lexString(lexer));
  }
  lexBlockOpen(lexer);
}

Fixed version (ground truth):
public ActionDefineFunction2(FlasmLexer lexer) throws IOException, ParseException {
  super(0x8E,-1);
  functionName=lexString(lexer);
  int numParams=(int)lexLong(lexer);
  registerCount=(int)lexLong(lexer);
  preloadParentFlag=lexBoolean(lexer);
  preloadRootFlag=lexBoolean(lexer);
  suppressSuperFlag=lexBoolean(lexer);
  preloadSuperFlag=lexBoolean(lexer);
  suppressArgumentsFlag=lexBoolean(lexer);
  preloadArgumentsFlag=lexBoolean(lexer);
  suppressThisFlag=lexBoolean(lexer);
  preloadThisFlag=lexBoolean(lexer);
  preloadGlobalFlag=lexBoolean(lexer);
  for (int i=0; i < numParams; i++) {
    paramRegisters.add((int)lexLong(lexer));
    paramNames.add(lexString(lexer));
  }
  lexBlockOpen(lexer);
}
Program: 62014
Project: 62014
Buggy source:
public ActionTry(long containerSWFPos,boolean ignoreNops,List<Label> labels,long address,FlasmLexer lexer,List<String> constantPool,int version) throws IOException, ParseException {
  super(0x8F,0);
  this.version=version;
  ASMParsedSymbol symb=lexer.yylex();
  if (symb.type == ASMParsedSymbol.TYPE_STRING) {
    catchInRegisterFlag=false;
    catchName=(String)symb.value;
  }
 else   if (symb.type == ASMParsedSymbol.TYPE_REGISTER) {
    catchRegister=((RegisterNumber)symb.value).number;
    catchInRegisterFlag=true;
  }
 else   if (symb.type == ASMParsedSymbol.TYPE_BLOCK_START) {
    return;
  }
 else {
    throw new ParseException("String_Node_Str",lexer.yyline());
  }
  lexBlockOpen(lexer);
}

Fixed version (ground truth):
public ActionTry(FlasmLexer lexer,int version) throws IOException, ParseException {
  super(0x8F,0);
  this.version=version;
  ASMParsedSymbol symb=lexer.yylex();
  if (symb.type == ASMParsedSymbol.TYPE_STRING) {
    catchInRegisterFlag=false;
    catchName=(String)symb.value;
  }
 else   if (symb.type == ASMParsedSymbol.TYPE_REGISTER) {
    catchRegister=((RegisterNumber)symb.value).number;
    catchInRegisterFlag=true;
  }
 else   if (symb.type == ASMParsedSymbol.TYPE_BLOCK_START) {
    return;
  }
 else {
    throw new ParseException("String_Node_Str",lexer.yyline());
  }
  lexBlockOpen(lexer);
}
Program: 62015
Project: 62015
Buggy source:
@Override public boolean parseDivision(int pos,long addr,FlasmLexer lexer){
  try {
    ASMParsedSymbol symb=lexer.yylex();
    if (symb.type == ASMParsedSymbol.TYPE_INSTRUCTION_NAME) {
      if (((String)symb.value).toLowerCase().equals("String_Node_Str")) {
        trySize=addr - getAddress() - getHeaderSize();
        catchBlockFlag=true;
        lexBlockOpen(lexer);
        return true;
      }
      if (symb.type == ASMParsedSymbol.TYPE_INSTRUCTION_NAME) {
        if (((String)symb.value).toLowerCase().equals("String_Node_Str")) {
          if (catchBlockFlag) {
            catchSize=addr - getAddress() - getHeaderSize()- trySize;
          }
 else {
            trySize=addr - getAddress() - getHeaderSize();
          }
          finallyBlockFlag=true;
          lexBlockOpen(lexer);
          return true;
        }
 else {
          lexer.yypushback(lexer.yylength());
        }
      }
 else {
        lexer.yypushback(lexer.yylength());
      }
    }
 else {
      lexer.yypushback(lexer.yylength());
    }
  }
 catch (  Exception ex) {
  }
  if (finallyBlockFlag) {
    finallySize=addr - getAddress() - getHeaderSize()- trySize- catchSize;
  }
 else   if (catchBlockFlag) {
    catchSize=addr - getAddress() - getHeaderSize()- trySize;
  }
  lexer.yybegin(0);
  return false;
}

Fixed version (ground truth):
@Override public boolean parseDivision(long size,FlasmLexer lexer){
  try {
    ASMParsedSymbol symb=lexer.yylex();
    if (symb.type == ASMParsedSymbol.TYPE_INSTRUCTION_NAME) {
      if (((String)symb.value).toLowerCase().equals("String_Node_Str")) {
        trySize=size - getHeaderSize();
        catchBlockFlag=true;
        lexBlockOpen(lexer);
        return true;
      }
      if (symb.type == ASMParsedSymbol.TYPE_INSTRUCTION_NAME) {
        if (((String)symb.value).toLowerCase().equals("String_Node_Str")) {
          if (catchBlockFlag) {
            catchSize=size - getHeaderSize() - trySize;
          }
 else {
            trySize=size - getHeaderSize();
          }
          finallyBlockFlag=true;
          lexBlockOpen(lexer);
          return true;
        }
 else {
          lexer.yypushback(lexer.yylength());
        }
      }
 else {
        lexer.yypushback(lexer.yylength());
      }
    }
 else {
      lexer.yypushback(lexer.yylength());
    }
  }
 catch (  Exception ex) {
  }
  if (finallyBlockFlag) {
    finallySize=size - getHeaderSize() - trySize- catchSize;
  }
 else   if (catchBlockFlag) {
    catchSize=size - getHeaderSize() - trySize;
  }
  lexer.yybegin(0);
  return false;
}
Program: 62017
Project: 62017
Buggy source:
/** 
 * Returns actions associated with this object
 * @param version Version
 * @return List of actions
 */
@Override public List<Action> getActions(int version){
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    int prevLength=0;
    if (previousTag != null) {
      byte prevData[]=previousTag.getData(version);
      baos.write(prevData);
      prevLength=prevData.length;
    }
    baos.write(actionBytes);
    ReReadableInputStream rri=new ReReadableInputStream(new ByteArrayInputStream(baos.toByteArray()));
    rri.setPos(prevLength);
    boolean deobfuscate=Configuration.getConfig("String_Node_Str",true);
    List<Action> list=SWFInputStream.readActionList(listeners,0,getPos() + hdrSize - prevLength,rri,version,prevLength,-1,toString());
    if (deobfuscate) {
      list=Action.removeNops(0,list,version,getPos() + hdrSize,toString());
    }
    return list;
  }
 catch (  Exception ex) {
    Logger.getLogger(DoActionTag.class.getName()).log(Level.SEVERE,null,ex);
    return new ArrayList<>();
  }
}

Fixed version (ground truth):
/** 
 * Returns actions associated with this object
 * @param version Version
 * @return List of actions
 */
@Override public List<Action> getActions(int version){
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    int prevLength=0;
    if (previousTag != null) {
      byte prevData[]=previousTag.getData(version);
      baos.write(prevData);
      prevLength=prevData.length;
    }
    baos.write(actionBytes);
    ReReadableInputStream rri=new ReReadableInputStream(new ByteArrayInputStream(baos.toByteArray()));
    rri.setPos(prevLength);
    boolean deobfuscate=Configuration.getConfig("String_Node_Str",true);
    List<Action> list=SWFInputStream.readActionList(listeners,getPos() + hdrSize - prevLength,rri,version,prevLength,-1,toString());
    if (deobfuscate) {
      list=Action.removeNops(0,list,version,getPos() + hdrSize,toString());
    }
    return list;
  }
 catch (  Exception ex) {
    Logger.getLogger(DoActionTag.class.getName()).log(Level.SEVERE,null,ex);
    return new ArrayList<>();
  }
}
Program: 62018
Project: 62018
Buggy source:
@Override public List<Action> getActions(int version){
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    int prevLength=0;
    if (previousTag != null) {
      byte prevData[]=previousTag.getData(version);
      baos.write(prevData);
      prevLength=prevData.length;
      byte header[]=SWFOutputStream.getTagHeader(this,data,version);
      baos.write(header);
      prevLength+=header.length;
    }
    baos.write(actionBytes);
    ReReadableInputStream rri=new ReReadableInputStream(new ByteArrayInputStream(baos.toByteArray()));
    rri.setPos(prevLength);
    boolean deobfuscate=Configuration.getConfig("String_Node_Str",true);
    List<Action> list=SWFInputStream.readActionList(listeners,0,getPos() - prevLength,rri,version,prevLength,-1,toString());
    if (deobfuscate) {
      list=Action.removeNops(0,list,version,getPos(),toString());
    }
    return list;
  }
 catch (  Exception ex) {
    Logger.getLogger(DoActionTag.class.getName()).log(Level.SEVERE,null,ex);
    return new ArrayList<>();
  }
}

Fixed version (ground truth):
@Override public List<Action> getActions(int version){
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    int prevLength=0;
    if (previousTag != null) {
      byte prevData[]=previousTag.getData(version);
      baos.write(prevData);
      prevLength=prevData.length;
      byte header[]=SWFOutputStream.getTagHeader(this,data,version);
      baos.write(header);
      prevLength+=header.length;
    }
    baos.write(actionBytes);
    ReReadableInputStream rri=new ReReadableInputStream(new ByteArrayInputStream(baos.toByteArray()));
    rri.setPos(prevLength);
    boolean deobfuscate=Configuration.getConfig("String_Node_Str",true);
    List<Action> list=SWFInputStream.readActionList(listeners,getPos() - prevLength,rri,version,prevLength,-1,toString());
    if (deobfuscate) {
      list=Action.removeNops(0,list,version,getPos(),toString());
    }
    return list;
  }
 catch (  Exception ex) {
    Logger.getLogger(DoActionTag.class.getName()).log(Level.SEVERE,null,ex);
    return new ArrayList<>();
  }
}
Program: 62019
Project: 62019
Buggy source:
@Override public List<Action> getActions(int version){
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    int prevLength=0;
    if (previousTag != null) {
      byte prevData[]=previousTag.getData(version);
      baos.write(prevData);
      prevLength=prevData.length;
      baos.write(0);
      baos.write(0);
      prevLength+=2;
      byte header[]=SWFOutputStream.getTagHeader(this,data,version);
      baos.write(header);
      prevLength+=header.length;
    }
    baos.write(actionBytes);
    ReReadableInputStream rri=new ReReadableInputStream(new ByteArrayInputStream(baos.toByteArray()));
    rri.setPos(prevLength);
    boolean deobfuscate=Configuration.getConfig("String_Node_Str",true);
    List<Action> list=SWFInputStream.readActionList(listeners,0,getPos() + 2 - prevLength,rri,version,prevLength,-1,toString());
    if (deobfuscate) {
      list=Action.removeNops(0,list,version,getPos() + 2,toString());
    }
    return list;
  }
 catch (  Exception ex) {
    Logger.getLogger(DoActionTag.class.getName()).log(Level.SEVERE,null,ex);
    return new ArrayList<>();
  }
}

Fixed version (ground truth):
@Override public List<Action> getActions(int version){
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    int prevLength=0;
    if (previousTag != null) {
      byte prevData[]=previousTag.getData(version);
      baos.write(prevData);
      prevLength=prevData.length;
      baos.write(0);
      baos.write(0);
      prevLength+=2;
      byte header[]=SWFOutputStream.getTagHeader(this,data,version);
      baos.write(header);
      prevLength+=header.length;
    }
    baos.write(actionBytes);
    ReReadableInputStream rri=new ReReadableInputStream(new ByteArrayInputStream(baos.toByteArray()));
    rri.setPos(prevLength);
    boolean deobfuscate=Configuration.getConfig("String_Node_Str",true);
    List<Action> list=SWFInputStream.readActionList(listeners,getPos() + 2 - prevLength,rri,version,prevLength,-1,toString());
    if (deobfuscate) {
      list=Action.removeNops(0,list,version,getPos() + 2,toString());
    }
    return list;
  }
 catch (  Exception ex) {
    Logger.getLogger(DoActionTag.class.getName()).log(Level.SEVERE,null,ex);
    return new ArrayList<>();
  }
}
Program: 62020
Project: 62020
Buggy source:
/** 
 * Returns actions associated with this object
 * @param version Version
 * @return List of actions
 */
@Override public List<Action> getActions(int version){
  try {
    boolean deobfuscate=Configuration.getConfig("String_Node_Str",true);
    List<Action> list=SWFInputStream.readActionList(listeners,0,getPos() + 4,new ReReadableInputStream(new ByteArrayInputStream(actionBytes)),version,0,-1,toString());
    if (deobfuscate) {
      list=Action.removeNops(0,list,version,getPos() + 4,toString());
    }
    return list;
  }
 catch (  Exception ex) {
    Logger.getLogger(BUTTONCONDACTION.class.getName()).log(Level.SEVERE,null,ex);
    return new ArrayList<>();
  }
}

Fixed version (ground truth):
/** 
 * Returns actions associated with this object
 * @param version Version
 * @return List of actions
 */
@Override public List<Action> getActions(int version){
  try {
    boolean deobfuscate=Configuration.getConfig("String_Node_Str",true);
    List<Action> list=SWFInputStream.readActionList(listeners,getPos() + 4,new ReReadableInputStream(new ByteArrayInputStream(actionBytes)),version,0,-1,toString());
    if (deobfuscate) {
      list=Action.removeNops(0,list,version,getPos() + 4,toString());
    }
    return list;
  }
 catch (  Exception ex) {
    Logger.getLogger(BUTTONCONDACTION.class.getName()).log(Level.SEVERE,null,ex);
    return new ArrayList<>();
  }
}
Program: 62021
Project: 62021
Buggy source:
@Override public List<Action> getActions(int version){
  try {
    boolean deobfuscate=Configuration.getConfig("String_Node_Str",true);
    List<Action> list=SWFInputStream.readActionList(listeners,0,getPos() + hdrPos,new ReReadableInputStream(new ByteArrayInputStream(actionBytes)),version,0,-1,toString());
    if (deobfuscate) {
      list=Action.removeNops(0,list,version,getPos() + hdrPos,toString());
    }
    return list;
  }
 catch (  Exception ex) {
    Logger.getLogger(BUTTONCONDACTION.class.getName()).log(Level.SEVERE,null,ex);
    return new ArrayList<>();
  }
}

Fixed version (ground truth):
@Override public List<Action> getActions(int version){
  try {
    boolean deobfuscate=Configuration.getConfig("String_Node_Str",true);
    List<Action> list=SWFInputStream.readActionList(listeners,getPos() + hdrPos,new ReReadableInputStream(new ByteArrayInputStream(actionBytes)),version,0,-1,toString());
    if (deobfuscate) {
      list=Action.removeNops(0,list,version,getPos() + hdrPos,toString());
    }
    return list;
  }
 catch (  Exception ex) {
    Logger.getLogger(BUTTONCONDACTION.class.getName()).log(Level.SEVERE,null,ex);
    return new ArrayList<>();
  }
}
Program: 62022
Project: 62022
Buggy source:
public boolean parseDivision(int pos,long addr,FlasmLexer lexer);

Fixed version (ground truth):
public boolean parseDivision(long size,FlasmLexer lexer);
Program: 62023
Project: 62023
Buggy source:
@Test public void testModifiedConstantPools(){
  String actionsString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  try {
    List<Action> actions=ASMParser.parse(0,0,true,new StringReader(actionsString),swf.version);
    DoActionTag doa=getFirstActionTag();
    doa.setActionBytes(Action.actionsToBytes(actions,true,swf.version));
    String actualResult=Action.actionsToSource(doa.getActions(swf.version),swf.version,"String_Node_Str",false);
    String decompiled=doa.getASMSource(swf.version,false,false);
    assertEquals(actualResult.trim(),"String_Node_Str");
    assertTrue(decompiled.contains("String_Node_Str"));
  }
 catch (  IOException ex) {
    fail();
  }
catch (  ParseException ex) {
    fail();
  }
}

Fixed version (ground truth):
@Test public void testModifiedConstantPools(){
  String actionsString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  try {
    List<Action> actions=ASMParser.parse(0,0,true,actionsString,swf.version);
    DoActionTag doa=getFirstActionTag();
    doa.setActionBytes(Action.actionsToBytes(actions,true,swf.version));
    String actualResult=Action.actionsToSource(doa.getActions(swf.version),swf.version,"String_Node_Str",false);
    String decompiled=doa.getASMSource(swf.version,false,false);
    assertEquals(actualResult.trim(),"String_Node_Str");
    assertTrue(decompiled.contains("String_Node_Str"));
  }
 catch (  IOException ex) {
    fail();
  }
catch (  ParseException ex) {
    fail();
  }
}
Program: 62024
Project: 62024
Buggy source:
/** 
 * Reads one MORPHGRADIENT value from the stream
 * @return MORPHGRADIENT value
 * @throws IOException
 */
public MORPHGRADIENT readMORPHGRADIENT() throws IOException {
  MORPHGRADIENT ret=new MORPHGRADIENT();
  int numGradients=(int)readUI8();
  ret.gradientRecords=new MORPHGRADRECORD[numGradients];
  for (int i=0; i < numGradients; i++) {
    ret.gradientRecords[i]=readMORPHGRADRECORD();
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Reads one MORPHGRADIENT value from the stream
 * @return MORPHGRADIENT value
 * @throws IOException
 */
public MORPHGRADIENT readMORPHGRADIENT() throws IOException {
  MORPHGRADIENT ret=new MORPHGRADIENT();
  int numGradients=(int)readUI8();
  ret.numGradientsExtra=numGradients & 0xf0;
  numGradients=numGradients & 0x0f;
  ret.gradientRecords=new MORPHGRADRECORD[numGradients];
  for (int i=0; i < numGradients; i++) {
    ret.gradientRecords[i]=readMORPHGRADRECORD();
  }
  return ret;
}
Program: 62025
Project: 62025
Buggy source:
/** 
 * Writes MORPHGRADIENT value to the stream
 * @param value MORPHGRADIENT value
 * @param shapeNum 1 in DefineMorphShape, 2 in DefineMorphShape2,...
 * @throws IOException
 */
public void writeMORPHGRADIENT(MORPHGRADIENT value,int shapeNum) throws IOException {
  writeUI8(value.gradientRecords.length);
  for (int i=0; i < value.gradientRecords.length; i++) {
    writeMORPHGRADRECORD(value.gradientRecords[i]);
  }
}

Fixed version (ground truth):
/** 
 * Writes MORPHGRADIENT value to the stream
 * @param value MORPHGRADIENT value
 * @param shapeNum 1 in DefineMorphShape, 2 in DefineMorphShape2,...
 * @throws IOException
 */
public void writeMORPHGRADIENT(MORPHGRADIENT value,int shapeNum) throws IOException {
  writeUI8(value.gradientRecords.length + value.numGradientsExtra);
  for (int i=0; i < value.gradientRecords.length; i++) {
    writeMORPHGRADRECORD(value.gradientRecords[i]);
  }
}
Program: 62027
Project: 62027
Buggy source:
@Override public void endDocument(){
}

Fixed version (ground truth):
@Override public void endDocument(){
  if (this.result.equals("String_Node_Str")) {
    putText("String_Node_Str");
  }
}
Program: 62031
Project: 62031
Buggy source:
public void showFor(final JTextComponent target){
  oldCaretPosition=target.getCaretPosition();
  Container view=target.getParent();
  Dimension wd=getSize();
  wd.width=target.getVisibleRect().width;
  Point loc=new Point(0,view.getHeight());
  setSize(wd);
  setLocationRelativeTo(view);
  SwingUtilities.convertPointToScreen(loc,view);
  setLocation(loc);
  jTxtFind.setFont(target.getFont());
  jTxtFind.getDocument().addDocumentListener(this);
  WindowAdapter closeListener=new WindowAdapter(){
    @Override public void windowDeactivated(    WindowEvent e){
      target.getDocument().removeDocumentListener(QuickFindDialog.this);
      Markers.removeMarkers(target,marker);
      if (escaped) {
        Rectangle aRect;
        try {
          aRect=target.modelToView(oldCaretPosition);
          target.setCaretPosition(oldCaretPosition);
          target.scrollRectToVisible(aRect);
        }
 catch (        BadLocationException ex) {
        }
      }
      dispose();
    }
  }
;
  addWindowListener(closeListener);
  this.target=new WeakReference<JTextComponent>(target);
  Pattern p=dsd.get().getPattern();
  if (p != null) {
    jTxtFind.setText(p.pattern());
  }
  jChkWrap.setSelected(dsd.get().isWrap());
  setVisible(true);
}

Fixed version (ground truth):
public void showFor(final JTextComponent target){
  oldCaretPosition=target.getCaretPosition();
  Container view=target.getParent();
  Dimension wd=getSize();
  Point loc=new Point(0,view.getHeight() - getHeight());
  setSize(wd);
  setLocationRelativeTo(view);
  SwingUtilities.convertPointToScreen(loc,view);
  setLocation(loc);
  jTxtFind.setFont(target.getFont());
  jTxtFind.getDocument().addDocumentListener(this);
  WindowAdapter closeListener=new WindowAdapter(){
    @Override public void windowDeactivated(    WindowEvent e){
      target.getDocument().removeDocumentListener(QuickFindDialog.this);
      Markers.removeMarkers(target,marker);
      if (escaped) {
        Rectangle aRect;
        try {
          aRect=target.modelToView(oldCaretPosition);
          target.setCaretPosition(oldCaretPosition);
          target.scrollRectToVisible(aRect);
        }
 catch (        BadLocationException ex) {
        }
      }
      dispose();
    }
  }
;
  addWindowListener(closeListener);
  this.target=new WeakReference<JTextComponent>(target);
  Pattern p=dsd.get().getPattern();
  if (p != null) {
    jTxtFind.setText(p.pattern());
  }
  jChkWrap.setSelected(dsd.get().isWrap());
  setVisible(true);
}
Program: 62032
Project: 62032
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  if (expandButton.isSelected()) {
    expandButton.setIcon(View.getIcon("String_Node_Str"));
  }
  scrollPane.setVisible(expandButton.isSelected());
  scrollPane.setMinimumSize(new Dimension(getWidth(),500));
  scrollPane.setSize(new Dimension(getWidth(),500));
  revalidate();
  repaint();
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  expandButton.setIcon(expandButton.isSelected() ? expandIcon : collapseIcon);
  scrollPane.setVisible(expandButton.isSelected());
  revalidate();
  repaint();
}
Program: 62033
Project: 62033
Buggy source:
public ErrorLogFrame(){
  setTitle(translate("String_Node_Str"));
  setSize(700,400);
  setBackground(Color.white);
  View.centerScreen(this);
  View.setWindowIcon(this);
  setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
  Container cnt=getContentPane();
  cnt.setLayout(new BorderLayout());
  logView.setBackground(Color.white);
  logView.setLayout(new BoxLayout(logView,BoxLayout.Y_AXIS));
  cnt.setBackground(Color.white);
  cnt.add(new JScrollPane(logView),BorderLayout.NORTH);
  handler=new Handler(){
    @Override public void publish(    LogRecord record){
      log(record.getLevel(),record.getMessage(),record.getThrown());
    }
    @Override public void flush(){
    }
    @Override public void close() throws SecurityException {
    }
  }
;
}

Fixed version (ground truth):
public ErrorLogFrame(){
  setTitle(translate("String_Node_Str"));
  setSize(700,400);
  setBackground(Color.white);
  View.centerScreen(this);
  View.setWindowIcon(this);
  setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
  Container cnt=getContentPane();
  cnt.setLayout(new BorderLayout());
  logView.setBackground(Color.white);
  logView.setLayout(new BorderLayout());
  cnt.setBackground(Color.white);
  logViewInner.setLayout(new BoxLayout(logViewInner,BoxLayout.Y_AXIS));
  logView.add(logViewInner,BorderLayout.NORTH);
  expandIcon=View.getIcon("String_Node_Str");
  collapseIcon=View.getIcon("String_Node_Str");
  cnt.add(new JScrollPane(logView),BorderLayout.CENTER);
  handler=new Handler(){
    @Override public void publish(    LogRecord record){
      log(record.getLevel(),record.getMessage(),record.getThrown());
    }
    @Override public void flush(){
    }
    @Override public void close() throws SecurityException {
    }
  }
;
}
Program: 62035
Project: 62035
Buggy source:
public void showCard(String name,Trait trait){
  CardLayout layout=(CardLayout)innerPanel.getLayout();
  layout.show(innerPanel,name);
  boolean b=cardMap.get(name) instanceof TraitDetail;
  buttonsPanel.setVisible(b);
  selectedCard=name;
  selectedLabel.setText(selectedCard);
  if (trait == null) {
    traitNameLabel.setText("String_Node_Str");
  }
 else {
    traitNameLabel.setText("String_Node_Str" + trait.name_index + "String_Node_Str"+ Helper.escapeString(trait.getName(abcPanel.abc).toString(abcPanel.abc.constants,new ArrayList<String>()))+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public void showCard(String name,Trait trait){
  CardLayout layout=(CardLayout)innerPanel.getLayout();
  layout.show(innerPanel,name);
  boolean b=cardMap.get(name) instanceof TraitDetail;
  buttonsPanel.setVisible(b);
  TraitDetail newDetail=null;
  if (b) {
    newDetail=(TraitDetail)cardMap.get(name);
  }
  for (  JComponent v : cardMap.values()) {
    if (v instanceof TraitDetail) {
      if (v != newDetail) {
        TraitDetail oldDetail=(TraitDetail)v;
        oldDetail.setActive(false);
      }
    }
  }
  if (newDetail != null) {
    newDetail.setActive(true);
  }
  selectedCard=name;
  selectedLabel.setText(selectedCard);
  if (trait == null) {
    traitNameLabel.setText("String_Node_Str");
  }
 else {
    traitNameLabel.setText("String_Node_Str" + trait.name_index + "String_Node_Str"+ Helper.escapeString(trait.getName(abcPanel.abc).toString(abcPanel.abc.constants,new ArrayList<String>()))+ "String_Node_Str");
  }
}
Program: 62036
Project: 62036
Buggy source:
public MethodInfoPanel(){
  returnTypeEditor=new JEditorPane();
  paramEditor=new LineMarkedEditorPane();
  setLayout(new BoxLayout(this,BoxLayout.PAGE_AXIS));
  JPanel miPanel=new JPanel();
  miPanel.setLayout(new BoxLayout(miPanel,BoxLayout.LINE_AXIS));
  miPanel.add(new JLabel(translate("String_Node_Str")));
  methodIndexLabel=new JLabel("String_Node_Str");
  miPanel.add(methodIndexLabel);
  add(miPanel);
  add(new JLabel(translate("String_Node_Str")));
  add(new JScrollPane(paramEditor));
  add(new JLabel(translate("String_Node_Str")));
  JScrollPane jsp=new JScrollPane(returnTypeEditor);
  add(jsp);
  paramEditor.setContentType("String_Node_Str");
  returnTypeEditor.setContentType("String_Node_Str");
  paramEditor.setFont(new Font("String_Node_Str",Font.PLAIN,paramEditor.getFont().getSize()));
  returnTypeEditor.setFont(new Font("String_Node_Str",Font.PLAIN,returnTypeEditor.getFont().getSize()));
  jsp.setMaximumSize(new Dimension(1024,25));
  Flasm3MethodInfoSyntaxKit sk=(Flasm3MethodInfoSyntaxKit)returnTypeEditor.getEditorKit();
  sk.deinstallComponent(returnTypeEditor,"String_Node_Str");
}

Fixed version (ground truth):
public MethodInfoPanel(){
  returnTypeEditor=new UndoFixedEditorPane();
  paramEditor=new LineMarkedEditorPane();
  setLayout(new BoxLayout(this,BoxLayout.PAGE_AXIS));
  JPanel miPanel=new JPanel();
  miPanel.setLayout(new BoxLayout(miPanel,BoxLayout.LINE_AXIS));
  miPanel.add(new JLabel(translate("String_Node_Str")));
  methodIndexLabel=new JLabel("String_Node_Str");
  miPanel.add(methodIndexLabel);
  add(miPanel);
  add(new JLabel(translate("String_Node_Str")));
  add(new JScrollPane(paramEditor));
  add(new JLabel(translate("String_Node_Str")));
  JScrollPane jsp=new JScrollPane(returnTypeEditor);
  add(jsp);
  paramEditor.setContentType("String_Node_Str");
  returnTypeEditor.setContentType("String_Node_Str");
  paramEditor.setFont(new Font("String_Node_Str",Font.PLAIN,paramEditor.getFont().getSize()));
  returnTypeEditor.setFont(new Font("String_Node_Str",Font.PLAIN,returnTypeEditor.getFont().getSize()));
  jsp.setMaximumSize(new Dimension(1024,25));
  Flasm3MethodInfoSyntaxKit sk=(Flasm3MethodInfoSyntaxKit)returnTypeEditor.getEditorKit();
  sk.deinstallComponent(returnTypeEditor,"String_Node_Str");
}
Program: 62037
Project: 62037
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 UndoFixedEditorPane();
  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");
}
Program: 62038
Project: 62038
Buggy source:
@Override public void setEditMode(boolean val){
  if (val) {
    JOptionPane.showMessageDialog(null,translate("String_Node_Str"),translate("String_Node_Str"),JOptionPane.WARNING_MESSAGE);
  }
  slotConstEditor.setEditable(val);
}

Fixed version (ground truth):
@Override public void setEditMode(boolean val){
  if (val && active) {
    JOptionPane.showMessageDialog(null,translate("String_Node_Str"),translate("String_Node_Str"),JOptionPane.WARNING_MESSAGE);
  }
  slotConstEditor.setEditable(val);
}
Program: 62039
Project: 62039
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  if (expandButton.isSelected()) {
    expandButton.setIcon(View.getIcon("String_Node_Str"));
  }
  scrollPane.setVisible(expandButton.isSelected());
  scrollPane.setMinimumSize(new Dimension(getWidth(),500));
  scrollPane.setSize(new Dimension(getWidth(),500));
  revalidate();
  repaint();
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  expandButton.setIcon(expandButton.isSelected() ? expandIcon : collapseIcon);
  scrollPane.setVisible(expandButton.isSelected());
  revalidate();
  repaint();
}
Program: 62040
Project: 62040
Buggy source:
public ErrorLogFrame(){
  setTitle(translate("String_Node_Str"));
  setSize(700,400);
  setBackground(Color.white);
  View.centerScreen(this);
  View.setWindowIcon(this);
  setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
  Container cnt=getContentPane();
  cnt.setLayout(new BorderLayout());
  logView.setBackground(Color.white);
  logView.setLayout(new BoxLayout(logView,BoxLayout.Y_AXIS));
  cnt.setBackground(Color.white);
  cnt.add(new JScrollPane(logView),BorderLayout.NORTH);
  handler=new Handler(){
    @Override public void publish(    LogRecord record){
      log(record.getLevel(),record.getMessage(),record.getThrown());
    }
    @Override public void flush(){
    }
    @Override public void close() throws SecurityException {
    }
  }
;
}

Fixed version (ground truth):
public ErrorLogFrame(){
  setTitle(translate("String_Node_Str"));
  setSize(700,400);
  setBackground(Color.white);
  View.centerScreen(this);
  View.setWindowIcon(this);
  setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
  Container cnt=getContentPane();
  cnt.setLayout(new BorderLayout());
  logView.setBackground(Color.white);
  logView.setLayout(new BorderLayout());
  cnt.setBackground(Color.white);
  logViewInner.setLayout(new BoxLayout(logViewInner,BoxLayout.Y_AXIS));
  logView.add(logViewInner,BorderLayout.NORTH);
  expandIcon=View.getIcon("String_Node_Str");
  collapseIcon=View.getIcon("String_Node_Str");
  cnt.add(new JScrollPane(logView),BorderLayout.CENTER);
  handler=new Handler(){
    @Override public void publish(    LogRecord record){
      log(record.getLevel(),record.getMessage(),record.getThrown());
    }
    @Override public void flush(){
    }
    @Override public void close() throws SecurityException {
    }
  }
;
}
Program: 62044
Project: 62044
Buggy source:
/** 
 * Sets windows Look and Feel
 */
public static void setLookAndFeel(){
  try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  }
 catch (  UnsupportedLookAndFeelException|ClassNotFoundException|InstantiationException|IllegalAccessException ignored) {
  }
  try {
    SwingUtilities.invokeAndWait(new Runnable(){
      @Override public void run(){
        try {
          UIManager.setLookAndFeel(new SubstanceOfficeBlue2007LookAndFeel());
          UIManager.put(SubstanceLookAndFeel.COLORIZATION_FACTOR,1.0);
          UIManager.put("String_Node_Str",getIcon("String_Node_Str"));
          UIManager.put("String_Node_Str",getIcon("String_Node_Str"));
          UIManager.put("String_Node_Str",MyRibbonApplicationMenuPopupPanelUI.class.getName());
          UIManager.put("String_Node_Str",MyRibbonApplicationMenuButtonUI.class.getName());
        }
 catch (        UnsupportedLookAndFeelException ex) {
          Logger.getLogger(View.class.getName()).log(Level.SEVERE,null,ex);
        }
      }
    }
);
  }
 catch (  InterruptedException|InvocationTargetException ex) {
    Logger.getLogger(View.class.getName()).log(Level.SEVERE,null,ex);
  }
  UIManager.put(SubstanceLookAndFeel.TABBED_PANE_CONTENT_BORDER_KIND,SubstanceConstants.TabContentPaneBorderKind.SINGLE_FULL);
  JFrame.setDefaultLookAndFeelDecorated(true);
  JDialog.setDefaultLookAndFeelDecorated(true);
}

Fixed version (ground truth):
/** 
 * Sets windows Look and Feel
 */
public static void setLookAndFeel(){
  try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  }
 catch (  UnsupportedLookAndFeelException|ClassNotFoundException|InstantiationException|IllegalAccessException ignored) {
  }
  try {
    SwingUtilities.invokeAndWait(new Runnable(){
      @Override public void run(){
        try {
          UIManager.setLookAndFeel(new SubstanceOfficeBlue2007LookAndFeel());
          UIManager.put(SubstanceLookAndFeel.COLORIZATION_FACTOR,1.0);
          UIManager.put("String_Node_Str",getIcon("String_Node_Str"));
          UIManager.put("String_Node_Str",getIcon("String_Node_Str"));
          UIManager.put("String_Node_Str",MyRibbonApplicationMenuPopupPanelUI.class.getName());
          UIManager.put("String_Node_Str",MyRibbonApplicationMenuButtonUI.class.getName());
          UIManager.put("String_Node_Str",MyProgressBarUI.class.getName());
        }
 catch (        UnsupportedLookAndFeelException ex) {
          Logger.getLogger(View.class.getName()).log(Level.SEVERE,null,ex);
        }
      }
    }
);
  }
 catch (  InterruptedException|InvocationTargetException ex) {
    Logger.getLogger(View.class.getName()).log(Level.SEVERE,null,ex);
  }
  UIManager.put(SubstanceLookAndFeel.TABBED_PANE_CONTENT_BORDER_KIND,SubstanceConstants.TabContentPaneBorderKind.SINGLE_FULL);
  JFrame.setDefaultLookAndFeelDecorated(true);
  JDialog.setDefaultLookAndFeelDecorated(true);
}
Program: 62045
Project: 62045
Buggy source:
public HashMap<Integer,List<Integer>> visitCode(MethodBody body){
  HashMap<Integer,List<Integer>> refs=new HashMap<>();
  for (int i=0; i < code.size(); i++) {
    refs.put(i,new ArrayList<Integer>());
  }
  visitCode(0,0,refs);
  int pos=0;
  for (  ABCException e : body.exceptions) {
    pos++;
    try {
      visitCode(adr2pos(e.start),-pos,refs);
      visitCode(adr2pos(e.target),-pos,refs);
      visitCode(adr2pos(e.end),-pos,refs);
    }
 catch (    ConvertException ex) {
      Logger.getLogger(AVM2Code.class.getName()).log(Level.FINE,null,ex);
    }
  }
  return refs;
}

Fixed version (ground truth):
public HashMap<Integer,List<Integer>> visitCode(MethodBody body){
  HashMap<Integer,List<Integer>> refs=new HashMap<>();
  for (int i=0; i < code.size(); i++) {
    refs.put(i,new ArrayList<Integer>());
  }
  visitCode(0,0,refs);
  int pos=0;
  for (  ABCException e : body.exceptions) {
    pos++;
    try {
      visitCode(adr2pos(e.start),adr2pos(e.start) - 1,refs);
      visitCode(adr2pos(e.start),-1,refs);
      visitCode(adr2pos(e.target),adr2pos(e.end),refs);
      visitCode(adr2pos(e.end),-pos,refs);
    }
 catch (    ConvertException ex) {
      Logger.getLogger(AVM2Code.class.getName()).log(Level.FINE,null,ex);
    }
  }
  return refs;
}
Program: 62047
Project: 62047
Buggy source:
private static void offerAssociation(){
  boolean offered=(Boolean)Configuration.getConfig("String_Node_Str",Boolean.FALSE);
  if (!offered) {
    if (Platform.isWindows()) {
      if ((!isAddedToContextMenu()) && JOptionPane.showConfirmDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
        addToContextMenu(true);
      }
    }
  }
  Configuration.setConfig("String_Node_Str",Boolean.TRUE);
}

Fixed version (ground truth):
private static void offerAssociation(){
  boolean offered=(Boolean)Configuration.getConfig("String_Node_Str",Boolean.FALSE);
  if (!offered) {
    if (Platform.isWindows()) {
      if ((!isAddedToContextMenu()) && View.showConfirmDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
        addToContextMenu(true);
      }
    }
  }
  Configuration.setConfig("String_Node_Str",Boolean.TRUE);
}
Program: 62048
Project: 62048
Buggy source:
public static boolean saveFileDialog(){
  JFileChooser fc=new JFileChooser();
  fc.setCurrentDirectory(new File((String)Configuration.getConfig("String_Node_Str","String_Node_Str")));
  fc.setFileFilter(new FileFilter(){
    @Override public boolean accept(    File f){
      return (f.getName().endsWith("String_Node_Str")) || (f.isDirectory());
    }
    @Override public String getDescription(){
      return translate("String_Node_Str");
    }
  }
);
  fc.setAcceptAllFileFilterUsed(false);
  JFrame f=new JFrame();
  View.setWindowIcon(f);
  int returnVal=fc.showSaveDialog(f);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    File file=Helper.fixDialogFile(fc.getSelectedFile());
    try {
      String fileName=file.getAbsolutePath();
      if (!fileName.toLowerCase().endsWith("String_Node_Str")) {
        fileName+="String_Node_Str";
      }
      Main.saveFile(fileName);
      Configuration.setConfig("String_Node_Str",file.getParentFile().getAbsolutePath());
      maskURL=null;
      return true;
    }
 catch (    IOException ex) {
      JOptionPane.showMessageDialog(null,translate("String_Node_Str"));
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean saveFileDialog(){
  JFileChooser fc=new JFileChooser();
  fc.setCurrentDirectory(new File((String)Configuration.getConfig("String_Node_Str","String_Node_Str")));
  fc.setFileFilter(new FileFilter(){
    @Override public boolean accept(    File f){
      return (f.getName().endsWith("String_Node_Str")) || (f.isDirectory());
    }
    @Override public String getDescription(){
      return translate("String_Node_Str");
    }
  }
);
  fc.setAcceptAllFileFilterUsed(false);
  JFrame f=new JFrame();
  View.setWindowIcon(f);
  int returnVal=fc.showSaveDialog(f);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    File file=Helper.fixDialogFile(fc.getSelectedFile());
    try {
      String fileName=file.getAbsolutePath();
      if (!fileName.toLowerCase().endsWith("String_Node_Str")) {
        fileName+="String_Node_Str";
      }
      Main.saveFile(fileName);
      Configuration.setConfig("String_Node_Str",file.getParentFile().getAbsolutePath());
      maskURL=null;
      return true;
    }
 catch (    IOException ex) {
      View.showMessageDialog(null,translate("String_Node_Str"));
    }
  }
  return false;
}
Program: 62050
Project: 62050
Buggy source:
@Override public void publish(LogRecord record){
  if (record.getLevel() == Level.SEVERE) {
    errorNotificationButton.setIcon(View.getIcon("String_Node_Str"));
    errorNotificationButton.setToolTipText(translate("String_Node_Str"));
    if (timer != null) {
      timer.cancel();
    }
    timer=new Timer();
    timer.schedule(new TimerTask(){
      @Override public void run(){
        pos++;
        if ((pos % 2) == 0) {
          errorNotificationButton.setIcon(View.getIcon("String_Node_Str"));
        }
 else {
          errorNotificationButton.setIcon(null);
          errorNotificationButton.setSize(16,16);
        }
        if (pos >= 4) {
          cancel();
        }
      }
    }
,500,500);
  }
}

Fixed version (ground truth):
@Override public void publish(final LogRecord record){
  SwingUtilities.invokeLater(new Runnable(){
    @Override public void run(){
      if (record.getLevel() == Level.SEVERE) {
        errorNotificationButton.setIcon(View.getIcon("String_Node_Str"));
        errorNotificationButton.setToolTipText(translate("String_Node_Str"));
        if (timer != null) {
          timer.cancel();
        }
        timer=new Timer();
        timer.schedule(new TimerTask(){
          @Override public void run(){
            View.execInEventDispatch(new Runnable(){
              @Override public void run(){
                pos++;
                if ((pos % 2) == 0 || (pos >= 4)) {
                  errorNotificationButton.setIcon(View.getIcon("String_Node_Str"));
                }
 else {
                  errorNotificationButton.setIcon(null);
                  errorNotificationButton.setSize(16,16);
                }
              }
            }
);
            if (pos >= 4) {
              cancel();
            }
          }
        }
,500,500);
      }
    }
  }
);
}
Program: 62051
Project: 62051
Buggy source:
public void log(Level level,String msg,Throwable ex){
  StringWriter sw=new StringWriter();
  ex.printStackTrace(new PrintWriter(sw));
  log(level,msg,sw.toString());
}

Fixed version (ground truth):
public void log(Level level,String msg,Throwable ex){
  StringWriter sw=new StringWriter();
  if (ex != null) {
    ex.printStackTrace(new PrintWriter(sw));
  }
  log(level,msg,sw.toString());
}
Program: 62057
Project: 62057
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 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;
}

Fixed version (ground truth):
private static boolean isDirectAncestor(int currentIp,int ancestor,HashMap<Integer,List<Integer>> refs,List<Integer> visited){
  if (currentIp == -1) {
    return true;
  }
  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: 62058
Project: 62058
Buggy source:
@Override public BufferedImage getImage(List<Tag> tags){
  try {
    BufferedImage img=ImageIO.read(new ByteArrayInputStream(imageData));
    BufferedImage img2=new BufferedImage(img.getWidth(),img.getHeight(),BufferedImage.TYPE_INT_ARGB);
    for (int y=0; y < img.getHeight(); y++) {
      for (int x=0; x < img.getWidth(); x++) {
        int val=img.getRGB(x,y);
        int a=bitmapAlphaData[x + y * img.getWidth()] & 0xff;
        val=(val & 0xffffff) | (a << 24);
        img2.setRGB(x,y,val);
      }
    }
    return img2;
  }
 catch (  IOException ex) {
  }
  return null;
}

Fixed version (ground truth):
@Override public BufferedImage getImage(List<Tag> tags){
  try {
    BufferedImage img=ImageIO.read(new ByteArrayInputStream(imageData));
    if (bitmapAlphaData.length == 0) {
      return img;
    }
    BufferedImage img2=new BufferedImage(img.getWidth(),img.getHeight(),BufferedImage.TYPE_INT_ARGB_PRE);
    for (int y=0; y < img.getHeight(); y++) {
      for (int x=0; x < img.getWidth(); x++) {
        int val=img.getRGB(x,y);
        int a=bitmapAlphaData[x + y * img.getWidth()] & 0xff;
        val=(val & 0xffffff) | (a << 24);
        img2.setRGB(x,y,colorToInt(multiplyAlpha(intToColor(val))));
      }
    }
    return img2;
  }
 catch (  IOException ex) {
  }
  return null;
}
Program: 62059
Project: 62059
Buggy source:
/** 
 * Constructor
 * @param data Data bytes
 * @param version SWF version
 * @throws IOException
 */
public DefineBitsJPEG4Tag(SWF swf,byte data[],int version,long pos) throws IOException {
  super(swf,ID,"String_Node_Str",data,pos);
  SWFInputStream sis=new SWFInputStream(new ByteArrayInputStream(data),version);
  characterID=sis.readUI16();
  long alphaDataOffset=sis.readUI32();
  deblockParam=sis.readUI16();
  imageData=sis.readBytes(alphaDataOffset);
  bitmapAlphaData=sis.readBytes(sis.available());
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param swf
 * @param data Data bytes
 * @param version SWF version
 * @param pos
 * @throws IOException
 */
public DefineBitsJPEG4Tag(SWF swf,byte data[],int version,long pos) throws IOException {
  super(swf,ID,"String_Node_Str",data,pos);
  SWFInputStream sis=new SWFInputStream(new ByteArrayInputStream(data),version);
  characterID=sis.readUI16();
  long alphaDataOffset=sis.readUI32();
  deblockParam=sis.readUI16();
  imageData=sis.readBytes(alphaDataOffset);
  bitmapAlphaData=sis.readBytes(sis.available());
}
Program: 62060
Project: 62060
Buggy source:
@Override public BufferedImage getImage(List<Tag> tags){
  try {
    BufferedImage img=ImageIO.read(new ByteArrayInputStream(imageData));
    BufferedImage img2=new BufferedImage(img.getWidth(),img.getHeight(),BufferedImage.TYPE_INT_ARGB);
    for (int y=0; y < img.getHeight(); y++) {
      for (int x=0; x < img.getWidth(); x++) {
        int val=img.getRGB(x,y);
        int a=bitmapAlphaData[x + y * img.getWidth()] & 0xff;
        val=(val & 0xffffff) | (a << 24);
        img2.setRGB(x,y,val);
      }
    }
    return img2;
  }
 catch (  IOException ex) {
  }
  return null;
}

Fixed version (ground truth):
@Override public BufferedImage getImage(List<Tag> tags){
  try {
    BufferedImage img=ImageIO.read(new ByteArrayInputStream(imageData));
    if (bitmapAlphaData.length == 0) {
      return img;
    }
    BufferedImage img2=new BufferedImage(img.getWidth(),img.getHeight(),BufferedImage.TYPE_INT_ARGB);
    for (int y=0; y < img.getHeight(); y++) {
      for (int x=0; x < img.getWidth(); x++) {
        int val=img.getRGB(x,y);
        int a=bitmapAlphaData[x + y * img.getWidth()] & 0xff;
        val=(val & 0xffffff) | (a << 24);
        img2.setRGB(x,y,colorToInt(multiplyAlpha(intToColor(val))));
      }
    }
    return img2;
  }
 catch (  IOException ex) {
  }
  return null;
}