Program: 35865
Project: 35865
Buggy source:
protected static ParsedResult mergeResult(String text,ParsedResult dateResult,ParsedResult timeResult){
  ParsedDateComponent beginDate=dateResult.start;
  ParsedDateComponent beginTime=timeResult.start;
  ParsedDateComponent beginDateTime=new ParsedDateComponent(beginDate);
  beginDateTime.assign(Components.Hour,beginTime.get(Components.Hour));
  beginDateTime.assign(Components.Minute,beginTime.get(Components.Minute));
  beginDateTime.assign(Components.Second,beginTime.get(Components.Second));
  dateResult.start=beginDateTime;
  if (dateResult.end != null || timeResult.end != null) {
    ParsedDateComponent endDate=dateResult.end == null ? dateResult.start : dateResult.end;
    ParsedDateComponent endTime=timeResult.end == null ? timeResult.start : timeResult.end;
    ParsedDateComponent endDateTime=new ParsedDateComponent(endDate);
    endDateTime.assign(Components.Hour,endTime.get(Components.Hour));
    endDateTime.assign(Components.Minute,endTime.get(Components.Minute));
    endDateTime.assign(Components.Second,endTime.get(Components.Second));
    dateResult.end=endDateTime;
  }
  int startIndex=Math.min(dateResult.index,timeResult.index);
  int endIndex=Math.max(dateResult.index + dateResult.text.length(),timeResult.index + timeResult.text.length());
  dateResult.index=startIndex;
  dateResult.text=text.substring(startIndex,endIndex);
  return dateResult;
}

Fixed version (ground truth):
protected static ParsedResult mergeResult(String text,ParsedResult dateResult,ParsedResult timeResult){
  ParsedDateComponent beginDate=dateResult.start;
  ParsedDateComponent beginTime=timeResult.start;
  ParsedDateComponent beginDateTime=new ParsedDateComponent(beginDate);
  beginDateTime.assign(Components.Hour,beginTime.get(Components.Hour));
  beginDateTime.assign(Components.Minute,beginTime.get(Components.Minute));
  beginDateTime.assign(Components.Second,beginTime.get(Components.Second));
  if (beginTime.isCertain(Components.Meridiem))   beginDateTime.assign(Components.Meridiem,beginTime.get(Components.Meridiem));
 else   if (beginTime.get(Components.Meridiem) != null)   beginDateTime.imply(Components.Meridiem,beginTime.get(Components.Meridiem));
  dateResult.start=beginDateTime;
  if (dateResult.end != null || timeResult.end != null) {
    ParsedDateComponent endDate=dateResult.end == null ? dateResult.start : dateResult.end;
    ParsedDateComponent endTime=timeResult.end == null ? timeResult.start : timeResult.end;
    ParsedDateComponent endDateTime=new ParsedDateComponent(endDate);
    endDateTime.assign(Components.Hour,endTime.get(Components.Hour));
    endDateTime.assign(Components.Minute,endTime.get(Components.Minute));
    endDateTime.assign(Components.Second,endTime.get(Components.Second));
    if (endTime.isCertain(Components.Meridiem))     endDateTime.assign(Components.Meridiem,endTime.get(Components.Meridiem));
 else     if (beginTime.get(Components.Meridiem) != null)     endDateTime.imply(Components.Meridiem,endTime.get(Components.Meridiem));
    dateResult.end=endDateTime;
  }
  int startIndex=Math.min(dateResult.index,timeResult.index);
  int endIndex=Math.max(dateResult.index + dateResult.text.length(),timeResult.index + timeResult.text.length());
  dateResult.index=startIndex;
  dateResult.text=text.substring(startIndex,endIndex);
  return dateResult;
}