Program: 5969
Project: 5969
Buggy source:
public void execute(PaymentInfoMagcard payinfo){
  StringBuffer sb=new StringBuffer();
  try {
    sb.append("String_Node_Str");
    sb.append(m_sCommerceID);
    sb.append("String_Node_Str");
    sb.append(m_sCommercePassword);
    sb.append("String_Node_Str");
    NumberFormat formatter=new DecimalFormat("String_Node_Str");
    String amount=formatter.format(Math.abs(payinfo.getTotal()));
    sb.append(URLEncoder.encode(amount.replace(',','.'),"String_Node_Str"));
    sb.append("String_Node_Str");
    sb.append(getCardType(payinfo.getCardNumber()));
    sb.append("String_Node_Str");
    sb.append(URLEncoder.encode(payinfo.getCardNumber(),"String_Node_Str"));
    sb.append("String_Node_Str");
    String tmp=payinfo.getExpirationDate();
    sb.append(tmp.substring(0,2));
    sb.append("String_Node_Str");
    sb.append(tmp.substring(2,tmp.length()));
    String[] cc_name=payinfo.getHolderName().split("String_Node_Str");
    sb.append("String_Node_Str");
    if (cc_name.length > 0) {
      sb.append(URLEncoder.encode(cc_name[0],"String_Node_Str"));
    }
    sb.append("String_Node_Str");
    if (cc_name.length > 1) {
      sb.append(URLEncoder.encode(cc_name[1],"String_Node_Str"));
    }
    sb.append("String_Node_Str");
    sb.append(payinfo.getHolderName());
    if (payinfo.getTotal() >= 0.0) {
      sb.append("String_Node_Str");
      sb.append(SALE);
    }
 else {
      sb.append("String_Node_Str");
      sb.append(REFUND);
    }
    sb.append("String_Node_Str");
    URL url=new URL(ENDPOINTADDRESS);
    URLConnection connection=url.openConnection();
    connection.setDoOutput(true);
    connection.setUseCaches(false);
    connection.setRequestProperty("String_Node_Str","String_Node_Str");
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(sb.toString().getBytes());
    out.flush();
    out.close();
    BufferedReader in=new BufferedReader(new InputStreamReader(connection.getInputStream()));
    String returned="String_Node_Str", aux;
    while ((aux=in.readLine()) != null) {
      returned+="String_Node_Str" + aux;
    }
    payinfo.setReturnMessage(returned);
    in.close();
    Map props=new HashMap();
    StringTokenizer tk=new java.util.StringTokenizer(returned,"String_Node_Str");
    while (tk.hasMoreTokens()) {
      String sToken=tk.nextToken();
      int i=sToken.indexOf('=');
      if (i >= 0) {
        props.put(URLDecoder.decode(sToken.substring(0,i),"String_Node_Str"),URLDecoder.decode(sToken.substring(i + 1),"String_Node_Str"));
      }
 else {
        props.put(URLDecoder.decode(sToken,"String_Node_Str"),null);
      }
    }
    if (APPROVED.equals(props.get("String_Node_Str"))) {
      payinfo.paymentOK((String)props.get("String_Node_Str"),(String)props.get("String_Node_Str"),returned);
    }
 else {
      String sCode=(String)props.get("String_Node_Str");
      sCode=sCode.replace("String_Node_Str","String_Node_Str");
      sCode=sCode.replace("String_Node_Str","String_Node_Str");
      sCode=sCode.replace("String_Node_Str","String_Node_Str");
      sCode=sCode.replace("String_Node_Str","String_Node_Str");
      sCode=sCode.replace("String_Node_Str","String_Node_Str");
      payinfo.paymentError(AppLocal.getIntString("String_Node_Str"),sCode);
    }
  }
 catch (  UnsupportedEncodingException eUE) {
    payinfo.paymentError(AppLocal.getIntString("String_Node_Str"),eUE.getMessage());
  }
catch (  MalformedURLException eMURL) {
    payinfo.paymentError(AppLocal.getIntString("String_Node_Str"),eMURL.getMessage());
  }
catch (  IOException e) {
    payinfo.paymentError(AppLocal.getIntString("String_Node_Str"),e.getMessage());
  }
}

Fixed version (ground truth):
public void execute(PaymentInfoMagcard payinfo){
  StringBuffer sb=new StringBuffer();
  try {
    sb.append("String_Node_Str");
    sb.append(m_sCommerceID);
    sb.append("String_Node_Str");
    sb.append(m_sCommercePassword);
    sb.append("String_Node_Str");
    NumberFormat formatter=new DecimalFormat("String_Node_Str");
    String amount=formatter.format(Math.abs(payinfo.getTotal()));
    sb.append(URLEncoder.encode(amount.replace(',','.'),"String_Node_Str"));
    sb.append("String_Node_Str");
    sb.append(getCardType(payinfo.getCardNumber()));
    sb.append("String_Node_Str");
    sb.append(URLEncoder.encode(payinfo.getCardNumber(),"String_Node_Str"));
    sb.append("String_Node_Str");
    String tmp=payinfo.getExpirationDate();
    sb.append(tmp.substring(0,2));
    sb.append("String_Node_Str");
    sb.append(tmp.substring(2,tmp.length()));
    String[] cc_name=payinfo.getHolderName().split("String_Node_Str");
    sb.append("String_Node_Str");
    if (cc_name.length > 0) {
      sb.append(URLEncoder.encode(cc_name[0],"String_Node_Str"));
    }
    sb.append("String_Node_Str");
    if (cc_name.length > 1) {
      sb.append(URLEncoder.encode(cc_name[1],"String_Node_Str"));
    }
    sb.append("String_Node_Str");
    sb.append(payinfo.getHolderName());
    if (payinfo.getTrack1(true) != null) {
      sb.append("String_Node_Str");
      sb.append(URLEncoder.encode(payinfo.getTrack1(true),"String_Node_Str"));
    }
    if (payinfo.getTotal() >= 0.0) {
      sb.append("String_Node_Str");
      sb.append(SALE);
    }
 else {
      sb.append("String_Node_Str");
      sb.append(REFUND);
    }
    sb.append("String_Node_Str");
    URL url=new URL(ENDPOINTADDRESS);
    URLConnection connection=url.openConnection();
    connection.setDoOutput(true);
    connection.setUseCaches(false);
    connection.setRequestProperty("String_Node_Str","String_Node_Str");
    DataOutputStream out=new DataOutputStream(connection.getOutputStream());
    out.write(sb.toString().getBytes());
    out.flush();
    out.close();
    BufferedReader in=new BufferedReader(new InputStreamReader(connection.getInputStream()));
    String returned="String_Node_Str", aux;
    while ((aux=in.readLine()) != null) {
      returned+="String_Node_Str" + aux;
    }
    payinfo.setReturnMessage(returned);
    in.close();
    Map props=new HashMap();
    StringTokenizer tk=new java.util.StringTokenizer(returned,"String_Node_Str");
    while (tk.hasMoreTokens()) {
      String sToken=tk.nextToken();
      int i=sToken.indexOf('=');
      if (i >= 0) {
        props.put(URLDecoder.decode(sToken.substring(0,i),"String_Node_Str"),URLDecoder.decode(sToken.substring(i + 1),"String_Node_Str"));
      }
 else {
        props.put(URLDecoder.decode(sToken,"String_Node_Str"),null);
      }
    }
    if (APPROVED.equals(props.get("String_Node_Str"))) {
      payinfo.paymentOK((String)props.get("String_Node_Str"),(String)props.get("String_Node_Str"),returned);
    }
 else {
      String sCode=(String)props.get("String_Node_Str");
      sCode=sCode.replace("String_Node_Str","String_Node_Str");
      sCode=sCode.replace("String_Node_Str","String_Node_Str");
      sCode=sCode.replace("String_Node_Str","String_Node_Str");
      sCode=sCode.replace("String_Node_Str","String_Node_Str");
      sCode=sCode.replace("String_Node_Str","String_Node_Str");
      payinfo.paymentError(AppLocal.getIntString("String_Node_Str"),sCode);
    }
  }
 catch (  UnsupportedEncodingException eUE) {
    payinfo.paymentError(AppLocal.getIntString("String_Node_Str"),eUE.getMessage());
  }
catch (  MalformedURLException eMURL) {
    payinfo.paymentError(AppLocal.getIntString("String_Node_Str"),eMURL.getMessage());
  }
catch (  IOException e) {
    payinfo.paymentError(AppLocal.getIntString("String_Node_Str"),e.getMessage());
  }
}