Program: 178310
Project: 178310
Buggy source:
public PlanSummary process(ArrayList<Chargeable> data){
  PlanSummary ret=new PlanSummary(this);
  ret.addPlanCall(new PlanChargeable(new ChargeableMessage(ChargeableMessage.MESSAGE_MONTH_FEE),monthFee,this.getCurrency()));
  long secondsTotal=0;
  int smsSent=0;
  for (  Chargeable chargeable : data) {
    if (chargeable.getChargeableType() == Chargeable.CHARGEABLE_TYPE_CALL) {
      Call call=(Call)chargeable;
      if (call.getType() != Call.CALL_TYPE_SENT) {
        continue;
      }
      double callPrice=0;
      if (call.getContact().getMsisdnType() == MsisdnType.ES_SPECIAL_ZER0) {
        callPrice=0;
      }
 else {
        int dayOfWeek=call.getDate().get(Calendar.DAY_OF_WEEK);
        int hourOfDay=call.getDate().get(Calendar.HOUR_OF_DAY);
        boolean discount=(dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY || hourOfDay < 8 || hourOfDay >= 18);
        if (discount) {
          secondsTotal+=call.getDuration();
          discount=secondsTotal <= maxSecondsMonth;
        }
        if (!discount) {
          long duration=(secondsTotal > maxSecondsMonth) && (secondsTotal - call.getDuration() <= maxSecondsMonth) ? secondsTotal - maxSecondsMonth : call.getDuration();
          callPrice+=initialPrice + (duration * pricePerSecond);
        }
      }
      ret.addPlanCall(new PlanChargeable(call,callPrice,this.getCurrency()));
    }
 else     if (chargeable.getChargeableType() == Chargeable.CHARGEABLE_TYPE_SMS) {
      Sms sms=(Sms)chargeable;
      if (sms.getType() == Sms.SMS_TYPE_RECEIVED) {
        continue;
      }
      smsSent++;
      ret.addPlanCall(new PlanChargeable(chargeable,(smsSent > maxFreeSMS) ? smsPrice : 0,this.getCurrency()));
    }
  }
  return ret;
}

Fixed version (ground truth):
public PlanSummary process(ArrayList<Chargeable> data){
  PlanSummary ret=new PlanSummary(this);
  ret.addPlanCall(new PlanChargeable(new ChargeableMessage(ChargeableMessage.MESSAGE_MONTH_FEE),monthFee,this.getCurrency()));
  long secondsTotal=0;
  int smsSent=0;
  for (  Chargeable chargeable : data) {
    if (chargeable.getChargeableType() == Chargeable.CHARGEABLE_TYPE_CALL) {
      Call call=(Call)chargeable;
      if (call.getType() != Call.CALL_TYPE_SENT) {
        continue;
      }
      double callPrice=0;
      if (call.getContact().getMsisdnType() == MsisdnType.ES_SPECIAL_ZER0) {
        callPrice=0;
      }
 else {
        secondsTotal+=call.getDuration();
        if (secondsTotal > maxSecondsMonth) {
          long duration=(secondsTotal > maxSecondsMonth) && (secondsTotal - call.getDuration() <= maxSecondsMonth) ? secondsTotal - maxSecondsMonth : call.getDuration();
          callPrice+=initialPrice + (duration * pricePerSecond);
        }
      }
      ret.addPlanCall(new PlanChargeable(call,callPrice,this.getCurrency()));
    }
 else     if (chargeable.getChargeableType() == Chargeable.CHARGEABLE_TYPE_SMS) {
      Sms sms=(Sms)chargeable;
      if (sms.getType() == Sms.SMS_TYPE_RECEIVED) {
        continue;
      }
      smsSent++;
      ret.addPlanCall(new PlanChargeable(chargeable,(smsSent > maxFreeSMS) ? smsPrice : 0,this.getCurrency()));
    }
  }
  return ret;
}