Program: 92245
Project: 92245
Buggy source:
private void fillValues(Point pt,TimeGraphControl threadStates,ITimeGraphEntry entry){
  if (entry == null) {
    return;
  }
  if (entry.hasTimeEvents()) {
    ITimeEvent threadEvent=Utils.findEvent(entry,threadStates.getTimeAtX(pt.x),2);
    ITimeEvent nextEvent=Utils.findEvent(entry,threadStates.getTimeAtX(pt.x),1);
    addItem(_utilImp.getStateTypeName(),entry.getName());
    if (threadEvent == null) {
      return;
    }
    String state=_utilImp.getEventName(threadEvent);
    if (state != null) {
      addItem(Messages.TmfTimeTipHandler_TRACE_STATE,state);
    }
    Map<String,String> eventAddOns=_utilImp.getEventHoverToolTipInfo(threadEvent);
    if (eventAddOns != null) {
      for (Iterator<String> iter=eventAddOns.keySet().iterator(); iter.hasNext(); ) {
        String message=iter.next();
        addItem(message,eventAddOns.get(message));
      }
    }
    long eventStartTime=-1;
    long eventDuration=-1;
    long eventEndTime=-1;
    eventStartTime=threadEvent.getTime();
    eventDuration=threadEvent.getDuration();
    if (eventDuration < 0 && nextEvent != null) {
      eventEndTime=nextEvent.getTime();
      eventDuration=eventEndTime - eventStartTime;
    }
 else {
      eventEndTime=eventStartTime + eventDuration;
    }
    Resolution res=Resolution.NANOSEC;
    if (_timeDataProvider.isCalendarFormat()) {
      addItem(Messages.TmfTimeTipHandler_TRACE_DATE,eventStartTime > -1 ? Utils.formatDate(eventStartTime) : "String_Node_Str");
      if (eventDuration > 0) {
        addItem(Messages.TmfTimeTipHandler_TRACE_START_TIME,eventStartTime > -1 ? Utils.formatTime(eventStartTime,TimeFormat.ABSOLUTE,res) : "String_Node_Str");
        addItem(Messages.TmfTimeTipHandler_TRACE_STOP_TIME,eventEndTime > -1 ? Utils.formatTime(eventEndTime,TimeFormat.ABSOLUTE,res) : "String_Node_Str");
      }
 else {
        addItem(Messages.TmfTimeTipHandler_TRACE_EVENT_TIME,eventStartTime > -1 ? Utils.formatTime(eventStartTime,TimeFormat.ABSOLUTE,res) : "String_Node_Str");
      }
    }
 else {
      if (eventDuration > 0) {
        addItem(Messages.TmfTimeTipHandler_TRACE_START_TIME,eventStartTime > -1 ? Utils.formatTime(eventStartTime,TimeFormat.RELATIVE,res) : "String_Node_Str");
        addItem(Messages.TmfTimeTipHandler_TRACE_STOP_TIME,eventEndTime > -1 ? Utils.formatTime(eventEndTime,TimeFormat.RELATIVE,res) : "String_Node_Str");
      }
 else {
        addItem(Messages.TmfTimeTipHandler_TRACE_EVENT_TIME,eventStartTime > -1 ? Utils.formatTime(eventStartTime,TimeFormat.RELATIVE,res) : "String_Node_Str");
      }
    }
    if (eventDuration > 0) {
      addItem(Messages.TmfTimeTipHandler_DURATION,eventDuration > -1 ? Utils.formatTime(eventDuration,TimeFormat.RELATIVE,res) : "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void fillValues(Point pt,TimeGraphControl timeGraphControl,ITimeGraphEntry entry){
  if (entry == null) {
    return;
  }
  if (entry.hasTimeEvents()) {
    long currPixelTime=timeGraphControl.getTimeAtX(pt.x);
    long nextPixelTime=timeGraphControl.getTimeAtX(pt.x + 1);
    if (nextPixelTime == currPixelTime) {
      nextPixelTime++;
    }
    ITimeEvent currEvent=Utils.findEvent(entry,currPixelTime,0);
    ITimeEvent nextEvent=Utils.findEvent(entry,currPixelTime,1);
    if (currEvent == null || currEvent.getTime() < currPixelTime) {
      if (nextEvent != null && nextEvent.getTime() < nextPixelTime) {
        currEvent=nextEvent;
      }
    }
    addItem(_utilImp.getStateTypeName(),entry.getName());
    if (currEvent == null) {
      return;
    }
    String state=_utilImp.getEventName(currEvent);
    if (state != null) {
      addItem(Messages.TmfTimeTipHandler_TRACE_STATE,state);
    }
    Map<String,String> eventAddOns=_utilImp.getEventHoverToolTipInfo(currEvent);
    if (eventAddOns != null) {
      for (Iterator<String> iter=eventAddOns.keySet().iterator(); iter.hasNext(); ) {
        String message=iter.next();
        addItem(message,eventAddOns.get(message));
      }
    }
    long eventStartTime=-1;
    long eventDuration=-1;
    long eventEndTime=-1;
    eventStartTime=currEvent.getTime();
    eventDuration=currEvent.getDuration();
    if (eventDuration < 0 && nextEvent != null) {
      eventEndTime=nextEvent.getTime();
      eventDuration=eventEndTime - eventStartTime;
    }
 else {
      eventEndTime=eventStartTime + eventDuration;
    }
    Resolution res=Resolution.NANOSEC;
    if (_timeDataProvider.isCalendarFormat()) {
      addItem(Messages.TmfTimeTipHandler_TRACE_DATE,eventStartTime > -1 ? Utils.formatDate(eventStartTime) : "String_Node_Str");
      if (eventDuration > 0) {
        addItem(Messages.TmfTimeTipHandler_TRACE_START_TIME,eventStartTime > -1 ? Utils.formatTime(eventStartTime,TimeFormat.ABSOLUTE,res) : "String_Node_Str");
        addItem(Messages.TmfTimeTipHandler_TRACE_STOP_TIME,eventEndTime > -1 ? Utils.formatTime(eventEndTime,TimeFormat.ABSOLUTE,res) : "String_Node_Str");
      }
 else {
        addItem(Messages.TmfTimeTipHandler_TRACE_EVENT_TIME,eventStartTime > -1 ? Utils.formatTime(eventStartTime,TimeFormat.ABSOLUTE,res) : "String_Node_Str");
      }
    }
 else {
      if (eventDuration > 0) {
        addItem(Messages.TmfTimeTipHandler_TRACE_START_TIME,eventStartTime > -1 ? Utils.formatTime(eventStartTime,TimeFormat.RELATIVE,res) : "String_Node_Str");
        addItem(Messages.TmfTimeTipHandler_TRACE_STOP_TIME,eventEndTime > -1 ? Utils.formatTime(eventEndTime,TimeFormat.RELATIVE,res) : "String_Node_Str");
      }
 else {
        addItem(Messages.TmfTimeTipHandler_TRACE_EVENT_TIME,eventStartTime > -1 ? Utils.formatTime(eventStartTime,TimeFormat.RELATIVE,res) : "String_Node_Str");
      }
    }
    if (eventDuration > 0) {
      addItem(Messages.TmfTimeTipHandler_DURATION,eventDuration > -1 ? Utils.formatTime(eventDuration,TimeFormat.RELATIVE,res) : "String_Node_Str");
    }
  }
}