nus-yam/ex-repair huggingface dataset:
Program: 20265
Project: 20265
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: 20266
Project: 20266
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: 20267
Project: 20267
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: 20268
Project: 20268
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: 20270
Project: 20270
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: 20272
Project: 20272
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: 20274
Project: 20274
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: 20275
Project: 20275
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: 20276
Project: 20276
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: 20277
Project: 20277
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: 20278
Project: 20278
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);
}
Program: 20279
Project: 20279
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: 20280
Project: 20280
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: 20281
Project: 20281
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: 20284
Project: 20284
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: 20285
Project: 20285
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: 20286
Project: 20286
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: 20287
Project: 20287
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: 20288
Project: 20288
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: 20289
Project: 20289
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: 20292
Project: 20292
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: 20293
Project: 20293
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: 20294
Project: 20294
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: 20295
Project: 20295
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: 20296
Project: 20296
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: 20297
Project: 20297
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: 20298
Project: 20298
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: 20299
Project: 20299
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: 20300
Project: 20300
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: 20301
Project: 20301
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: 20302
Project: 20302
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: 20303
Project: 20303
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: 20304
Project: 20304
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: 20305
Project: 20305
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: 20306
Project: 20306
Buggy source:
public void endLine(){
  m_ticketcurrent.endLine();
}

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

Fixed version (ground truth):
@Override public String getPrinterDescription(){
  return null;
}
Program: 20308
Project: 20308
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: 20309
Project: 20309
Buggy source:
public JComponent getPrinterComponent(){
  return null;
}

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

Fixed version (ground truth):
@Override public String getPrinterName(){
  return m_sName;
}
Program: 20311
Project: 20311
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: 20312
Project: 20312
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: 20313
Project: 20313
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: 20314
Project: 20314
Buggy source:
public void reset(){
  m_ticketcurrent=null;
}

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

Fixed version (ground truth):
@Override public void beginReceipt(){
  m_ticketcurrent=new BasicTicketForPrinter();
}
Program: 20316
Project: 20316
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: 20317
Project: 20317
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: 20318
Project: 20318
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: 20319
Project: 20319
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: 20320
Project: 20320
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: 20321
Project: 20321
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: 20322
Project: 20322
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: 20323
Project: 20323
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: 20324
Project: 20324
Buggy source:
public void uploadOrders(Order[] orderstoupload) throws RemoteException {
  externalSales.uploadOrders(m_iERPId,m_iERPOrg,m_iERPPos,orderstoupload,m_sERPUser,m_sERPPassword);
}

Fixed version (ground truth):
public boolean uploadOrders(Order[] orderstoupload) throws RemoteException {
  return externalSales.uploadOrders(m_iERPId,m_iERPOrg,m_iERPPos,orderstoupload,m_sERPUser,m_sERPPassword);
}