nus-yam/ex-repair huggingface dataset:
Program: 6049
Project: 6049
Buggy source:
public int compare(Locale o1,Locale o2){
  return o1.toString().compareTo(o2.toString());
}

Fixed version (ground truth):
public int compare(Locale o1,Locale o2){
  return o1.getDisplayName().compareTo(o2.getDisplayName());
}
Program: 6050
Project: 6050
Buggy source:
/** 
 * 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");
}

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 ConfigPaymentPanelGeneric());
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
  jcboCardReader.addItem("String_Node_Str");
}
Program: 6051
Project: 6051
Buggy source:
private void addUnits(double dUnits){
  int i=m_invlines.getSelectedRow();
  if (i >= 0) {
    InventoryLine inv=m_invlines.getLine(i);
    double dunits=inv.getMultiply() + dUnits;
    if (dunits == 0.0) {
      deleteLine(i);
    }
 else {
      inv.setMultiply(inv.getMultiply() + dUnits);
      m_invlines.setLine(i,inv);
    }
  }
}

Fixed version (ground truth):
private void addUnits(double dUnits){
  int i=m_invlines.getSelectedRow();
  if (i >= 0) {
    InventoryLine inv=m_invlines.getLine(i);
    double dunits=inv.getMultiply() + dUnits;
    if (dunits <= 0.0) {
      deleteLine(i);
    }
 else {
      inv.setMultiply(inv.getMultiply() + dUnits);
      m_invlines.setLine(i,inv);
    }
  }
}
Program: 6052
Project: 6052
Buggy source:
private void stateTransition(char cTrans){
  if (cTrans == '\u007f') {
    m_jcodebar.setText(null);
  }
 else   if (cTrans == '+') {
    if (m_jcodebar.getText() == null || m_jcodebar.getText().equals("String_Node_Str")) {
      addUnits(1.0);
    }
 else {
      addUnits(Double.parseDouble(m_jcodebar.getText()));
      m_jcodebar.setText(null);
    }
  }
 else   if (cTrans == '-') {
    if (m_jcodebar.getText() == null || m_jcodebar.getText().equals("String_Node_Str")) {
      addUnits(-1.0);
    }
 else {
      addUnits(-Double.parseDouble(m_jcodebar.getText()));
      m_jcodebar.setText(null);
    }
  }
 else   if (cTrans == ' ' || cTrans == '=') {
    if (m_invlines.getCount() == 0) {
      Toolkit.getDefaultToolkit().beep();
    }
 else {
      saveData();
    }
  }
 else {
    m_jcodebar.setText(m_jcodebar.getText() + cTrans);
  }
}

Fixed version (ground truth):
private void stateTransition(char cTrans){
  if (cTrans == '\u007f') {
    m_jcodebar.setText(null);
    NUMBER_STATE=DEFAULT;
  }
 else   if (cTrans == '*') {
    MULTIPLY=ACTIVE;
  }
 else   if (cTrans == '+') {
    if (MULTIPLY != DEFAULT && NUMBER_STATE != DEFAULT) {
      setUnits(Double.parseDouble(m_jcodebar.getText()));
      m_jcodebar.setText(null);
    }
 else {
      if (m_jcodebar.getText() == null || m_jcodebar.getText().equals("String_Node_Str")) {
        addUnits(1.0);
      }
 else {
        addUnits(Double.parseDouble(m_jcodebar.getText()));
        m_jcodebar.setText(null);
      }
    }
    NUMBER_STATE=DEFAULT;
    MULTIPLY=DEFAULT;
  }
 else   if (cTrans == '-') {
    if (m_jcodebar.getText() == null || m_jcodebar.getText().equals("String_Node_Str")) {
      addUnits(-1.0);
    }
 else {
      addUnits(-Double.parseDouble(m_jcodebar.getText()));
      m_jcodebar.setText(null);
    }
    NUMBER_STATE=DEFAULT;
    MULTIPLY=DEFAULT;
  }
 else   if (cTrans == '.') {
    if (m_jcodebar.getText() == null || m_jcodebar.getText().equals("String_Node_Str")) {
      m_jcodebar.setText("String_Node_Str");
    }
 else     if (NUMBER_STATE != DECIMAL) {
      m_jcodebar.setText(m_jcodebar.getText() + cTrans);
    }
    NUMBER_STATE=DECIMAL;
  }
 else   if (cTrans == ' ' || cTrans == '=') {
    if (m_invlines.getCount() == 0) {
      Toolkit.getDefaultToolkit().beep();
    }
 else {
      saveData();
    }
  }
 else {
    m_jcodebar.setText(m_jcodebar.getText() + cTrans);
    if (NUMBER_STATE != DECIMAL) {
      NUMBER_STATE=ACTIVE;
    }
  }
}
Program: 6054
Project: 6054
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 {
    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");
  }
 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();
      }
    }
);
  }
}
Program: 6055
Project: 6055
Buggy source:
public void setProperty(String sKey,String sValue){
  m_propsconfig.setProperty(sKey,sValue);
}

Fixed version (ground truth):
public void setProperty(String sKey,String sValue){
  if (sValue == null) {
    m_propsconfig.remove(sKey);
  }
 else {
    m_propsconfig.setProperty(sKey,sValue);
  }
}
Program: 6056
Project: 6056
Buggy source:
public DataResultSet openExec(Object params) throws BasicException {
  closeExec();
  try {
    m_Stmt=m_s.getConnection().prepareStatement(m_sentence);
    if (params != null) {
      m_SerWrite.writeValues(new PreparedSentencePars(m_Stmt),params);
    }
    if (m_Stmt.execute()) {
      return new JDBCDataResultSet(m_Stmt.getResultSet(),m_SerRead);
    }
 else {
      int iUC=m_Stmt.getUpdateCount();
      if (iUC < 0) {
        return null;
      }
 else {
        return new SentenceUpdateResultSet(iUC);
      }
    }
  }
 catch (  SQLException eSQL) {
    throw new BasicException(eSQL);
  }
}

Fixed version (ground truth):
public DataResultSet openExec(Object params) throws BasicException {
  closeExec();
  try {
    m_Stmt=m_s.getConnection().prepareStatement(m_sentence);
    if (m_SerWrite != null) {
      m_SerWrite.writeValues(new PreparedSentencePars(m_Stmt),params);
    }
    if (m_Stmt.execute()) {
      return new JDBCDataResultSet(m_Stmt.getResultSet(),m_SerRead);
    }
 else {
      int iUC=m_Stmt.getUpdateCount();
      if (iUC < 0) {
        return null;
      }
 else {
        return new SentenceUpdateResultSet(iUC);
      }
    }
  }
 catch (  SQLException eSQL) {
    throw new BasicException(eSQL);
  }
}
Program: 6057
Project: 6057
Buggy source:
public String getSQL(SerializerWrite sw,Object params) throws BasicException {
  QBFParameter mydw=new QBFParameter(m_asFindFields);
  if (params == null) {
    return m_sSentNullFilter;
  }
 else {
    sw.writeValues(mydw,params);
    String sFilter=mydw.getFilter();
    if (sFilter.length() == 0) {
      return m_sSentNullFilter;
    }
 else {
      return m_sSentBeginPart + "String_Node_Str" + sFilter+ "String_Node_Str"+ m_sSentEndPart;
    }
  }
}

Fixed version (ground truth):
public String getSQL(SerializerWrite sw,Object params) throws BasicException {
  QBFParameter mydw=new QBFParameter(m_asFindFields);
  if (sw == null || params == null) {
    return m_sSentNullFilter;
  }
 else {
    sw.writeValues(mydw,params);
    String sFilter=mydw.getFilter();
    if (sFilter.length() == 0) {
      return m_sSentNullFilter;
    }
 else {
      return m_sSentBeginPart + "String_Node_Str" + sFilter+ "String_Node_Str"+ m_sSentEndPart;
    }
  }
}
Program: 6058
Project: 6058
Buggy source:
public final SentenceList getProductListNormal(){
  return new StaticSentence(s,new QBFBuilder("String_Node_Str" + "String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}),new SerializerWriteBasic(new Datas[]{Datas.OBJECT,Datas.STRING,Datas.OBJECT,Datas.DOUBLE,Datas.OBJECT,Datas.DOUBLE,Datas.OBJECT,Datas.STRING,Datas.OBJECT,Datas.STRING}),new SerializerReadClass(ProductInfoExt.class));
}

Fixed version (ground truth):
public SentenceList getProductListNormal(){
  return new StaticSentence(s,new QBFBuilder("String_Node_Str" + "String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}),new SerializerWriteBasic(new Datas[]{Datas.OBJECT,Datas.STRING,Datas.OBJECT,Datas.DOUBLE,Datas.OBJECT,Datas.DOUBLE,Datas.OBJECT,Datas.STRING,Datas.OBJECT,Datas.STRING}),new SerializerReadClass(ProductInfoExt.class));
}
Program: 6059
Project: 6059
Buggy source:
public final SentenceList getProductListAuxiliar(){
  return new StaticSentence(s,new QBFBuilder("String_Node_Str" + "String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}),new SerializerWriteBasic(new Datas[]{Datas.OBJECT,Datas.STRING,Datas.OBJECT,Datas.DOUBLE,Datas.OBJECT,Datas.DOUBLE,Datas.OBJECT,Datas.STRING,Datas.OBJECT,Datas.STRING}),new SerializerReadClass(ProductInfoExt.class));
}

Fixed version (ground truth):
public SentenceList getProductListAuxiliar(){
  return new StaticSentence(s,new QBFBuilder("String_Node_Str" + "String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}),new SerializerWriteBasic(new Datas[]{Datas.OBJECT,Datas.STRING,Datas.OBJECT,Datas.DOUBLE,Datas.OBJECT,Datas.DOUBLE,Datas.OBJECT,Datas.STRING,Datas.OBJECT,Datas.STRING}),new SerializerReadClass(ProductInfoExt.class));
}
Program: 6060
Project: 6060
Buggy source:
private void jcmdOKActionPerformed(java.awt.event.ActionEvent evt){
  String stext=jLabel1.getText();
  jLabel1.setText(AppLocal.getIntString("String_Node_Str"));
  jcmdOK.setEnabled(false);
  jcmdCancel.setEnabled(false);
  try {
    m_scanner.connectDevice();
    m_scanner.startUploadProduct();
    ListModel l=m_bd.getListModel();
    for (int i=0; i < l.getSize(); i++) {
      Object[] myprod=(Object[])l.getElementAt(i);
      m_scanner.sendProduct((String)myprod[2],(String)myprod[1],(Double)myprod[7]);
    }
    m_scanner.stopUploadProduct();
    MessageInf msg=new MessageInf(MessageInf.SGN_SUCCESS,AppLocal.getIntString("String_Node_Str"));
    msg.show(this);
  }
 catch (  DeviceScannerException e) {
    MessageInf msg=new MessageInf(MessageInf.SGN_WARNING,AppLocal.getIntString("String_Node_Str"),e);
    msg.show(this);
  }
 finally {
    m_scanner.disconnectDevice();
  }
  jLabel1.setText(stext);
  jcmdOK.setEnabled(true);
  jcmdCancel.setEnabled(true);
  dispose();
}

Fixed version (ground truth):
private void jcmdOKActionPerformed(java.awt.event.ActionEvent evt){
  String stext=jLabel1.getText();
  jLabel1.setText(AppLocal.getIntString("String_Node_Str"));
  jcmdOK.setEnabled(false);
  jcmdCancel.setEnabled(false);
  try {
    m_scanner.connectDevice();
    m_scanner.startUploadProduct();
    ListModel l=m_bd.getListModel();
    for (int i=0; i < l.getSize(); i++) {
      Object[] myprod=(Object[])l.getElementAt(i);
      m_scanner.sendProduct((String)myprod[3],(String)myprod[2],(Double)myprod[6]);
    }
    m_scanner.stopUploadProduct();
    MessageInf msg=new MessageInf(MessageInf.SGN_SUCCESS,AppLocal.getIntString("String_Node_Str"));
    msg.show(this);
  }
 catch (  DeviceScannerException e) {
    MessageInf msg=new MessageInf(MessageInf.SGN_WARNING,AppLocal.getIntString("String_Node_Str"),e);
    msg.show(this);
  }
 finally {
    m_scanner.disconnectDevice();
  }
  jLabel1.setText(stext);
  jcmdOK.setEnabled(true);
  jcmdCancel.setEnabled(true);
  dispose();
}
Program: 6061
Project: 6061
Buggy source:
protected void typeCharInternal(char c){
  String sOldText=getText();
  if (c == '\u0008') {
    if (m_cLastChar == '\u0000') {
      if (m_svalue != null && m_svalue.length() > 0) {
        m_svalue=m_svalue.substring(0,m_svalue.length() - 1);
      }
    }
 else {
      m_iTicks=0;
      m_cLastChar='\u0000';
    }
  }
 else   if (c == '\u007f') {
    m_svalue=null;
    m_iTicks=0;
    m_cLastChar='\u0000';
  }
 else   if (c >= ' ') {
    if (m_cLastChar != '\u0000') {
      char ckey=getKeyChar();
      m_svalue=appendChar2Value(ckey);
      acceptKeyChar(ckey);
    }
    m_iTicks=0;
    m_cLastChar='\u0000';
    m_svalue=appendChar2Value(c);
  }
  m_jtimer.restart();
  firePropertyChange("String_Node_Str",sOldText,getText());
}

Fixed version (ground truth):
protected void typeCharInternal(char c){
  String sOldText=getText();
  if (c == '\u0008') {
    if (m_cLastChar == '\u0000') {
      if (m_svalue != null && m_svalue.length() > 0) {
        m_svalue=m_svalue.substring(0,m_svalue.length() - 1);
      }
    }
 else {
      m_iTicks=0;
      m_cLastChar='\u0000';
    }
  }
 else   if (c == '\u007f') {
    m_iMode=getStartMode();
    m_svalue=null;
    m_iTicks=0;
    m_cLastChar='\u0000';
  }
 else   if (c >= ' ') {
    if (m_cLastChar != '\u0000') {
      char ckey=getKeyChar();
      m_svalue=appendChar2Value(ckey);
      acceptKeyChar(ckey);
    }
    m_iTicks=0;
    m_cLastChar='\u0000';
    m_svalue=appendChar2Value(c);
  }
  m_jtimer.restart();
  firePropertyChange("String_Node_Str",sOldText,getText());
}
Program: 6062
Project: 6062
Buggy source:
protected void transCharInternal(char c){
  String sOldText=getText();
  if (c == '-') {
    if (m_cLastChar == '\u0000') {
      if (m_svalue != null && m_svalue.length() > 0) {
        m_svalue=m_svalue.substring(0,m_svalue.length() - 1);
      }
    }
 else {
      m_iTicks=0;
      m_cLastChar='\u0000';
    }
  }
 else   if (c == '\u007f') {
    m_svalue=null;
    m_iTicks=0;
    m_cLastChar='\u0000';
  }
 else   if (c == '.') {
    if (m_cLastChar != '\u0000') {
      m_svalue=appendChar2Value(getKeyChar());
    }
    m_iTicks=0;
    m_cLastChar='\u0000';
    m_iMode=(m_iMode + 1) % 4;
  }
 else   if (c == '1' || c == '2' || c == '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9' || c == '0') {
    if (m_iMode == MODE_123) {
      m_svalue=appendChar2Value(c);
    }
 else     if (c == m_cLastChar) {
      m_iTicks++;
    }
 else {
      if (m_cLastChar != '\u0000') {
        char ckey=getKeyChar();
        m_svalue=appendChar2Value(ckey);
        acceptKeyChar(ckey);
      }
      m_iTicks=0;
      m_cLastChar=c;
    }
  }
  m_jtimer.restart();
  firePropertyChange("String_Node_Str",sOldText,getText());
}

Fixed version (ground truth):
protected void transCharInternal(char c){
  String sOldText=getText();
  if (c == '-') {
    if (m_cLastChar == '\u0000') {
      if (m_svalue != null && m_svalue.length() > 0) {
        m_svalue=m_svalue.substring(0,m_svalue.length() - 1);
      }
    }
 else {
      m_iTicks=0;
      m_cLastChar='\u0000';
    }
  }
 else   if (c == '\u007f') {
    m_iMode=getStartMode();
    m_svalue=null;
    m_iTicks=0;
    m_cLastChar='\u0000';
  }
 else   if (c == '.') {
    if (m_cLastChar != '\u0000') {
      m_svalue=appendChar2Value(getKeyChar());
    }
    m_iTicks=0;
    m_cLastChar='\u0000';
    m_iMode=(m_iMode + 1) % 4;
  }
 else   if (c == '1' || c == '2' || c == '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9' || c == '0') {
    if (m_iMode == MODE_123) {
      m_svalue=appendChar2Value(c);
    }
 else     if (c == m_cLastChar) {
      m_iTicks++;
    }
 else {
      if (m_cLastChar != '\u0000') {
        char ckey=getKeyChar();
        m_svalue=appendChar2Value(ckey);
        acceptKeyChar(ckey);
      }
      m_iTicks=0;
      m_cLastChar=c;
    }
  }
  m_jtimer.restart();
  firePropertyChange("String_Node_Str",sOldText,getText());
}
Program: 6063
Project: 6063
Buggy source:
public void endLine(){
  m_ticketcurrent.endLine();
}

Fixed version (ground truth):
@Override public void endLine(){
  m_ticketcurrent.endLine();
}
Program: 6064
Project: 6064
Buggy source:
public String getPrinterDescription(){
  return null;
}

Fixed version (ground truth):
@Override public String getPrinterDescription(){
  return null;
}
Program: 6065
Project: 6065
Buggy source:
public void printImage(BufferedImage image){
  m_ticketcurrent.printImage(image);
}

Fixed version (ground truth):
@Override public void printImage(BufferedImage image){
  m_ticketcurrent.printImage(image);
}
Program: 6066
Project: 6066
Buggy source:
public JComponent getPrinterComponent(){
  return null;
}

Fixed version (ground truth):
@Override public JComponent getPrinterComponent(){
  return null;
}
Program: 6067
Project: 6067
Buggy source:
public String getPrinterName(){
  return m_sName;
}

Fixed version (ground truth):
@Override public String getPrinterName(){
  return m_sName;
}
Program: 6068
Project: 6068
Buggy source:
public void endReceipt(){
  try {
    PrinterJob printJob=PrinterJob.getPrinterJob();
    printJob.setPrintable(new PrintableTicket(m_ticketcurrent));
    printJob.setJobName(AppLocal.APP_NAME + "String_Node_Str");
    printJob.setPrintService(printservice);
    printJob.print();
  }
 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));
    printJob.setJobName(AppLocal.APP_NAME + "String_Node_Str");
    printJob.setPrintService(printservice);
    printJob.print();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
  m_ticketcurrent=null;
}
Program: 6069
Project: 6069
Buggy source:
public void printBarCode(String type,String position,String code){
  m_ticketcurrent.printBarCode(type,position,code);
}

Fixed version (ground truth):
@Override public void printBarCode(String type,String position,String code){
  m_ticketcurrent.printBarCode(type,position,code);
}
Program: 6070
Project: 6070
Buggy source:
public void beginLine(int iTextSize){
  m_ticketcurrent.beginLine(iTextSize);
}

Fixed version (ground truth):
@Override public void beginLine(int iTextSize){
  m_ticketcurrent.beginLine(0);
}
Program: 6071
Project: 6071
Buggy source:
public void reset(){
  m_ticketcurrent=null;
}

Fixed version (ground truth):
@Override public void reset(){
  m_ticketcurrent=null;
}
Program: 6072
Project: 6072
Buggy source:
public void beginReceipt(){
  m_ticketcurrent=new BasicTicket();
}

Fixed version (ground truth):
@Override public void beginReceipt(){
  m_ticketcurrent=new BasicTicketForPrinter();
}
Program: 6073
Project: 6073
Buggy source:
public void printText(int iStyle,String sText){
  m_ticketcurrent.printText(iStyle,sText);
}

Fixed version (ground truth):
@Override public void printText(int iStyle,String sText){
  m_ticketcurrent.printText(iStyle,sText);
}
Program: 6074
Project: 6074
Buggy source:
public int print(Graphics g,PageFormat pf,int pi) throws PrinterException {
  if (pi >= 1) {
    return Printable.NO_SUCH_PAGE;
  }
  basict.draw((Graphics2D)g,(int)pf.getImageableX() + H_GAP,(int)pf.getImageableY() + V_GAP,LINEWIDTH);
  return Printable.PAGE_EXISTS;
}

Fixed version (ground truth):
@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++;
    }
  }
  Graphics2D g2=(Graphics2D)g;
  System.out.println(g2.getFont().getFontName());
  if (pi > page) {
    return Printable.NO_SUCH_PAGE;
  }
  g2.setColor(Color.RED);
  g2.setFont(new Font("String_Node_Str",Font.ITALIC,34));
  g2.drawString("String_Node_Str",100,100);
  basict.draw(g2,(int)pf.getImageableX(),(int)pf.getImageableY(),LINEWIDTH,(Integer)startLine.get(pi),(Integer)endLine.get(pi));
  return Printable.PAGE_EXISTS;
}
Program: 6075
Project: 6075
Buggy source:
/** 
 * Creates a new instance of PrintableTicket 
 */
public PrintableTicket(BasicTicket t){
  basict=t;
}

Fixed version (ground truth):
/** 
 * Creates a new instance of PrintableTicket 
 */
public PrintableTicket(BasicTicketForPrinter t){
  basict=t;
  startLine=new ArrayList();
  startLine.add(0,0);
  endLine=new ArrayList();
}
Program: 6076
Project: 6076
Buggy source:
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();
  }
}

Fixed version (ground truth):
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();
  }
}
Program: 6077
Project: 6077
Buggy source:
private boolean checkCardNumber(String sNumber){
  if (sNumber == null || (sNumber.length() != 16 && sNumber.length() != 15)) {
    return false;
  }
  for (int i=0; i < 16; i++) {
    char c=sNumber.charAt(i);
    if (c != '0' && c != '1' && c != '2' && c != '3' && c != '4' && c != '5' && c != '6' && c != '7' && c != '8' && c != '9') {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean checkCardNumber(String sNumber){
  return LuhnAlgorithm.checkCC(sNumber);
}
Program: 6078
Project: 6078
Buggy source:
private boolean checkExpDate(String sDate){
  if (sDate == null || sDate.length() != 4) {
    return false;
  }
  for (int i=0; i < 4; i++) {
    char c=sDate.charAt(i);
    if (c != '0' && c != '1' && c != '2' && c != '3' && c != '4' && c != '5' && c != '6' && c != '7' && c != '8' && c != '9') {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean checkExpDate(String sDate){
  return (sDate.length() == 4 && StringUtils.isNumber(sDate.trim()));
}
Program: 6079
Project: 6079
Buggy source:
private boolean isValidCardNumber(){
  return !(m_jCardNumber.getText() == null || m_jCardNumber.getText().length() != 16);
}

Fixed version (ground truth):
private boolean isValidCardNumber(){
  return (LuhnAlgorithm.checkCC(m_jCardNumber.getText()) && m_jCardNumber.getText().length() > 13 && m_jCardNumber.getText().length() < 20);
}
Program: 6080
Project: 6080
Buggy source:
public void printLine(String sproduct,double dprice,double dunits);

Fixed version (ground truth):
public void printLine(String sproduct,double dprice,double dunits,int taxinfo);
Program: 6081
Project: 6081
Buggy source:
public void printLine(String sproduct,double dprice,double dunits){
}

Fixed version (ground truth):
public void printLine(String sproduct,double dprice,double dunits,int taxinfo){
}
Program: 6084
Project: 6084
Buggy source:
public void printLine(String sproduct,double dprice,double dunits){
  try {
    m_fiscal.printRecItem(sproduct,roundFiscal(dprice * dunits),0,0,roundFiscal(dprice),"String_Node_Str");
  }
 catch (  JposException e) {
  }
}

Fixed version (ground truth):
public void printLine(String sproduct,double dprice,double dunits,int taxinfo){
  try {
    m_fiscal.printRecItem(sproduct,roundFiscal(dprice * dunits),(int)(dunits * 1000),taxinfo,roundFiscal(dprice),"String_Node_Str");
  }
 catch (  JposException e) {
  }
}
Program: 6085
Project: 6085
Buggy source:
private void jcmdOKActionPerformed(java.awt.event.ActionEvent evt){
  String stext=jLabel1.getText();
  jLabel1.setText(AppLocal.getIntString("String_Node_Str"));
  jcmdOK.setEnabled(false);
  jcmdCancel.setEnabled(false);
  try {
    m_scanner.connectDevice();
    m_scanner.startUploadProduct();
    ListModel l=m_bd.getListModel();
    for (int i=0; i < l.getSize(); i++) {
      Object[] myprod=(Object[])l.getElementAt(i);
      m_scanner.sendProduct((String)myprod[2],(String)myprod[1],(Double)myprod[5]);
    }
    m_scanner.stopUploadProduct();
    MessageInf msg=new MessageInf(MessageInf.SGN_SUCCESS,AppLocal.getIntString("String_Node_Str"));
    msg.show(this);
  }
 catch (  DeviceScannerException e) {
    MessageInf msg=new MessageInf(MessageInf.SGN_WARNING,AppLocal.getIntString("String_Node_Str"),e);
    msg.show(this);
  }
 finally {
    m_scanner.disconnectDevice();
  }
  jLabel1.setText(stext);
  jcmdOK.setEnabled(true);
  jcmdCancel.setEnabled(true);
  dispose();
}

Fixed version (ground truth):
private void jcmdOKActionPerformed(java.awt.event.ActionEvent evt){
  String stext=jLabel1.getText();
  jLabel1.setText(AppLocal.getIntString("String_Node_Str"));
  jcmdOK.setEnabled(false);
  jcmdCancel.setEnabled(false);
  try {
    m_scanner.connectDevice();
    m_scanner.startUploadProduct();
    ListModel l=m_bd.getListModel();
    for (int i=0; i < l.getSize(); i++) {
      Object[] myprod=(Object[])l.getElementAt(i);
      m_scanner.sendProduct((String)myprod[2],(String)myprod[1],(Double)myprod[7]);
    }
    m_scanner.stopUploadProduct();
    MessageInf msg=new MessageInf(MessageInf.SGN_SUCCESS,AppLocal.getIntString("String_Node_Str"));
    msg.show(this);
  }
 catch (  DeviceScannerException e) {
    MessageInf msg=new MessageInf(MessageInf.SGN_WARNING,AppLocal.getIntString("String_Node_Str"),e);
    msg.show(this);
  }
 finally {
    m_scanner.disconnectDevice();
  }
  jLabel1.setText(stext);
  jcmdOK.setEnabled(true);
  jcmdCancel.setEnabled(true);
  dispose();
}
Program: 6086
Project: 6086
Buggy source:
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt){
  TicketLineInfo line=receipttwo.getSelectedLine();
  if (line != null) {
    receiptone.addSelectedLine(line);
  }
}

Fixed version (ground truth):
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt){
  int numAux=receipttwo.countNumberAuxiliar();
  int ini=receipttwo.getJticketLine().getSelectedIndex();
  for (int i=ini; i <= ini + numAux; i++) {
    TicketLineInfo line=receipttwo.getSelectedLine();
    if (line != null) {
      receiptone.addSelectedLine(line);
    }
  }
}
Program: 6087
Project: 6087
Buggy source:
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt){
  TicketLineInfo line=receiptone.getSelectedLineUnit();
  if (line != null) {
    receipttwo.addSelectedLine(line);
  }
}

Fixed version (ground truth):
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt){
  TicketLineInfo line;
  int numAux=receiptone.countNumberAuxiliar();
  int ini=receiptone.getJticketLine().getSelectedIndex();
  if (numAux != 0) {
    line=receiptone.getSelectedLineUnit();
    receipttwo.addSelectedLine(line);
    int a=receiptone.countNumberAuxiliar();
    if (a != 0) {
      receiptone.getJticketLine().selectionDown();
    }
    ini=receiptone.getJticketLine().getSelectedIndex();
    for (int i=ini + 1; i <= ini + numAux; i++) {
      line=receiptone.getSelectedLine();
      if (line != null) {
        receipttwo.addSelectedLine(line);
      }
    }
  }
 else {
    line=receiptone.getSelectedLineUnit();
    receipttwo.addSelectedLine(line);
  }
}
Program: 6088
Project: 6088
Buggy source:
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt){
  TicketLineInfo line=receipttwo.getSelectedLineUnit();
  if (line != null) {
    receiptone.addSelectedLine(line);
  }
}

Fixed version (ground truth):
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt){
  TicketLineInfo line;
  int numAux=receipttwo.countNumberAuxiliar();
  int ini=receipttwo.getJticketLine().getSelectedIndex();
  if (numAux != 0) {
    line=receipttwo.getSelectedLineUnit();
    receiptone.addSelectedLine(line);
    int a=receipttwo.countNumberAuxiliar();
    if (a != 0) {
      receipttwo.getJticketLine().selectionDown();
    }
    ini=receipttwo.getJticketLine().getSelectedIndex();
    for (int i=ini + 1; i <= ini + numAux; i++) {
      line=receipttwo.getSelectedLine();
      if (line != null) {
        receiptone.addSelectedLine(line);
      }
    }
  }
 else {
    line=receipttwo.getSelectedLineUnit();
    receiptone.addSelectedLine(line);
  }
}
Program: 6089
Project: 6089
Buggy source:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt){
  TicketLineInfo line=receiptone.getSelectedLine();
  if (line != null) {
    receipttwo.addSelectedLine(line);
  }
}

Fixed version (ground truth):
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt){
  int numAux=receiptone.countNumberAuxiliar();
  int ini=receiptone.getJticketLine().getSelectedIndex();
  for (int i=ini; i <= ini + numAux; i++) {
    TicketLineInfo line=receiptone.getSelectedLine();
    if (line != null) {
      receipttwo.addSelectedLine(line);
    }
  }
}
Program: 6090
Project: 6090
Buggy source:
public void setActiveTicket(TicketInfo oTicket,Object oTicketExt){
  m_oTicket=oTicket;
  m_oTicketExt=oTicketExt;
  executeEvent(m_oTicket,m_oTicketExt,"String_Node_Str");
  refreshTicket();
}

Fixed version (ground truth):
public void setActiveTicket(TicketInfo oTicket,Object oTicketExt){
  m_oTicket=oTicket;
  m_oTicketExt=oTicketExt;
  m_oTicket.setUser(m_App.getAppUserView().getUser().getUserInfo());
  m_oTicket.setActiveCash(m_App.getActiveCashIndex());
  m_oTicket.setDate(new Date());
  executeEvent(m_oTicket,m_oTicketExt,"String_Node_Str");
  refreshTicket();
}
Program: 6091
Project: 6091
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 {
    m_oTicket.setUser(m_App.getAppUserView().getUser().getUserInfo());
    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");
  }
 else {
    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();
      }
    }
);
  }
}
Program: 6092
Project: 6092
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 {
    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");
  }
 else {
    m_oTicket.setUser(m_App.getAppUserView().getUser().getUserInfo());
    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();
      }
    }
);
  }
}
Program: 6093
Project: 6093
Buggy source:
public void setActiveTicket(TicketInfo oTicket,Object oTicketExt){
  m_oTicket=oTicket;
  m_oTicketExt=oTicketExt;
  m_oTicket.setUser(m_App.getAppUserView().getUser().getUserInfo());
  m_oTicket.setActiveCash(m_App.getActiveCashIndex());
  m_oTicket.setDate(new Date());
  executeEvent(m_oTicket,m_oTicketExt,"String_Node_Str");
  refreshTicket();
}

Fixed version (ground truth):
public void setActiveTicket(TicketInfo oTicket,Object oTicketExt){
  m_oTicket=oTicket;
  m_oTicketExt=oTicketExt;
  if (m_oTicket != null) {
    m_oTicket.setUser(m_App.getAppUserView().getUser().getUserInfo());
    m_oTicket.setActiveCash(m_App.getActiveCashIndex());
    m_oTicket.setDate(new Date());
  }
  executeEvent(m_oTicket,m_oTicketExt,"String_Node_Str");
  refreshTicket();
}
Program: 6094
Project: 6094
Buggy source:
public final void deleteTicket(final TicketInfo ticket,final String location) throws BasicException {
  Transaction t=new Transaction(s){
    public Object transact() throws BasicException {
      Date d=new Date();
      for (int i=0; i < ticket.getLinesCount(); i++) {
        if (ticket.getLine(i).getProductID() != null) {
          getStockDiaryInsert().exec(new Object[]{UUID.randomUUID().toString(),d,ticket.getLine(i).getMultiply() >= 0.0 ? MovementReason.IN_REFUND.getKey() : MovementReason.OUT_SALE.getKey(),location,ticket.getLine(i).getProductID(),new Double(ticket.getLine(i).getMultiply()),new Double(ticket.getLine(i).getPrice())});
        }
      }
      for (      PaymentInfo p : ticket.getPayments()) {
        if ("String_Node_Str".equals(p.getName()) || "String_Node_Str".equals(p.getName())) {
          getDebtUpdate().exec(new Object[]{ticket.getCustomer().getId(),new Double(-p.getTotal()),ticket.getDate()});
        }
      }
      new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
      new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
      new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
      new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
      return null;
    }
  }
;
  t.execute();
}

Fixed version (ground truth):
public final void deleteTicket(final TicketInfo ticket,final String location) throws BasicException {
  Transaction t=new Transaction(s){
    public Object transact() throws BasicException {
      Date d=new Date();
      for (int i=0; i < ticket.getLinesCount(); i++) {
        if (ticket.getLine(i).getProductID() != null) {
          getStockDiaryInsert().exec(new Object[]{UUID.randomUUID().toString(),d,ticket.getLine(i).getMultiply() >= 0.0 ? MovementReason.IN_REFUND.getKey() : MovementReason.OUT_SALE.getKey(),location,ticket.getLine(i).getProductID(),new Double(ticket.getLine(i).getMultiply()),new Double(ticket.getLine(i).getPrice())});
        }
      }
      for (      PaymentInfo p : ticket.getPayments()) {
        if ("String_Node_Str".equals(p.getName()) || "String_Node_Str".equals(p.getName())) {
          ticket.getCustomer().updateCurDebt(-p.getTotal(),ticket.getDate());
          getDebtUpdate().exec(new DataParams(){
            public void writeValues() throws BasicException {
              setDouble(1,ticket.getCustomer().getCurdebt());
              setTimestamp(2,ticket.getCustomer().getCurdate());
              setString(3,ticket.getCustomer().getId());
            }
          }
);
        }
      }
      new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
      new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
      new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
      new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
      return null;
    }
  }
;
  t.execute();
}
Program: 6095
Project: 6095
Buggy source:
public void writeValues() throws BasicException {
  setString(1,UUID.randomUUID().toString());
  setString(2,ticket.getId());
  setString(3,tickettax.getTaxInfo().getId());
  setDouble(4,tickettax.getSubTotal());
  setDouble(5,tickettax.getTax());
}

Fixed version (ground truth):
public void writeValues() throws BasicException {
  setDouble(1,ticket.getCustomer().getCurdebt());
  setTimestamp(2,ticket.getCustomer().getCurdate());
  setString(3,ticket.getCustomer().getId());
}
Program: 6096
Project: 6096
Buggy source:
public final SentenceExec getDebtUpdate(){
  return new PreparedSentence(s,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",new SerializerWriteBasicExt(new Datas[]{Datas.STRING,Datas.DOUBLE,Datas.TIMESTAMP},new int[]{1,1,1,2,0}));
}

Fixed version (ground truth):
public final SentenceExec getDebtUpdate(){
  return new PreparedSentence(s,"String_Node_Str",SerializerWriteParams.INSTANCE);
}
Program: 6098
Project: 6098
Buggy source:
public Object transact() throws BasicException {
  Date d=new Date();
  for (int i=0; i < ticket.getLinesCount(); i++) {
    if (ticket.getLine(i).getProductID() != null) {
      getStockDiaryInsert().exec(new Object[]{UUID.randomUUID().toString(),d,ticket.getLine(i).getMultiply() >= 0.0 ? MovementReason.IN_REFUND.getKey() : MovementReason.OUT_SALE.getKey(),location,ticket.getLine(i).getProductID(),new Double(ticket.getLine(i).getMultiply()),new Double(ticket.getLine(i).getPrice())});
    }
  }
  for (  PaymentInfo p : ticket.getPayments()) {
    if ("String_Node_Str".equals(p.getName()) || "String_Node_Str".equals(p.getName())) {
      getDebtUpdate().exec(new Object[]{ticket.getCustomer().getId(),new Double(-p.getTotal()),ticket.getDate()});
    }
  }
  new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
  new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
  new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
  new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
  return null;
}

Fixed version (ground truth):
public Object transact() throws BasicException {
  Date d=new Date();
  for (int i=0; i < ticket.getLinesCount(); i++) {
    if (ticket.getLine(i).getProductID() != null) {
      getStockDiaryInsert().exec(new Object[]{UUID.randomUUID().toString(),d,ticket.getLine(i).getMultiply() >= 0.0 ? MovementReason.IN_REFUND.getKey() : MovementReason.OUT_SALE.getKey(),location,ticket.getLine(i).getProductID(),new Double(ticket.getLine(i).getMultiply()),new Double(ticket.getLine(i).getPrice())});
    }
  }
  for (  PaymentInfo p : ticket.getPayments()) {
    if ("String_Node_Str".equals(p.getName()) || "String_Node_Str".equals(p.getName())) {
      ticket.getCustomer().updateCurDebt(-p.getTotal(),ticket.getDate());
      getDebtUpdate().exec(new DataParams(){
        public void writeValues() throws BasicException {
          setDouble(1,ticket.getCustomer().getCurdebt());
          setTimestamp(2,ticket.getCustomer().getCurdate());
          setString(3,ticket.getCustomer().getId());
        }
      }
);
    }
  }
  new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
  new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
  new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
  new StaticSentence(s,"String_Node_Str",SerializerWriteString.INSTANCE).exec(ticket.getId());
  return null;
}
Program: 6099
Project: 6099
Buggy source:
private void paintTicketLine(int index,TicketLineInfo oLine){
  if (executeEventAndRefresh("String_Node_Str",new ScriptArg("String_Node_Str",index),new ScriptArg("String_Node_Str",oLine)) == null) {
    m_ticketlines.setTicketLine(index,oLine);
    m_ticketlines.setSelectedIndex(index);
    visorTicketLine(oLine);
    printPartialTotals();
    stateToZero();
    executeEventAndRefresh("String_Node_Str");
  }
}

Fixed version (ground truth):
private void paintTicketLine(int index,TicketLineInfo oLine){
  if (executeEventAndRefresh("String_Node_Str",new ScriptArg("String_Node_Str",index),new ScriptArg("String_Node_Str",oLine)) == null) {
    m_oTicket.setLine(index,oLine);
    m_ticketlines.setTicketLine(index,oLine);
    m_ticketlines.setSelectedIndex(index);
    visorTicketLine(oLine);
    printPartialTotals();
    stateToZero();
    executeEventAndRefresh("String_Node_Str");
  }
}
Program: 6100
Project: 6100
Buggy source:
public void printLine(String sproduct,double dprice,double dunits){
  try {
    m_fiscal.printRecItem(sproduct,(int)(dprice * dunits * 10000.0),0,0,(int)(dprice * 10000.0),"String_Node_Str");
  }
 catch (  JposException e) {
  }
}

Fixed version (ground truth):
public void printLine(String sproduct,double dprice,double dunits){
  try {
    m_fiscal.printRecItem(sproduct,roundFiscal(dprice * dunits),0,0,roundFiscal(dprice),"String_Node_Str");
  }
 catch (  JposException e) {
  }
}
Program: 6101
Project: 6101
Buggy source:
public void printTotal(String sPayment,double dpaid){
  try {
    m_fiscal.printRecTotal(0,(int)(dpaid * 10000),sPayment);
  }
 catch (  JposException e) {
  }
}

Fixed version (ground truth):
public void printTotal(String sPayment,double dpaid){
  try {
    m_fiscal.printRecTotal(0,roundFiscal(dpaid),sPayment);
  }
 catch (  JposException e) {
  }
}
Program: 6103
Project: 6103
Buggy source:
private void m_jEditLineActionPerformed(java.awt.event.ActionEvent evt){
  int i=m_ticketlines.getSelectedIndex();
  if (i < 0) {
    Toolkit.getDefaultToolkit().beep();
  }
 else {
    TicketLineInfo oLine=m_oTicket.getLine(i);
    if (JProductLineEdit.showMessage(this,m_App,m_oTicket.getLine(i))) {
      paintTicketLine(i,oLine);
    }
  }
}

Fixed version (ground truth):
private void m_jEditLineActionPerformed(java.awt.event.ActionEvent evt){
  int i=m_ticketlines.getSelectedIndex();
  if (i < 0) {
    Toolkit.getDefaultToolkit().beep();
  }
 else {
    TicketLineInfo newline=JProductLineEdit.showMessage(this,m_App,m_oTicket.getLine(i));
    if (newline != null) {
      paintTicketLine(i,newline);
    }
  }
}
Program: 6104
Project: 6104
Buggy source:
private boolean init(AppView app,TicketLineInfo oLine){
  initComponents();
  m_oLineTicket=oLine;
  m_oLine=new TicketLineInfo(oLine);
  m_bunitsok=true;
  m_bpriceok=true;
  m_jName.setEnabled(m_oLine.getProductID() == null && app.getAppUserView().getUser().hasPermission("String_Node_Str"));
  m_jPrice.setEnabled(app.getAppUserView().getUser().hasPermission("String_Node_Str"));
  m_jPriceTax.setEnabled(app.getAppUserView().getUser().hasPermission("String_Node_Str"));
  m_jName.setText(m_oLine.getProperty("String_Node_Str"));
  m_jUnits.setValue(oLine.getMultiply());
  m_jPrice.setValue(oLine.getPrice());
  m_jPriceTax.setValue(oLine.getPriceTax());
  m_jTaxrate.setText(oLine.getTaxInfo().getName());
  m_jName.addPropertyChangeListener("String_Node_Str",new RecalculateName());
  m_jUnits.addPropertyChangeListener("String_Node_Str",new RecalculateUnits());
  m_jPrice.addPropertyChangeListener("String_Node_Str",new RecalculatePrice());
  m_jPriceTax.addPropertyChangeListener("String_Node_Str",new RecalculatePriceTax());
  m_jName.addEditorKeys(m_jKeys);
  m_jUnits.addEditorKeys(m_jKeys);
  m_jPrice.addEditorKeys(m_jKeys);
  m_jPriceTax.addEditorKeys(m_jKeys);
  if (m_jName.isEnabled()) {
    m_jName.activate();
  }
 else {
    m_jUnits.activate();
  }
  printTotals();
  getRootPane().setDefaultButton(m_jButtonOK);
  m_bok=false;
  setVisible(true);
  return m_bok;
}

Fixed version (ground truth):
private TicketLineInfo init(AppView app,TicketLineInfo oLine){
  initComponents();
  m_oLine=new TicketLineInfo(oLine);
  m_bunitsok=true;
  m_bpriceok=true;
  m_jName.setEnabled(m_oLine.getProductID() == null && app.getAppUserView().getUser().hasPermission("String_Node_Str"));
  m_jPrice.setEnabled(app.getAppUserView().getUser().hasPermission("String_Node_Str"));
  m_jPriceTax.setEnabled(app.getAppUserView().getUser().hasPermission("String_Node_Str"));
  m_jName.setText(m_oLine.getProperty("String_Node_Str"));
  m_jUnits.setValue(oLine.getMultiply());
  m_jPrice.setValue(oLine.getPrice());
  m_jPriceTax.setValue(oLine.getPriceTax());
  m_jTaxrate.setText(oLine.getTaxInfo().getName());
  m_jName.addPropertyChangeListener("String_Node_Str",new RecalculateName());
  m_jUnits.addPropertyChangeListener("String_Node_Str",new RecalculateUnits());
  m_jPrice.addPropertyChangeListener("String_Node_Str",new RecalculatePrice());
  m_jPriceTax.addPropertyChangeListener("String_Node_Str",new RecalculatePriceTax());
  m_jName.addEditorKeys(m_jKeys);
  m_jUnits.addEditorKeys(m_jKeys);
  m_jPrice.addEditorKeys(m_jKeys);
  m_jPriceTax.addEditorKeys(m_jKeys);
  if (m_jName.isEnabled()) {
    m_jName.activate();
  }
 else {
    m_jUnits.activate();
  }
  printTotals();
  getRootPane().setDefaultButton(m_jButtonOK);
  returnLine=null;
  setVisible(true);
  return returnLine;
}