nus-yam/ex-repair huggingface dataset:
Program: 5989
Project: 5989
Buggy source:
@Override protected ProductInfo map2VO(ResultSet rs) throws SQLException {
  ProductInfo product=new ProductInfo();
  product.setId(rs.getString("String_Node_Str"));
  product.setRef(rs.getString("String_Node_Str"));
  product.setCode(rs.getString("String_Node_Str"));
  product.setName(rs.getString("String_Node_Str"));
  product.setPriceBuy(rs.getDouble("String_Node_Str"));
  product.setPriceSell(rs.getDouble("String_Node_Str"));
  product.setCategoryID(rs.getString("String_Node_Str"));
  product.setTaxcat(rs.getString("String_Node_Str"));
  product.setCom(rs.getBoolean("String_Node_Str"));
  product.setScale(rs.getBoolean("String_Node_Str"));
  return product;
}

Fixed version (ground truth):
@Override protected ProductInfo map2VO(ResultSet rs) throws SQLException {
  ProductInfo product=new ProductInfo();
  product.setId(rs.getString("String_Node_Str"));
  product.setRef(rs.getString("String_Node_Str"));
  product.setCode(rs.getString("String_Node_Str"));
  product.setName(rs.getString("String_Node_Str"));
  product.setPriceBuy(rs.getDouble("String_Node_Str"));
  product.setPriceSell(rs.getDouble("String_Node_Str"));
  product.setCategoryId(rs.getString("String_Node_Str"));
  product.setTaxcat(rs.getString("String_Node_Str"));
  product.setCom(rs.getBoolean("String_Node_Str"));
  product.setScale(rs.getBoolean("String_Node_Str"));
  return product;
}
Program: 5990
Project: 5990
Buggy source:
public TicketInfo getTicket(String id){
  Connection con=null;
  PreparedStatement ps=null;
  ResultSet rs=null;
  String sqlStr="String_Node_Str";
  TicketInfo ticket=new TicketInfo();
  try {
    con=getConnection();
    ps=con.prepareStatement(sqlStr);
    ps.setString(1,id);
    rs=ps.executeQuery();
    rs.next();
    ObjectInputStream in=new ObjectInputStream(new BufferedInputStream(rs.getBinaryStream(1)));
    ticket=(TicketInfo)in.readObject();
  }
 catch (  Exception ex) {
    Logger.getLogger(TicketDAO.class.getName()).log(Level.SEVERE,null,ex);
    return null;
  }
  return ticket;
}

Fixed version (ground truth):
public TicketInfo getTicket(String id){
  Connection con=null;
  PreparedStatement ps=null;
  ResultSet rs=null;
  String sqlStr="String_Node_Str";
  TicketInfo ticket=new TicketInfo();
  try {
    con=getConnection();
    ps=con.prepareStatement(sqlStr);
    ps.setString(1,id);
    rs=ps.executeQuery();
    rs.next();
    ObjectInputStream in=new ObjectInputStream(new BufferedInputStream(rs.getBinaryStream(1)));
    ticket=(TicketInfo)in.readObject();
  }
 catch (  Exception ex) {
    return null;
  }
  return ticket;
}
Program: 5991
Project: 5991
Buggy source:
/** 
 * This is the action called from the Struts framework.
 * @param mapping The ActionMapping used to select this instance.
 * @param form The optional ActionForm bean for this request.
 * @param request The HTTP Request we are processing.
 * @param response The HTTP Response we are processing.
 * @throws java.lang.Exception
 * @return
 */
public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception {
  FloorForm aForm=(FloorForm)form;
  RestaurantManager manager=new RestaurantManager();
  TicketInfo ticket=manager.findTicket(aForm.getId());
  List<TicketLineInfo> list=ticket.getM_aLines();
  String[] array=aForm.getParameters();
  list.get(Integer.valueOf(aForm.getLine())).setMultiply(Double.valueOf(array[0]));
  manager.updateLineFromTicket(aForm.getId(),ticket);
  request.setAttribute("String_Node_Str",aForm.getLine());
  request.setAttribute("String_Node_Str",ticket.getName());
  return mapping.findForward(SUCCESS);
}

Fixed version (ground truth):
/** 
 * This is the action called from the Struts framework.
 * @param mapping The ActionMapping used to select this instance.
 * @param form The optional ActionForm bean for this request.
 * @param request The HTTP Request we are processing.
 * @param response The HTTP Response we are processing.
 * @throws java.lang.Exception
 * @return
 */
public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception {
  FloorForm floorForm=(FloorForm)form;
  RestaurantManager manager=new RestaurantManager();
  String floorId=(String)floorForm.getFloorId();
  String place=(String)floorForm.getId();
  String str=(String)floorForm.getMode();
  String[] array=floorForm.getParameters();
  List<TicketLineInfo> linesList=new ArrayList<TicketLineInfo>();
  List products=new ArrayList<ProductInfoExt>();
  TicketInfo ticket=manager.findTicket(place);
  linesList=ticket.getM_aLines();
  if (array != null) {
    for (int i=0; i < array.length; i++) {
      linesList.get(Integer.valueOf(array[i]) - 0).setMultiply(linesList.get(Integer.valueOf(array[i]) - 0).getMultiply() + 1);
    }
  }
  manager.updateLineFromTicket(floorForm.getId(),ticket);
  for (  Object line : linesList) {
    TicketLineInfo li=(TicketLineInfo)line;
    products.add(manager.findProductById(li.getProductid()));
  }
  request.setAttribute("String_Node_Str",manager.findFloorById(manager.findPlaceById(place).getFloor()).getName());
  request.setAttribute("String_Node_Str",place);
  request.setAttribute("String_Node_Str",manager.findPlaceNameById(place));
  request.setAttribute("String_Node_Str",floorId);
  request.setAttribute("String_Node_Str",linesList);
  request.setAttribute("String_Node_Str",products);
  request.setAttribute("String_Node_Str",manager.getTotalOfaTicket(place));
  return mapping.findForward(SUCCESS);
}
Program: 5992
Project: 5992
Buggy source:
public byte[] transImage(BufferedImage image){
  CenteredImage centeredimage=new CenteredImage(image,IMAGE_WIDTH);
  int iWidth=(centeredimage.getWidth() + 7) / 8;
  int iHeight=centeredimage.getHeight();
  byte[] bData=new byte[getImageHeader().length + 4 + iWidth * iHeight];
  System.arraycopy(getImageHeader(),0,bData,0,getImageHeader().length);
  int index=getImageHeader().length;
  bData[index++]=(byte)(iWidth % 256);
  bData[index++]=(byte)(iWidth / 256);
  bData[index++]=(byte)(iHeight % 256);
  bData[index++]=(byte)(iHeight / 256);
  int iRGB;
  int p;
  for (int i=0; i < centeredimage.getHeight(); i++) {
    for (int j=0; j < centeredimage.getWidth(); j=j + 8) {
      p=0x00;
      for (int d=0; d < 8; d++) {
        p=p << 1;
        if (centeredimage.isBlack(j + d,i)) {
          p=p | 0x01;
        }
      }
      bData[index++]=(byte)p;
    }
  }
  return bData;
}

Fixed version (ground truth):
public byte[] transImage(BufferedImage image){
  CenteredImage centeredimage=new CenteredImage(image,getImageWidth());
  int iWidth=(centeredimage.getWidth() + 7) / 8;
  int iHeight=centeredimage.getHeight();
  byte[] bData=new byte[getImageHeader().length + 4 + iWidth * iHeight];
  System.arraycopy(getImageHeader(),0,bData,0,getImageHeader().length);
  int index=getImageHeader().length;
  bData[index++]=(byte)(iWidth % 256);
  bData[index++]=(byte)(iWidth / 256);
  bData[index++]=(byte)(iHeight % 256);
  bData[index++]=(byte)(iHeight / 256);
  int iRGB;
  int p;
  for (int i=0; i < centeredimage.getHeight(); i++) {
    for (int j=0; j < centeredimage.getWidth(); j=j + 8) {
      p=0x00;
      for (int d=0; d < 8; d++) {
        p=p << 1;
        if (centeredimage.isBlack(j + d,i)) {
          p=p | 0x01;
        }
      }
      bData[index++]=(byte)p;
    }
  }
  return bData;
}
Program: 5993
Project: 5993
Buggy source:
@Override public byte[] transImage(BufferedImage image){
  CenteredImage centeredimage=new CenteredImage(image,IMAGE_WIDTH);
  int iWidth=centeredimage.getWidth();
  int iHeight=(centeredimage.getHeight() + 7) / 8;
  byte[] bData=new byte[IMAGE_BEGIN.length + (getImageHeader().length + 2 + iWidth+ getNewLine().length) * iHeight + IMAGE_END.length];
  int index=0;
  System.arraycopy(IMAGE_BEGIN,0,bData,index,IMAGE_BEGIN.length);
  index+=IMAGE_BEGIN.length;
  int p;
  for (int i=0; i < centeredimage.getHeight(); i+=8) {
    System.arraycopy(getImageHeader(),0,bData,index,getImageHeader().length);
    index+=getImageHeader().length;
    bData[index++]=(byte)(iWidth % 256);
    bData[index++]=(byte)(iWidth / 256);
    for (int j=0; j < centeredimage.getWidth(); j++) {
      p=0x00;
      for (int d=0; d < 8; d++) {
        p=p << 1;
        if (centeredimage.isBlack(j,i + d)) {
          p=p | 0x01;
        }
      }
      bData[index++]=(byte)p;
    }
    System.arraycopy(getNewLine(),0,bData,index,getNewLine().length);
    index+=getNewLine().length;
  }
  System.arraycopy(IMAGE_END,0,bData,index,IMAGE_END.length);
  index+=IMAGE_END.length;
  return bData;
}

Fixed version (ground truth):
@Override public byte[] transImage(BufferedImage image){
  CenteredImage centeredimage=new CenteredImage(image,getImageWidth());
  int iWidth=centeredimage.getWidth();
  int iHeight=(centeredimage.getHeight() + 7) / 8;
  byte[] bData=new byte[IMAGE_BEGIN.length + (getImageHeader().length + 2 + iWidth+ getNewLine().length) * iHeight + IMAGE_END.length];
  int index=0;
  System.arraycopy(IMAGE_BEGIN,0,bData,index,IMAGE_BEGIN.length);
  index+=IMAGE_BEGIN.length;
  int p;
  for (int i=0; i < centeredimage.getHeight(); i+=8) {
    System.arraycopy(getImageHeader(),0,bData,index,getImageHeader().length);
    index+=getImageHeader().length;
    bData[index++]=(byte)(iWidth % 256);
    bData[index++]=(byte)(iWidth / 256);
    for (int j=0; j < centeredimage.getWidth(); j++) {
      p=0x00;
      for (int d=0; d < 8; d++) {
        p=p << 1;
        if (centeredimage.isBlack(j,i + d)) {
          p=p | 0x01;
        }
      }
      bData[index++]=(byte)p;
    }
    System.arraycopy(getNewLine(),0,bData,index,getNewLine().length);
    index+=getNewLine().length;
  }
  System.arraycopy(IMAGE_END,0,bData,index,IMAGE_END.length);
  index+=IMAGE_END.length;
  return bData;
}
Program: 5994
Project: 5994
Buggy source:
protected void internalWrite(byte[] data){
  try {
    if (m_out == null) {
      m_PortIdPrinter=CommPortIdentifier.getPortIdentifier(m_sPortPrinter);
      m_CommPortPrinter=m_PortIdPrinter.open("String_Node_Str",2000);
      m_out=m_CommPortPrinter.getOutputStream();
      if (m_PortIdPrinter.getPortType() == CommPortIdentifier.PORT_SERIAL) {
        ((SerialPort)m_CommPortPrinter).setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
      }
 else       if (m_PortIdPrinter.getPortType() == CommPortIdentifier.PORT_PARALLEL) {
        ((ParallelPort)m_CommPortPrinter).setMode(1);
      }
    }
    m_out.write(data);
  }
 catch (  NoSuchPortException e) {
    System.err.println(e);
  }
catch (  PortInUseException e) {
    System.err.println(e);
  }
catch (  UnsupportedCommOperationException e) {
    System.err.println(e);
  }
catch (  IOException e) {
    System.err.println(e);
  }
}

Fixed version (ground truth):
protected void internalWrite(byte[] data){
  try {
    if (m_out == null) {
      m_PortIdPrinter=CommPortIdentifier.getPortIdentifier(m_sPortPrinter);
      m_CommPortPrinter=m_PortIdPrinter.open("String_Node_Str",2000);
      m_out=m_CommPortPrinter.getOutputStream();
      if (m_PortIdPrinter.getPortType() == CommPortIdentifier.PORT_SERIAL) {
        ((SerialPort)m_CommPortPrinter).setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
      }
    }
    m_out.write(data);
  }
 catch (  NoSuchPortException e) {
    System.err.println(e);
  }
catch (  PortInUseException e) {
    System.err.println(e);
  }
catch (  UnsupportedCommOperationException e) {
    System.err.println(e);
  }
catch (  IOException e) {
    System.err.println(e);
  }
}
Program: 5996
Project: 5996
Buggy source:
public TicketLineInfo copyTicketLine(){
  TicketLineInfo l=new TicketLineInfo();
  l.productid=productid;
  l.multiply=multiply;
  l.price=price;
  l.tax=tax;
  l.attributes=(Properties)attributes.clone();
  return l;
}

Fixed version (ground truth):
public TicketLineInfo copyTicketLine(){
  TicketLineInfo l=new TicketLineInfo();
  l.productid=productid;
  l.attsetinstid=attsetinstid;
  l.multiply=multiply;
  l.price=price;
  l.tax=tax;
  l.attributes=(Properties)attributes.clone();
  return l;
}
Program: 5997
Project: 5997
Buggy source:
private void init(String productid,double dMultiply,double dPrice,TaxInfo tax,Properties attributes){
  this.productid=productid;
  attsetinstid=null;
  multiply=dMultiply;
  price=dPrice;
  this.tax=tax;
  this.attributes=attributes;
  m_sTicket=null;
  m_iLine=-1;
}

Fixed version (ground truth):
private void init(String productid,String attsetinstid,double dMultiply,double dPrice,TaxInfo tax,Properties attributes){
  this.productid=productid;
  this.attsetinstid=attsetinstid;
  multiply=dMultiply;
  price=dPrice;
  this.tax=tax;
  this.attributes=attributes;
  m_sTicket=null;
  m_iLine=-1;
}
Program: 5998
Project: 5998
Buggy source:
public TicketLineInfo(TicketLineInfo line){
  init(line.productid,line.multiply,line.price,line.tax,(Properties)line.attributes.clone());
}

Fixed version (ground truth):
public TicketLineInfo(TicketLineInfo line){
  init(line.productid,line.attsetinstid,line.multiply,line.price,line.tax,(Properties)line.attributes.clone());
}
Program: 6001
Project: 6001
Buggy source:
private void restoreProperties(){
  AppConfig config=new AppConfig(configfile);
  if (config.delete()) {
    loadProperties();
  }
 else {
    JMessageDialog.showMessage(this,new MessageInf(MessageInf.SGN_WARNING,AppLocal.getIntString("String_Node_Str")));
  }
}

Fixed version (ground truth):
private void restoreProperties(){
  if (config.delete()) {
    loadProperties();
  }
 else {
    JMessageDialog.showMessage(this,new MessageInf(MessageInf.SGN_WARNING,AppLocal.getIntString("String_Node_Str")));
  }
}
Program: 6002
Project: 6002
Buggy source:
public JPanelConfiguration(AppProperties props){
  configfile=props.getConfigFile();
  initComponents();
  m_panelconfig=new ArrayList<PanelConfig>();
  m_panelconfig.add(new JPanelConfigDatabase());
  m_panelconfig.add(new JPanelConfigGeneral());
  m_panelconfig.add(new JPanelConfigLocale());
  m_panelconfig.add(new JPanelConfigPayment());
  for (  PanelConfig c : m_panelconfig) {
    m_jConfigOptions.add(c.getConfigComponent());
  }
}

Fixed version (ground truth):
public JPanelConfiguration(AppProperties props){
  config=new AppConfig(props.getConfigFile());
  initComponents();
  m_panelconfig=new ArrayList<PanelConfig>();
  m_panelconfig.add(new JPanelConfigDatabase());
  m_panelconfig.add(new JPanelConfigGeneral());
  m_panelconfig.add(new JPanelConfigLocale());
  m_panelconfig.add(new JPanelConfigPayment());
  for (  PanelConfig c : m_panelconfig) {
    m_jConfigOptions.add(c.getConfigComponent());
  }
}
Program: 6003
Project: 6003
Buggy source:
private void saveProperties(){
  AppConfig config=new AppConfig(configfile);
  for (  PanelConfig c : m_panelconfig) {
    c.saveProperties(config);
  }
  try {
    config.save();
    JOptionPane.showMessageDialog(this,AppLocal.getIntString("String_Node_Str"),AppLocal.getIntString("String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
  }
 catch (  IOException e) {
    JMessageDialog.showMessage(this,new MessageInf(MessageInf.SGN_WARNING,AppLocal.getIntString("String_Node_Str"),e));
  }
}

Fixed version (ground truth):
private void saveProperties(){
  for (  PanelConfig c : m_panelconfig) {
    c.saveProperties(config);
  }
  try {
    config.save();
    JOptionPane.showMessageDialog(this,AppLocal.getIntString("String_Node_Str"),AppLocal.getIntString("String_Node_Str"),JOptionPane.INFORMATION_MESSAGE);
  }
 catch (  IOException e) {
    JMessageDialog.showMessage(this,new MessageInf(MessageInf.SGN_WARNING,AppLocal.getIntString("String_Node_Str"),e));
  }
}
Program: 6004
Project: 6004
Buggy source:
private void loadProperties(){
  AppConfig config=new AppConfig(configfile);
  config.load();
  for (  PanelConfig c : m_panelconfig) {
    c.loadProperties(config);
  }
}

Fixed version (ground truth):
private void loadProperties(){
  config.load();
  for (  PanelConfig c : m_panelconfig) {
    c.loadProperties(config);
  }
}
Program: 6006
Project: 6006
Buggy source:
/** 
 * Creates new form JPaymentSelect 
 */
protected JPaymentSelect(java.awt.Dialog parent,boolean modal,ComponentOrientation o){
  super(parent,modal);
  initComponents();
  this.applyComponentOrientation(o);
  getRootPane().setDefaultButton(m_jButtonOK);
}

Fixed version (ground truth):
/** 
 * Creates new form JPaymentSelect 
 */
protected JPaymentSelect(java.awt.Dialog parent,boolean modal,ComponentOrientation o){
  super(parent,modal);
  initComponents();
  this.applyComponentOrientation(o);
}
Program: 6007
Project: 6007
Buggy source:
public boolean showDialog(double total,CustomerInfoExt customerext){
  m_aPaymentInfo=new PaymentInfoList();
  accepted=false;
  m_dTotal=total;
  this.customerext=customerext;
  m_jButtonPrint.setSelected(printselected);
  m_jTotalEuros.setText(Formats.CURRENCY.formatValue(new Double(m_dTotal)));
  addTabs();
  if (m_jTabPayment.getTabCount() == 0) {
    m_aPaymentInfo.add(getDefaultPayment(total));
    accepted=true;
  }
 else {
    printState();
    setVisible(true);
  }
  printselected=m_jButtonPrint.isSelected();
  m_jTabPayment.removeAll();
  return accepted;
}

Fixed version (ground truth):
public boolean showDialog(double total,CustomerInfoExt customerext){
  m_aPaymentInfo=new PaymentInfoList();
  accepted=false;
  m_dTotal=total;
  this.customerext=customerext;
  m_jButtonPrint.setSelected(printselected);
  m_jTotalEuros.setText(Formats.CURRENCY.formatValue(new Double(m_dTotal)));
  addTabs();
  if (m_jTabPayment.getTabCount() == 0) {
    m_aPaymentInfo.add(getDefaultPayment(total));
    accepted=true;
  }
 else {
    getRootPane().setDefaultButton(m_jButtonOK);
    printState();
    setVisible(true);
  }
  printselected=m_jButtonPrint.isSelected();
  m_jTabPayment.removeAll();
  return accepted;
}
Program: 6008
Project: 6008
Buggy source:
public List<ProductInfoExt> getProductCatalog(String category) throws BasicException {
  return new PreparedSentence(s,"String_Node_Str" + "String_Node_Str" + "String_Node_Str" + s.DB.FALSE() + "String_Node_Str"+ "String_Node_Str",SerializerWriteString.INSTANCE,ProductInfoExt.getSerializerRead()).list(category);
}

Fixed version (ground truth):
public List<ProductInfoExt> getProductCatalog(String category) throws BasicException {
  return new PreparedSentence(s,"String_Node_Str" + "String_Node_Str" + "String_Node_Str",SerializerWriteString.INSTANCE,ProductInfoExt.getSerializerRead()).list(category);
}
Program: 6009
Project: 6009
Buggy source:
/** 
 * Creates new form JPanelConfigPayment 
 */
public JPanelConfigPayment(){
  initComponents();
  jcboCardReader.addActionListener(dirty);
  jcboPaymentGateway.addActionListener(dirty);
  jchkPaymentTest.addActionListener(dirty);
  initPayments("String_Node_Str",new ConfigPaymentPanelEmpty());
  initPayments("String_Node_Str",new ConfigPaymentPanelEmpty());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Creates new form JPanelConfigPayment 
 */
public JPanelConfigPayment(){
  initComponents();
  jcboCardReader.addActionListener(dirty);
  jcboPaymentGateway.addActionListener(dirty);
  jchkPaymentTest.addActionListener(dirty);
  initPayments("String_Node_Str",new ConfigPaymentPanelEmpty());
  initPayments("String_Node_Str",new ConfigPaymentPanelEmpty());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  initPayments("String_Node_Str",new ConfigPaymentPanelLinkPoint());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  initPayments("String_Node_Str",new ConfigPaymentPanelCaixa());
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
}
Program: 6012
Project: 6012
Buggy source:
private void defaultValues(){
  jListTickets.setModel(new MyListData(new ArrayList()));
  jcboUser.setSelectedItem(null);
  jtxtTicketID.reset();
  jtxtTicketID.activate();
  jCheckBoxSales.setSelected(false);
  jCheckBoxRefunds.setSelected(false);
  jcboUser.setSelectedItem(null);
  jcboMoney.setSelectedItem(((ListQBFModelNumber)jcboMoney.getModel()).getElementAt(0));
  jcboMoney.revalidate();
  jcboMoney.repaint();
  jtxtMoney.reset();
}

Fixed version (ground truth):
private void defaultValues(){
  jListTickets.setModel(new MyListData(new ArrayList()));
  jcboUser.setSelectedItem(null);
  jtxtTicketID.reset();
  jtxtTicketID.activate();
  jCheckBoxSales.setSelected(false);
  jCheckBoxRefunds.setSelected(false);
  jcboUser.setSelectedItem(null);
  jcboMoney.setSelectedItem(((ListQBFModelNumber)jcboMoney.getModel()).getElementAt(0));
  jcboMoney.revalidate();
  jcboMoney.repaint();
  jtxtMoney.reset();
  jParamsDatesInterval1.setStartDate(null);
  jParamsDatesInterval1.setEndDate(null);
}
Program: 6013
Project: 6013
Buggy source:
public void add(double dValue){
  subtotal+=dValue;
  taxtotal=RoundUtils.round(subtotal * tax.getRate());
}

Fixed version (ground truth):
public void add(double dValue){
  subtotal+=dValue;
  taxtotal=subtotal * tax.getRate();
}
Program: 6014
Project: 6014
Buggy source:
public void updateCurDebt(Double ammount,Date d){
  curdebt=RoundUtils.round(RoundUtils.getValue(curdebt) + ammount);
  if (RoundUtils.compare(curdebt,0.0) > 0) {
    if (curdate == null) {
      curdate=d;
    }
  }
 else   if (RoundUtils.compare(curdebt,0.0) == 0) {
    curdebt=null;
    curdate=null;
  }
 else {
    curdate=null;
  }
}

Fixed version (ground truth):
public void updateCurDebt(Double ammount,Date d){
  curdebt=curdebt + ammount;
  if (RoundUtils.compare(curdebt,0.0) > 0) {
    if (curdate == null) {
      curdate=d;
    }
  }
 else   if (RoundUtils.compare(curdebt,0.0) == 0) {
    curdebt=null;
    curdate=null;
  }
 else {
    curdate=null;
  }
}
Program: 6015
Project: 6015
Buggy source:
public void actionPerformed(ActionEvent e){
  Double tendered=m_jTendered.getDoubleValue();
  if (tendered == null) {
    m_jTendered.setDoubleValue(RoundUtils.round(amount));
  }
 else {
    m_jTendered.setDoubleValue(RoundUtils.round(tendered + amount));
  }
  printState();
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  Double tendered=m_jTendered.getDoubleValue();
  if (tendered == null) {
    m_jTendered.setDoubleValue(amount);
  }
 else {
    m_jTendered.setDoubleValue(tendered + amount);
  }
  printState();
}
Program: 6016
Project: 6016
Buggy source:
public double getTax(){
  double sum=0.0;
  if (hasTaxesCalculated()) {
    for (    TicketTaxInfo tax : taxes) {
      sum+=tax.getTax();
    }
  }
 else {
    for (    TicketLineInfo line : m_aLines) {
      sum+=RoundUtils.round(line.getTax());
    }
  }
  return sum;
}

Fixed version (ground truth):
public double getTax(){
  double sum=0.0;
  if (hasTaxesCalculated()) {
    for (    TicketTaxInfo tax : taxes) {
      sum+=tax.getTax();
    }
  }
 else {
    for (    TicketLineInfo line : m_aLines) {
      sum+=line.getTax();
    }
  }
  return sum;
}
Program: 6017
Project: 6017
Buggy source:
public void add(double dValue){
  subtotal+=dValue;
  taxtotal=RoundUtils.round(subtotal * tax.getRate());
}

Fixed version (ground truth):
public void add(double dValue){
  subtotal+=dValue;
  taxtotal=subtotal * tax.getRate();
}
Program: 6019
Project: 6019
Buggy source:
public String getTrack2(){
  return track1;
}

Fixed version (ground truth):
public String getTrack2(boolean framingChar){
  return (framingChar) ? track2 : track2.substring(1,track2.length() - 2);
}
Program: 6020
Project: 6020
Buggy source:
public String getTrack1(){
  return track1;
}

Fixed version (ground truth):
/** 
 * Get tracks of magnetic card. Framing characters:  - start sentinel (SS) - end sentinel (ES)  - LRC 
 * @param framingChar true: including framing characters false: exluding framing characters
 * @return tracks of the magnetic card
 */
public String getTrack1(boolean framingChar){
  return (framingChar) ? track1 : track1.substring(1,track1.length() - 2);
}
Program: 6021
Project: 6021
Buggy source:
public String getTrack3(){
  return track1;
}

Fixed version (ground truth):
public String getTrack3(boolean framingChar){
  return (framingChar) ? track3 : track3.substring(1,track3.length() - 2);
}
Program: 6022
Project: 6022
Buggy source:
public byte transChar(char sChar){
  if ((sChar >= 0x0000) && (sChar < 0x0080)) {
    return (byte)sChar;
  }
 else {
switch (sChar) {
case '\u00c1':
      return 0x41;
case '\u00c9':
    return 0x45;
case '\u00cd':
  return 0x49;
case '\u00d3':
return 0x4F;
case '\u00da':
return 0x55;
case '\u00FC':
return -0x7F;
case '\u00E9':
return -0x7E;
case '\u00DC':
return -0x66;
case '\u00A3':
return -0x64;
case '\u00A5':
return -0x63;
case '\u00E1':
return -0x60;
case '\u00ED':
return -0x5F;
case '\u00F3':
return -0x5E;
case '\u00FA':
return -0x5D;
case '\u00F1':
return -0x5C;
case '\u00D1':
return -0x5B;
case '\u00BF':
return -0x58;
case '\u00A1':
return -0x53;
case '\u20AC':
return -0x12;
default :
return 0x3F;
}
}
}

Fixed version (ground truth):
public byte transChar(char sChar){
  if ((sChar >= 0x0000) && (sChar < 0x0080)) {
    return (byte)sChar;
  }
 else {
switch (sChar) {
case '\u00c1':
      return 0x41;
case '\u00c9':
    return 0x45;
case '\u00cd':
  return 0x49;
case '\u00d3':
return 0x4F;
case '\u00da':
return 0x55;
case '\u00C7':
return -0x80;
case '\u00FC':
return -0x7F;
case '\u00E9':
return -0x7E;
case '\u00E4':
return -0x7C;
case '\u00E5':
return -0x7A;
case '\u00E7':
return -0x79;
case '\u00C4':
return -0x72;
case '\u00C5':
return -0x71;
case '\u00F6':
return -0x6C;
case '\u00D6':
return -0x67;
case '\u00DC':
return -0x66;
case '\u00A3':
return -0x64;
case '\u00A5':
return -0x63;
case '\u00E1':
return -0x60;
case '\u00ED':
return -0x5F;
case '\u00F3':
return -0x5E;
case '\u00FA':
return -0x5D;
case '\u00F1':
return -0x5C;
case '\u00D1':
return -0x5B;
case '\u00BF':
return -0x58;
case '\u00A1':
return -0x53;
case '\u20AC':
return -0x12;
default :
return 0x3F;
}
}
}
Program: 6023
Project: 6023
Buggy source:
public void execute(PaymentInfoMagcard payinfo){
}

Fixed version (ground truth):
public void execute(PaymentInfoMagcard payinfo){
  payinfo.paymentOK("String_Node_Str",payinfo.getTransactionID(),"String_Node_Str");
}
Program: 6025
Project: 6025
Buggy source:
private Object executeEvent(TicketInfo ticket,Object ticketext,String eventkey,ScriptArg... args){
  String resource=dlSystem.getResourceAsXML(m_jbtnconfig.getEvent(eventkey));
  if (resource == null) {
    return null;
  }
 else {
    ScriptObject scr=new ScriptObject(ticket,ticketext);
    return evalScript(scr,resource,args);
  }
}

Fixed version (ground truth):
private Object executeEvent(TicketInfo ticket,Object ticketext,String eventkey,ScriptArg... args){
  String resource=m_jbtnconfig.getEvent(eventkey);
  if (resource == null) {
    return null;
  }
 else {
    ScriptObject scr=new ScriptObject(ticket,ticketext);
    return evalScript(scr,resource,args);
  }
}
Program: 6026
Project: 6026
Buggy source:
private void reload() throws BasicException {
  String attsetid=(String)filter.createValue();
  bd.setEditable(attsetid != null);
  bd.actionLoad();
  editor.setInsertId(attsetid);
}

Fixed version (ground truth):
private void reload() throws BasicException {
  String attsetid=(String)filter.createValue();
  editor.setInsertId(attsetid);
  bd.setEditable(attsetid != null);
  bd.actionLoad();
}
Program: 6027
Project: 6027
Buggy source:
private void reload() throws BasicException {
  String attid=(String)filter.createValue();
  bd.setEditable(attid != null);
  bd.actionLoad();
  editor.setInsertId(attid);
}

Fixed version (ground truth):
private void reload() throws BasicException {
  String attid=(String)filter.createValue();
  editor.setInsertId(attid);
  bd.setEditable(attid != null);
  bd.actionLoad();
}
Program: 6029
Project: 6029
Buggy source:
/** 
 * Method that changes points for milimeters. 
 * @param height - height in points
 */
private int changePointsforMM(int height){
  return (int)(height * point * 1000);
}

Fixed version (ground truth):
/** 
 * Method that changes points for milimeters. 
 * @param height - height in points
 */
@Deprecated private int changePointsforMM(int height){
  return (int)(height * point * 1000);
}
Program: 6030
Project: 6030
Buggy source:
@Override public void endReceipt(){
  try {
    PrinterJob printJob=PrinterJob.getPrinterJob();
    printJob.setPrintable(new PrintableTicket(m_ticketcurrent));
    PrintRequestAttributeSet aset=new HashPrintRequestAttributeSet();
    aset.add(OrientationRequested.PORTRAIT);
    aset.add(new Copies(1));
    aset.add(new JobName(AppLocal.APP_NAME + "String_Node_Str",null));
    if (isReceiptPrinter.equals("String_Node_Str")) {
      MediaSize myISO=new MediaSize(78,getHeightForReceiptPrinters() + 10,Size2DSyntax.MM,MediaSizeName.NA_LEGAL);
      aset.add(MediaSizeName.NA_LEGAL);
    }
 else {
      aset.add(MediaSizeName.ISO_A4);
    }
    if (printservice == null) {
      if (printJob.printDialog(aset)) {
        printJob.print();
      }
    }
 else {
      printJob.setPrintService(printservice);
      printJob.print(aset);
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
  m_ticketcurrent=null;
}

Fixed version (ground truth):
@Override public void endReceipt(){
  try {
    PrinterJob printJob=PrinterJob.getPrinterJob();
    printJob.setPrintable(new PrintableTicket(m_ticketcurrent));
    PrintRequestAttributeSet aset=new HashPrintRequestAttributeSet();
    aset.add(OrientationRequested.PORTRAIT);
    aset.add(new Copies(1));
    aset.add(new JobName(AppLocal.APP_NAME + "String_Node_Str",null));
    if (isReceiptPrinter.equals("String_Node_Str")) {
      MediaSize myISO=new MediaSize(widthOfPaper,heightOfPaper,Size2DSyntax.MM,MediaSizeName.NA_LEGAL);
      aset.add(MediaSizeName.NA_LEGAL);
    }
 else {
      aset.add(MediaSizeName.ISO_A4);
    }
    if (printservice == null) {
      if (printJob.printDialog(aset)) {
        printJob.print();
      }
    }
 else {
      printJob.setPrintService(printservice);
      printJob.print(aset);
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
  m_ticketcurrent=null;
}
Program: 6031
Project: 6031
Buggy source:
/** 
 * Getter that gives back lenght of a ticket
 * @return lenght of a ticket in mm
 */
private int getHeightForReceiptPrinters(){
  int height=0;
  int line=0;
  while (m_ticketcurrent.getTheLastIndex() > line) {
    height+=m_ticketcurrent.getHeightOfCommands(line);
    line++;
  }
  return changePointsforMM(height);
}

Fixed version (ground truth):
/** 
 * Getter that gives back lenght of a ticket
 * @return lenght of a ticket in mm
 */
@Deprecated private int getHeightForReceiptPrinters(){
  int height=0;
  int line=0;
  while (m_ticketcurrent.getTheLastIndex() > line) {
    height+=m_ticketcurrent.getHeightOfCommands(line);
    line++;
  }
  System.out.println(height + "String_Node_Str" + changePointsforMM(height));
  return changePointsforMM(height);
}
Program: 6032
Project: 6032
Buggy source:
/** 
 * Creates a new instance of PrinterItemLine 
 */
public PrintItemLineForPrinter(int itextsize){
  super(itextsize);
  BASEFONT=new Font("String_Node_Str",Font.PLAIN,8);
  FONTHEIGHT=12;
  FONTWIDTH=5;
}

Fixed version (ground truth):
/** 
 * Creates a new instance of PrinterItemLine 
 */
public PrintItemLineForPrinter(int itextsize){
  super(itextsize);
  BASEFONT=new Font("String_Node_Str",Font.PLAIN,8);
  FONTHEIGHT=12;
  FONTWIDTH=4;
}
Program: 6036
Project: 6036
Buggy source:
public void initFrame(AppProperties props){
  m_props=props;
  m_rootapp=new JRootApp();
  if (m_rootapp.initApp(m_props)) {
    try {
      m_instmanager=new InstanceManager(this);
    }
 catch (    Exception e) {
    }
    add(m_rootapp,BorderLayout.CENTER);
    try {
      this.setIconImage(ImageIO.read(JRootFrame.class.getResourceAsStream("String_Node_Str")));
    }
 catch (    IOException e) {
    }
    setTitle(AppLocal.APP_NAME + "String_Node_Str" + AppLocal.APP_VERSION);
    pack();
    setLocationRelativeTo(null);
    setVisible(true);
  }
 else {
    new JFrmConfig(props).setVisible(true);
  }
}

Fixed version (ground truth):
public void initFrame(AppProperties props){
  m_props=props;
  m_rootapp=new JRootApp();
  if (m_rootapp.initApp(m_props)) {
    if ("String_Node_Str".equals(props.getProperty("String_Node_Str"))) {
      try {
        m_instmanager=new InstanceManager(this);
      }
 catch (      Exception e) {
      }
    }
    add(m_rootapp,BorderLayout.CENTER);
    try {
      this.setIconImage(ImageIO.read(JRootFrame.class.getResourceAsStream("String_Node_Str")));
    }
 catch (    IOException e) {
    }
    setTitle(AppLocal.APP_NAME + "String_Node_Str" + AppLocal.APP_VERSION);
    pack();
    setLocationRelativeTo(null);
    setVisible(true);
  }
 else {
    new JFrmConfig(props).setVisible(true);
  }
}
Program: 6037
Project: 6037
Buggy source:
public void initFrame(AppProperties props){
  m_props=props;
  m_rootapp=new JRootApp();
  if (m_rootapp.initApp(m_props)) {
    try {
      m_instmanager=new InstanceManager(this);
    }
 catch (    Exception e) {
    }
    add(m_rootapp,BorderLayout.CENTER);
    setTitle(AppLocal.APP_NAME + "String_Node_Str" + AppLocal.APP_VERSION);
    Dimension d=Toolkit.getDefaultToolkit().getScreenSize();
    setBounds(0,0,d.width,d.height);
    setVisible(true);
  }
 else {
    new JFrmConfig(props).setVisible(true);
  }
}

Fixed version (ground truth):
public void initFrame(AppProperties props){
  m_props=props;
  m_rootapp=new JRootApp();
  if (m_rootapp.initApp(m_props)) {
    if ("String_Node_Str".equals(props.getProperty("String_Node_Str"))) {
      try {
        m_instmanager=new InstanceManager(this);
      }
 catch (      Exception e) {
      }
    }
    add(m_rootapp,BorderLayout.CENTER);
    setTitle(AppLocal.APP_NAME + "String_Node_Str" + AppLocal.APP_VERSION);
    Dimension d=Toolkit.getDefaultToolkit().getScreenSize();
    setBounds(0,0,d.width,d.height);
    setVisible(true);
  }
 else {
    new JFrmConfig(props).setVisible(true);
  }
}
Program: 6038
Project: 6038
Buggy source:
@Override public void endReceipt(){
  try {
    PrinterJob printJob=PrinterJob.getPrinterJob();
    printJob.setPrintable(new PrintableTicket(m_ticketcurrent));
    PrintRequestAttributeSet aset=new HashPrintRequestAttributeSet();
    aset.add(OrientationRequested.PORTRAIT);
    aset.add(new Copies(1));
    aset.add(new JobName(AppLocal.APP_NAME + "String_Node_Str",null));
    if (isReceiptPrinter.equals("String_Node_Str")) {
      MediaSize myISO=new MediaSize(widthOfPaper,heightOfPaper,Size2DSyntax.MM,MediaSizeName.NA_LEGAL);
      aset.add(MediaSizeName.NA_LEGAL);
    }
 else {
      aset.add(MediaSizeName.ISO_A4);
    }
    if (printservice == null) {
      if (printJob.printDialog(aset)) {
        printJob.print();
      }
    }
 else {
      printJob.setPrintService(printservice);
      printJob.print(aset);
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
  m_ticketcurrent=null;
}

Fixed version (ground truth):
@Override public void endReceipt(){
  try {
    PrinterJob printJob=PrinterJob.getPrinterJob();
    printJob.setJobName(AppLocal.APP_NAME + "String_Node_Str");
    printerBook.countLinesOnPage(m_ticketcurrent);
    printJob.setPageable(printerBook.getBook());
    if (printservice == null) {
      if (printJob.printDialog()) {
        printJob.print();
      }
    }
 else {
      printJob.setPrintService(printservice);
      printJob.print();
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
  m_ticketcurrent=null;
}
Program: 6039
Project: 6039
Buggy source:
/** 
 * Creates a new instance of DevicePrinterPrinter
 * @param printername - name of printer that will be called in the system
 * @param isReceiptPrinter - string with boolean values if the printer is a receipt
 */
public DevicePrinterPrinter(String printername,String isReceiptPrinter){
  this.isReceiptPrinter=isReceiptPrinter;
  m_sName="String_Node_Str";
  m_ticketcurrent=null;
  printservice=ReportUtils.getPrintService(printername);
}

Fixed version (ground truth):
/** 
 * Creates a new instance of DevicePrinterPrinter
 * @param printername - name of printer that will be called in the system
 * @param isReceiptPrinter - string with boolean values if the printer is a receipt
 */
public DevicePrinterPrinter(String printername,String isReceiptPrinter){
  m_sName="String_Node_Str";
  m_ticketcurrent=null;
  printservice=ReportUtils.getPrintService(printername);
  printerBook=new PrinterBook(isReceiptPrinter);
}
Program: 6040
Project: 6040
Buggy source:
@Override public void beginLine(int iTextSize){
  m_ticketcurrent.beginLine(0);
}

Fixed version (ground truth):
@Override public void beginLine(int iTextSize){
  m_ticketcurrent.beginLine(iTextSize);
}
Program: 6041
Project: 6041
Buggy source:
/** 
 * Method print prints the ticket and is being called for each site twice. For futher info look into: 
 * @see java.awt.print.Printable;
 */
@Override public int print(Graphics g,PageFormat pf,int pi) throws PrinterException {
  int temp=0;
  while (basict.getTheLastIndex() > line) {
    int height=0;
    while ((int)pf.getImageableHeight() > height + basict.getHeightOfCommands(temp)) {
      if (basict.getTheLastIndex() == line) {
        flag=true;
        break;
      }
      height+=basict.getHeightOfCommands(line);
      temp=basict.getTheLastIndex() != ++line ? line : line - 1;
    }
    if (flag) {
      endLine.add(page,line - 1);
    }
 else {
      endLine.add(page,line);
      startLine.add(++page,endLine.get(--page));
      page++;
    }
  }
  if (pi > page) {
    return Printable.NO_SUCH_PAGE;
  }
  basict.draw((Graphics2D)g,(int)pf.getImageableX(),(int)pf.getImageableY(),LINEWIDTH,(Integer)startLine.get(pi),(Integer)endLine.get(pi));
  return Printable.PAGE_EXISTS;
}

Fixed version (ground truth):
/** 
 * Method print prints the ticket and is being called for each site twice. For futher info look into: 
 * @param g
 * @param pf
 * @param pi
 * @see java.awt.print.Printable
 */
@Override public int print(Graphics g,PageFormat pf,int pi) throws PrinterException {
  Graphics2D g2=(Graphics2D)g;
  basict.draw(g2,(int)pf.getImageableX(),(int)pf.getImageableY(),LINEWIDTH,start,end);
  return Printable.PAGE_EXISTS;
}
Program: 6042
Project: 6042
Buggy source:
/** 
 * Creates a new instance of PrintableTicket
 * @param t - BasicTicketForPrinter
 */
public PrintableTicket(BasicTicketForPrinter t){
  basict=t;
  startLine=new ArrayList();
  startLine.add(0,0);
  endLine=new ArrayList();
}

Fixed version (ground truth):
/** 
 * Creates a new instance of PrintableTicket
 * @param t - BasicTicketForPrinter
 */
public PrintableTicket(BasicTicketForPrinter t,int start,int end){
  basict=t;
  this.start=start;
  this.end=end;
}
Program: 6043
Project: 6043
Buggy source:
private void jcboPaymentGatewayActionPerformed(java.awt.event.ActionEvent evt){
  pc=(PaymentConfiguration)paymentsName.get(comboValue(jcboPaymentGateway.getSelectedItem()));
  jPanel2.removeAll();
  jPanel2.add(pc.getComponent());
  jPanel2.revalidate();
  jPanel2.repaint();
}

Fixed version (ground truth):
private void jcboPaymentGatewayActionPerformed(java.awt.event.ActionEvent evt){
  pc=paymentsName.get(comboValue(jcboPaymentGateway.getSelectedItem()));
  if (pc != null) {
    jPanel2.removeAll();
    jPanel2.add(pc.getComponent());
    jPanel2.revalidate();
    jPanel2.repaint();
  }
}
Program: 6044
Project: 6044
Buggy source:
/** 
 * Creates new form JPanelConfigPayment 
 */
public JPanelConfigPayment(){
  initComponents();
  initializePaymentsName();
  jcboCardReader.addActionListener(dirty);
  jcboPaymentGateway.addActionListener(dirty);
  jchkPaymentTest.addActionListener(dirty);
  jcboPaymentGateway.addItem("String_Node_Str");
  jcboPaymentGateway.addItem("String_Node_Str");
  jcboPaymentGateway.addItem("String_Node_Str");
  jcboPaymentGateway.addItem("String_Node_Str");
  jcboPaymentGateway.addItem("String_Node_Str");
  jcboPaymentGateway.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Creates new form JPanelConfigPayment 
 */
public JPanelConfigPayment(){
  initComponents();
  jcboCardReader.addActionListener(dirty);
  jcboPaymentGateway.addActionListener(dirty);
  jchkPaymentTest.addActionListener(dirty);
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  initPayments("String_Node_Str",new ConfigPaymentPanelGeneric());
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
}
Program: 6045
Project: 6045
Buggy source:
@Override public void loadProperties(AppConfig config){
  jtxtCommerceCode.setText(config.getProperty("String_Node_Str"));
  AltEncrypter cypher=new AltEncrypter("String_Node_Str");
  if (config.getProperty("String_Node_Str") != null) {
    jtxtCommerceTerminal.setText(comboValue(config.getProperty("String_Node_Str")));
  }
  if (config.getProperty("String_Node_Str") != null) {
    jtxtCommerceSign.setText(cypher.decrypt(config.getProperty("String_Node_Str").substring(6)));
  }
  if (config.getProperty("String_Node_Str") != null) {
    jCheckBox1.setSelected(Boolean.valueOf(config.getProperty("String_Node_Str")).booleanValue());
  }
}

Fixed version (ground truth):
@Override public void loadProperties(AppConfig config){
  String sCommerceID=config.getProperty("String_Node_Str");
  String sCommerceTerminal=config.getProperty("String_Node_Str");
  String sCommerceSign=config.getProperty("String_Node_Str");
  String sCommerceSHA=config.getProperty("String_Node_Str");
  if (sCommerceID != null && sCommerceTerminal != null && sCommerceSign != null && sCommerceSHA != null && sCommerceSign.startsWith("String_Node_Str")) {
    jtxtCommerceCode.setText(config.getProperty("String_Node_Str"));
    AltEncrypter cypher=new AltEncrypter("String_Node_Str");
    jtxtCommerceTerminal.setText(comboValue(config.getProperty("String_Node_Str")));
    jtxtCommerceSign.setText(cypher.decrypt(config.getProperty("String_Node_Str").substring(6)));
    jCheckBox1.setSelected(Boolean.valueOf(config.getProperty("String_Node_Str")).booleanValue());
  }
}
Program: 6046
Project: 6046
Buggy source:
public void draw(Graphics2D g2d,int x,int y,int width,int start,int lines){
  int currenty=y;
  for (int i=start; i < lines; i++) {
    m_aCommands.get(i).draw(g2d,x,currenty,width);
    currenty+=m_aCommands.get(i).getHeight();
  }
}

Fixed version (ground truth):
public void draw(Graphics2D g2d,int x,int y,int width){
  int currenty=y;
  for (  PrintItem pi : m_aCommands) {
    pi.draw(g2d,x,currenty,width);
    currenty+=pi.getHeight();
  }
}
Program: 6047
Project: 6047
Buggy source:
private void refreshTicket(){
  CardLayout cl=(CardLayout)(getLayout());
  if (m_oTicket == null) {
    m_jTicketId.setText(null);
    m_ticketlines.clearTicketLines();
    m_jSubtotalEuros.setText(null);
    m_jTaxesEuros.setText(null);
    m_jTotalEuros.setText(null);
    stateToZero();
    cl.show(this,"String_Node_Str");
  }
 else {
    if (m_oTicket.getTicketType() == TicketInfo.RECEIPT_REFUND) {
      m_jEditLine.setVisible(false);
      m_jList.setVisible(false);
    }
    for (    TicketLineInfo line : m_oTicket.getLines()) {
      line.setTaxInfo(taxeslogic.getTaxInfo(line.getProductTaxCategoryID(),m_oTicket.getCustomer()));
    }
    m_jTicketId.setText(m_oTicket.getName(m_oTicketExt));
    m_ticketlines.clearTicketLines();
    for (int i=0; i < m_oTicket.getLinesCount(); i++) {
      m_ticketlines.addTicketLine(m_oTicket.getLine(i));
    }
    printPartialTotals();
    stateToZero();
    cl.show(this,"String_Node_Str");
    m_jKeyFactory.setText(null);
    java.awt.EventQueue.invokeLater(new Runnable(){
      public void run(){
        m_jKeyFactory.requestFocus();
      }
    }
);
  }
}

Fixed version (ground truth):
private void refreshTicket(){
  CardLayout cl=(CardLayout)(getLayout());
  if (m_oTicket == null) {
    m_jTicketId.setText(null);
    m_ticketlines.clearTicketLines();
    m_jSubtotalEuros.setText(null);
    m_jTaxesEuros.setText(null);
    m_jTotalEuros.setText(null);
    stateToZero();
    cl.show(this,"String_Node_Str");
    resetSouthComponent();
  }
 else {
    if (m_oTicket.getTicketType() == TicketInfo.RECEIPT_REFUND) {
      m_jEditLine.setVisible(false);
      m_jList.setVisible(false);
    }
    for (    TicketLineInfo line : m_oTicket.getLines()) {
      line.setTaxInfo(taxeslogic.getTaxInfo(line.getProductTaxCategoryID(),m_oTicket.getCustomer()));
    }
    m_jTicketId.setText(m_oTicket.getName(m_oTicketExt));
    m_ticketlines.clearTicketLines();
    for (int i=0; i < m_oTicket.getLinesCount(); i++) {
      m_ticketlines.addTicketLine(m_oTicket.getLine(i));
    }
    printPartialTotals();
    stateToZero();
    cl.show(this,"String_Node_Str");
    resetSouthComponent();
    m_jKeyFactory.setText(null);
    java.awt.EventQueue.invokeLater(new Runnable(){
      public void run(){
        m_jKeyFactory.requestFocus();
      }
    }
);
  }
}
Program: 6048
Project: 6048
Buggy source:
/** 
 * Creates new form JPanelConfigLocale 
 */
public JPanelConfigLocale(){
  initComponents();
  jcboLocale.addActionListener(dirty);
  jcboInteger.addActionListener(dirty);
  jcboDouble.addActionListener(dirty);
  jcboCurrency.addActionListener(dirty);
  jcboPercent.addActionListener(dirty);
  jcboDate.addActionListener(dirty);
  jcboTime.addActionListener(dirty);
  jcboDatetime.addActionListener(dirty);
  Locale[] availablelocales=Locale.getAvailableLocales();
  Arrays.sort(availablelocales,new LocaleComparator());
  jcboLocale.addItem(new LocaleInfo(null));
  for (int i=0; i < availablelocales.length; i++) {
    jcboLocale.addItem(new LocaleInfo(availablelocales[i]));
  }
  jcboInteger.addItem(DEFAULT_VALUE);
  jcboInteger.addItem("String_Node_Str");
  jcboInteger.addItem("String_Node_Str");
  jcboDouble.addItem(DEFAULT_VALUE);
  jcboDouble.addItem("String_Node_Str");
  jcboDouble.addItem("String_Node_Str");
  jcboCurrency.addItem(DEFAULT_VALUE);
  jcboCurrency.addItem("String_Node_Str");
  jcboCurrency.addItem("String_Node_Str");
  jcboPercent.addItem(DEFAULT_VALUE);
  jcboPercent.addItem("String_Node_Str");
  jcboDate.addItem(DEFAULT_VALUE);
  jcboTime.addItem(DEFAULT_VALUE);
  jcboDatetime.addItem(DEFAULT_VALUE);
}

Fixed version (ground truth):
/** 
 * Creates new form JPanelConfigLocale 
 */
public JPanelConfigLocale(){
  initComponents();
  jcboLocale.addActionListener(dirty);
  jcboInteger.addActionListener(dirty);
  jcboDouble.addActionListener(dirty);
  jcboCurrency.addActionListener(dirty);
  jcboPercent.addActionListener(dirty);
  jcboDate.addActionListener(dirty);
  jcboTime.addActionListener(dirty);
  jcboDatetime.addActionListener(dirty);
  List<Locale> availablelocales=new ArrayList<Locale>();
  availablelocales.addAll(Arrays.asList(Locale.getAvailableLocales()));
  addLocale(availablelocales,new Locale("String_Node_Str","String_Node_Str","String_Node_Str"));
  addLocale(availablelocales,new Locale("String_Node_Str","String_Node_Str","String_Node_Str"));
  Collections.sort(availablelocales,new LocaleComparator());
  jcboLocale.addItem(new LocaleInfo(null));
  for (  Locale l : availablelocales) {
    jcboLocale.addItem(new LocaleInfo(l));
  }
  jcboInteger.addItem(DEFAULT_VALUE);
  jcboInteger.addItem("String_Node_Str");
  jcboInteger.addItem("String_Node_Str");
  jcboDouble.addItem(DEFAULT_VALUE);
  jcboDouble.addItem("String_Node_Str");
  jcboDouble.addItem("String_Node_Str");
  jcboCurrency.addItem(DEFAULT_VALUE);
  jcboCurrency.addItem("String_Node_Str");
  jcboCurrency.addItem("String_Node_Str");
  jcboPercent.addItem(DEFAULT_VALUE);
  jcboPercent.addItem("String_Node_Str");
  jcboDate.addItem(DEFAULT_VALUE);
  jcboTime.addItem(DEFAULT_VALUE);
  jcboDatetime.addItem(DEFAULT_VALUE);
}