Program: 181354
Project: 181354
Buggy source:
/** 
 * Populates the database map of values with the appropriate RRULE, RDATE, EXRULE, and EXDATE values extracted from the parsed iCalendar component.
 * @param component The iCalendar component containing the desiredrecurrence specification.
 * @param values The db values that should be updated.
 * @return true if the component contained the necessary informationto specify a recurrence.  The required fields are DTSTART, one of DTEND/DURATION, and one of RRULE/RDATE.  Returns false if there was an error, including if the date is out of range.
 */
public static boolean populateContentValues(ICalendar.Component component,ContentValues values){
  ICalendar.Property dtstartProperty=component.getFirstProperty("String_Node_Str");
  String dtstart=dtstartProperty.getValue();
  ICalendar.Parameter tzidParam=dtstartProperty.getFirstParameter("String_Node_Str");
  String tzid=tzidParam == null ? null : tzidParam.value;
  Time start=new Time(tzidParam == null ? Time.TIMEZONE_UTC : tzid);
  boolean inUtc=start.parse(dtstart);
  boolean allDay=start.allDay;
  if (inUtc) {
    tzid=Time.TIMEZONE_UTC;
  }
  String duration=computeDuration(start,component);
  String rrule=flattenProperties(component,"String_Node_Str");
  String rdate=extractDates(component.getFirstProperty("String_Node_Str"));
  String exrule=flattenProperties(component,"String_Node_Str");
  String exdate=extractDates(component.getFirstProperty("String_Node_Str"));
  if ((TextUtils.isEmpty(dtstart)) || (TextUtils.isEmpty(duration)) || ((TextUtils.isEmpty(rrule)) && (TextUtils.isEmpty(rdate)))) {
    if (Config.LOGD) {
      Log.d(TAG,"String_Node_Str" + "String_Node_Str" + component.toString());
    }
    return false;
  }
  if (allDay) {
    start.timezone=Time.TIMEZONE_UTC;
  }
  long millis=start.toMillis(false);
  values.put(Calendar.Events.DTSTART,millis);
  if (millis == -1) {
    if (Config.LOGD) {
      Log.d(TAG,"String_Node_Str" + component.toString());
    }
    return false;
  }
  values.put(Calendar.Events.RRULE,rrule);
  values.put(Calendar.Events.RDATE,rdate);
  values.put(Calendar.Events.EXRULE,exrule);
  values.put(Calendar.Events.EXDATE,exdate);
  values.put(Calendar.Events.EVENT_TIMEZONE,tzid);
  values.put(Calendar.Events.DURATION,duration);
  values.put(Calendar.Events.ALL_DAY,allDay ? 1 : 0);
  return true;
}

Fixed version (ground truth):
/** 
 * Populates the database map of values with the appropriate RRULE, RDATE, EXRULE, and EXDATE values extracted from the parsed iCalendar component.
 * @param component The iCalendar component containing the desiredrecurrence specification.
 * @param values The db values that should be updated.
 * @return true if the component contained the necessary informationto specify a recurrence.  The required fields are DTSTART, one of DTEND/DURATION, and one of RRULE/RDATE.  Returns false if there was an error, including if the date is out of range.
 */
public static boolean populateContentValues(ICalendar.Component component,ContentValues values){
  ICalendar.Property dtstartProperty=component.getFirstProperty("String_Node_Str");
  String dtstart=dtstartProperty.getValue();
  ICalendar.Parameter tzidParam=dtstartProperty.getFirstParameter("String_Node_Str");
  String tzid=tzidParam == null ? null : tzidParam.value;
  Time start=new Time(tzidParam == null ? Time.TIMEZONE_UTC : tzid);
  boolean inUtc=start.parse(dtstart);
  boolean allDay=start.allDay;
  if (inUtc || allDay) {
    tzid=Time.TIMEZONE_UTC;
  }
  String duration=computeDuration(start,component);
  String rrule=flattenProperties(component,"String_Node_Str");
  String rdate=extractDates(component.getFirstProperty("String_Node_Str"));
  String exrule=flattenProperties(component,"String_Node_Str");
  String exdate=extractDates(component.getFirstProperty("String_Node_Str"));
  if ((TextUtils.isEmpty(dtstart)) || (TextUtils.isEmpty(duration)) || ((TextUtils.isEmpty(rrule)) && (TextUtils.isEmpty(rdate)))) {
    if (Config.LOGD) {
      Log.d(TAG,"String_Node_Str" + "String_Node_Str" + component.toString());
    }
    return false;
  }
  if (allDay) {
    start.timezone=Time.TIMEZONE_UTC;
  }
  long millis=start.toMillis(false);
  values.put(Calendar.Events.DTSTART,millis);
  if (millis == -1) {
    if (Config.LOGD) {
      Log.d(TAG,"String_Node_Str" + component.toString());
    }
    return false;
  }
  values.put(Calendar.Events.RRULE,rrule);
  values.put(Calendar.Events.RDATE,rdate);
  values.put(Calendar.Events.EXRULE,exrule);
  values.put(Calendar.Events.EXDATE,exdate);
  values.put(Calendar.Events.EVENT_TIMEZONE,tzid);
  values.put(Calendar.Events.DURATION,duration);
  values.put(Calendar.Events.ALL_DAY,allDay ? 1 : 0);
  return true;
}