Program: 92085
Project: 92085
Buggy source:
/** 
 * Callback for the mouse-over tooltip
 * @param control The control object to use
 */
public void activateHoverHelp(final Control control){
  control.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      if (_tipShell != null && !_tipShell.isDisposed()) {
        _tipShell.dispose();
      }
    }
  }
);
  control.addMouseMoveListener(new MouseMoveListener(){
    @Override public void mouseMove(    MouseEvent e){
      if (_tipShell != null && !_tipShell.isDisposed()) {
        _tipShell.dispose();
      }
    }
  }
);
  control.addMouseTrackListener(new MouseTrackAdapter(){
    @Override public void mouseExit(    MouseEvent e){
      if (_tipShell != null && !_tipShell.isDisposed()) {
        Point pt=control.toDisplay(e.x,e.y);
        if (!_tipShell.getBounds().contains(pt)) {
          _tipShell.dispose();
        }
      }
    }
    private void addItem(    String name,    String value){
      Label nameLabel=new Label(_tipComposite,SWT.NO_FOCUS);
      nameLabel.setText(name);
      setupControl(nameLabel);
      Label separator=new Label(_tipComposite,SWT.NO_FOCUS | SWT.SEPARATOR | SWT.VERTICAL);
      GridData gd=new GridData(SWT.CENTER,SWT.CENTER,false,false);
      gd.heightHint=nameLabel.computeSize(SWT.DEFAULT,SWT.DEFAULT).y;
      separator.setLayoutData(gd);
      setupControl(separator);
      Label valueLabel=new Label(_tipComposite,SWT.NO_FOCUS);
      valueLabel.setText(value);
      setupControl(valueLabel);
    }
    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;
            currPixelTime=nextEvent.getTime();
          }
        }
        String stateTypeName=_utilImp.getStateTypeName(entry);
        String entryName=entry.getName();
        if (stateTypeName == null) {
          stateTypeName=_utilImp.getStateTypeName();
        }
        if (!entryName.isEmpty()) {
          addItem(stateTypeName,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,currPixelTime);
        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;
        TimeFormat tf=_timeDataProvider.getTimeFormat();
        if (tf == TimeFormat.CALENDAR) {
          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,tf,res) : "String_Node_Str");
          addItem(Messages.TmfTimeTipHandler_TRACE_STOP_TIME,eventEndTime > -1 ? Utils.formatTime(eventEndTime,tf,res) : "String_Node_Str");
        }
 else {
          addItem(Messages.TmfTimeTipHandler_TRACE_EVENT_TIME,eventStartTime > -1 ? Utils.formatTime(eventStartTime,tf,res) : "String_Node_Str");
        }
        if (eventDuration > 0) {
          if (tf == TimeFormat.CALENDAR) {
            tf=TimeFormat.RELATIVE;
          }
          addItem(Messages.TmfTimeTipHandler_DURATION,eventDuration > -1 ? Utils.formatTime(eventDuration,tf,res) : "String_Node_Str");
        }
      }
    }
    @Override public void mouseHover(    MouseEvent event){
      if ((event.stateMask & SWT.BUTTON_MASK) != 0) {
        return;
      }
      Point pt=new Point(event.x,event.y);
      TimeGraphControl timeGraphControl=(TimeGraphControl)event.widget;
      createTooltipShell(timeGraphControl.getShell());
      ITimeGraphEntry entry=timeGraphControl.getEntry(pt);
      for (      Control child : _tipComposite.getChildren()) {
        child.dispose();
      }
      fillValues(pt,timeGraphControl,entry);
      if (_tipComposite.getChildren().length == 0) {
        return;
      }
      _tipShell.pack();
      _tipPosition=control.toDisplay(pt);
      _tipShell.pack();
      setHoverLocation(_tipShell,_tipPosition);
      _tipShell.setVisible(true);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Callback for the mouse-over tooltip
 * @param control The control object to use
 */
public void activateHoverHelp(final Control control){
  control.addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      if (_tipShell != null && !_tipShell.isDisposed()) {
        _tipShell.dispose();
      }
    }
  }
);
  control.addMouseMoveListener(new MouseMoveListener(){
    @Override public void mouseMove(    MouseEvent e){
      if (_tipShell != null && !_tipShell.isDisposed()) {
        _tipShell.dispose();
      }
    }
  }
);
  control.addMouseTrackListener(new MouseTrackAdapter(){
    @Override public void mouseExit(    MouseEvent e){
      if (_tipShell != null && !_tipShell.isDisposed()) {
        Point pt=control.toDisplay(e.x,e.y);
        if (!_tipShell.getBounds().contains(pt)) {
          _tipShell.dispose();
        }
      }
    }
    private void addItem(    String name,    String value){
      Label nameLabel=new Label(_tipComposite,SWT.NO_FOCUS);
      nameLabel.setText(name);
      setupControl(nameLabel);
      Label separator=new Label(_tipComposite,SWT.NO_FOCUS | SWT.SEPARATOR | SWT.VERTICAL);
      GridData gd=new GridData(SWT.CENTER,SWT.CENTER,false,false);
      gd.heightHint=nameLabel.computeSize(SWT.DEFAULT,SWT.DEFAULT).y;
      separator.setLayoutData(gd);
      setupControl(separator);
      Label valueLabel=new Label(_tipComposite,SWT.NO_FOCUS);
      valueLabel.setText(value);
      setupControl(valueLabel);
    }
    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;
            currPixelTime=nextEvent.getTime();
          }
        }
        String stateTypeName=_utilImp.getStateTypeName(entry);
        String entryName=entry.getName();
        if (stateTypeName == null) {
          stateTypeName=_utilImp.getStateTypeName();
        }
        if (!entryName.isEmpty()) {
          addItem(stateTypeName,entry.getName());
        }
        if (currEvent == null || currEvent instanceof NullTimeEvent) {
          return;
        }
        String state=_utilImp.getEventName(currEvent);
        if (state != null) {
          addItem(Messages.TmfTimeTipHandler_TRACE_STATE,state);
        }
        Map<String,String> eventAddOns=_utilImp.getEventHoverToolTipInfo(currEvent,currPixelTime);
        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;
        TimeFormat tf=_timeDataProvider.getTimeFormat();
        if (tf == TimeFormat.CALENDAR) {
          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,tf,res) : "String_Node_Str");
          addItem(Messages.TmfTimeTipHandler_TRACE_STOP_TIME,eventEndTime > -1 ? Utils.formatTime(eventEndTime,tf,res) : "String_Node_Str");
        }
 else {
          addItem(Messages.TmfTimeTipHandler_TRACE_EVENT_TIME,eventStartTime > -1 ? Utils.formatTime(eventStartTime,tf,res) : "String_Node_Str");
        }
        if (eventDuration > 0) {
          if (tf == TimeFormat.CALENDAR) {
            tf=TimeFormat.RELATIVE;
          }
          addItem(Messages.TmfTimeTipHandler_DURATION,eventDuration > -1 ? Utils.formatTime(eventDuration,tf,res) : "String_Node_Str");
        }
      }
    }
    @Override public void mouseHover(    MouseEvent event){
      if ((event.stateMask & SWT.BUTTON_MASK) != 0) {
        return;
      }
      Point pt=new Point(event.x,event.y);
      TimeGraphControl timeGraphControl=(TimeGraphControl)event.widget;
      createTooltipShell(timeGraphControl.getShell());
      ITimeGraphEntry entry=timeGraphControl.getEntry(pt);
      for (      Control child : _tipComposite.getChildren()) {
        child.dispose();
      }
      fillValues(pt,timeGraphControl,entry);
      if (_tipComposite.getChildren().length == 0) {
        return;
      }
      _tipShell.pack();
      _tipPosition=control.toDisplay(pt);
      _tipShell.pack();
      setHoverLocation(_tipShell,_tipPosition);
      _tipShell.setVisible(true);
    }
  }
);
}