nus-yam/ex-repair huggingface dataset:
Program: 92228
Project: 92228
Buggy source:
private void sendTimeRangeRequest(long startTime,long endTime){
  if (fTimeRangeRequest != null && !fTimeRangeRequest.isCompleted()) {
    fTimeRangeRequest.cancel();
  }
  TmfTimestamp startTS=new TmfTimestamp(startTime,TIME_SCALE);
  TmfTimestamp endTS=new TmfTimestamp(endTime,TIME_SCALE);
  TmfTimeRange timeRange=new TmfTimeRange(startTS,endTS);
  fTimeRangeHistogram.clear();
  fTimeRangeHistogram.setTimeRange(startTime,endTime - startTime);
  int cacheSize=fCurrentExperiment.getCacheSize();
  fTimeRangeRequest=new HistogramRequest(fTimeRangeHistogram.getDataModel(),timeRange,0,TmfDataRequest.ALL_DATA,cacheSize,ExecutionType.FOREGROUND);
  fCurrentExperiment.sendRequest(fTimeRangeRequest);
}

Fixed version (ground truth):
private void sendTimeRangeRequest(long startTime,long endTime){
  if ((fTimeRangeRequest != null) && !fTimeRangeRequest.isCompleted()) {
    fTimeRangeRequest.cancel();
  }
  TmfTimestamp startTS=new TmfTimestamp(startTime,TIME_SCALE);
  TmfTimestamp endTS=new TmfTimestamp(endTime,TIME_SCALE);
  TmfTimeRange timeRange=new TmfTimeRange(startTS,endTS);
  fTimeRangeHistogram.clear();
  fTimeRangeHistogram.setTimeRange(startTime,endTime - startTime);
  int cacheSize=fCurrentExperiment.getCacheSize();
  fTimeRangeRequest=new HistogramRequest(fTimeRangeHistogram.getDataModel(),timeRange,0,TmfDataRequest.ALL_DATA,cacheSize,ExecutionType.FOREGROUND);
  fCurrentExperiment.sendRequest(fTimeRangeRequest);
}
Program: 92229
Project: 92229
Buggy source:
private void sendFullRangeRequest(TmfTimeRange fullRange){
  if (fFullTraceRequest != null && !fFullTraceRequest.isCompleted()) {
    fFullTraceRequest.cancel();
  }
  int cacheSize=fCurrentExperiment.getCacheSize();
  fFullTraceRequest=new HistogramRequest(fFullTraceHistogram.getDataModel(),fullRange,(int)fFullTraceHistogram.fDataModel.getNbEvents(),TmfDataRequest.ALL_DATA,cacheSize,ExecutionType.BACKGROUND);
  fCurrentExperiment.sendRequest(fFullTraceRequest);
}

Fixed version (ground truth):
private void sendFullRangeRequest(TmfTimeRange fullRange){
  if ((fFullTraceRequest != null) && !fFullTraceRequest.isCompleted()) {
    fFullTraceRequest.cancel();
  }
  int cacheSize=fCurrentExperiment.getCacheSize();
  fFullTraceRequest=new HistogramRequest(fFullTraceHistogram.getDataModel(),fullRange,(int)fFullTraceHistogram.fDataModel.getNbEvents(),TmfDataRequest.ALL_DATA,cacheSize,ExecutionType.BACKGROUND);
  fCurrentExperiment.sendRequest(fFullTraceRequest);
}
Program: 92230
Project: 92230
Buggy source:
private void setNewRange(long startTime,long duration){
  if (startTime < fExperimentStartTime)   startTime=fExperimentStartTime;
  long endTime=startTime + duration;
  if (endTime > fExperimentEndTime) {
    endTime=fExperimentEndTime;
    if (endTime - duration > fExperimentStartTime)     startTime=endTime - duration;
 else {
      startTime=fExperimentStartTime;
    }
  }
  updateTimeRange(startTime,endTime);
}

Fixed version (ground truth):
private void setNewRange(long startTime,long duration){
  if (startTime < fExperimentStartTime) {
    startTime=fExperimentStartTime;
  }
  long endTime=startTime + duration;
  if (endTime < startTime) {
    endTime=fExperimentEndTime;
    startTime=fExperimentStartTime;
  }
  if (endTime > fExperimentEndTime) {
    endTime=fExperimentEndTime;
    if ((endTime - duration) > fExperimentStartTime) {
      startTime=endTime - duration;
    }
 else {
      startTime=fExperimentStartTime;
    }
  }
  updateTimeRange(startTime,endTime);
}
Program: 92231
Project: 92231
Buggy source:
@Override public void dispose(){
  if (fTimeRangeRequest != null && !fTimeRangeRequest.isCompleted()) {
    fTimeRangeRequest.cancel();
  }
  if (fFullTraceRequest != null && !fFullTraceRequest.isCompleted()) {
    fFullTraceRequest.cancel();
  }
  fFullTraceHistogram.dispose();
  fTimeRangeHistogram.dispose();
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  if ((fTimeRangeRequest != null) && !fTimeRangeRequest.isCompleted()) {
    fTimeRangeRequest.cancel();
  }
  if ((fFullTraceRequest != null) && !fFullTraceRequest.isCompleted()) {
    fFullTraceRequest.cancel();
  }
  fFullTraceHistogram.dispose();
  fTimeRangeHistogram.dispose();
  super.dispose();
}
Program: 92233
Project: 92233
Buggy source:
@Override public synchronized void mouseScrolled(MouseEvent event){
  if (fScrollCounter == null) {
    fScrollCounter=new MouseScrollCounter(this);
    fScrollCounter.start();
    fMouseTimestamp=fHistogram.getTimestamp(event.x);
  }
  fScrollCounter.incrementMouseScroll(event.count);
}

Fixed version (ground truth):
@Override public synchronized void mouseScrolled(MouseEvent event){
  if (fScrollCounter == null) {
    fScrollCounter=new MouseScrollCounter(this);
    fScrollCounter.start();
  }
  fScrollCounter.incrementMouseScroll(event.count);
}
Program: 92234
Project: 92234
Buggy source:
private synchronized void zoom(int nbClicks){
  fScrollCounter=null;
  long requestedRange=(nbClicks > 0) ? Math.round(ZOOM_FACTOR * fRangeDuration) : (long)Math.ceil(fRangeDuration * (1.0 / ZOOM_FACTOR));
  double ratio=((double)(fMouseTimestamp - fRangeStartTime)) / fRangeDuration;
  long requestedStart=validateStart(fRangeStartTime + (long)((fRangeDuration - requestedRange) * ratio));
  long requestedEnd=validateEnd(requestedStart,requestedStart + requestedRange);
  requestedStart=validateStart(requestedEnd - requestedRange);
  fHistogram.updateTimeRange(requestedStart,requestedEnd);
}

Fixed version (ground truth):
private synchronized void zoom(int nbClicks){
  fScrollCounter=null;
  long requestedRange=(nbClicks > 0) ? Math.round(ZOOM_FACTOR * fRangeDuration) : (long)Math.ceil(fRangeDuration * (1.0 / ZOOM_FACTOR));
  long requestedStart=validateStart(fRangeStartTime + (long)((fRangeDuration - requestedRange) / 2));
  long requestedEnd=validateEnd(requestedStart,requestedStart + requestedRange);
  requestedStart=validateStart(requestedEnd - requestedRange);
  fHistogram.updateTimeRange(requestedStart,requestedEnd);
}
Program: 92236
Project: 92236
Buggy source:
@Override public void handleData(ITmfEvent data){
  super.handleData(data);
  if (data != null) {
    AbsTmfStatisticsTree statisticsData=TmfStatisticsTreeRootFactory.getStatTree(getTreeID(experiment.getName()));
    final String traceName=data.getTrace().getName();
    ITmfExtraEventInfo extraInfo=new ITmfExtraEventInfo(){
      @Override public String getTraceName(){
        if (traceName == null) {
          return Messages.TmfStatisticsView_UnknownTraceName;
        }
        return traceName;
      }
    }
;
    statisticsData.registerEvent(data,extraInfo);
    statisticsData.increase(data,extraInfo,1);
    if ((getNbRead() % getInputChangedRefresh()) == 0) {
      modelInputChanged(false);
    }
  }
}

Fixed version (ground truth):
@Override public void handleData(ITmfEvent data){
  super.handleData(data);
  if (data != null) {
    final String traceName=data.getTrace().getName();
    ITmfExtraEventInfo extraInfo=new ITmfExtraEventInfo(){
      @Override public String getTraceName(){
        if (traceName == null) {
          return Messages.TmfStatisticsView_UnknownTraceName;
        }
        return traceName;
      }
    }
;
    statisticsData.registerEvent(data,extraInfo);
    statisticsData.increase(data,extraInfo,1);
    if ((getNbRead() % getInputChangedRefresh()) == 0) {
      modelInputChanged(false);
    }
  }
}
Program: 92237
Project: 92237
Buggy source:
@Override public void dispose(){
  super.dispose();
  if (fWaitCursor != null) {
    fWaitCursor.dispose();
  }
  TmfStatisticsTreeRootFactory.removeAll();
}

Fixed version (ground truth):
@Override public void dispose(){
  super.dispose();
  if (fWaitCursor != null) {
    fWaitCursor.dispose();
  }
  cancelOngoingRequest();
  TmfStatisticsTreeRootFactory.removeAll();
}
Program: 92238
Project: 92238
Buggy source:
private void setSelectedTimeInt(long time,boolean ensureVisible,boolean doNotify){
  long time0=_time0;
  long time1=_time1;
  if (ensureVisible) {
    long timeSpace=(long)((_time1 - _time0) * .02);
    long timeMid=(long)((_time1 - _time0) * .5);
    if (time < _time0 + timeSpace) {
      long dt=_time0 - time + timeMid;
      _time0-=dt;
      _time1-=dt;
    }
 else     if (time > _time1 - timeSpace) {
      long dt=time - _time1 + timeMid;
      _time0+=dt;
      _time1+=dt;
    }
    if (_time0 < _time0_) {
      _time1=Math.min(_time1_,_time1 + (_time0_ - _time0));
      _time0=_time0_;
    }
 else     if (_time1 > _time1_) {
      _time0=Math.max(_time0_,_time0 - (_time1 - _time1_));
      _time1=_time1_;
    }
  }
  if (_time1 - _time0 < _minTimeInterval) {
    _time1=_time0 + _minTimeInterval;
  }
  _stateCtrl.adjustScrolls();
  _stateCtrl.redraw();
  _timeScaleCtrl.redraw();
  boolean notifySelectedTime=(time != _selectedTime);
  _selectedTime=time;
  if (doNotify && ((time0 != _time0) || (time1 != _time1))) {
    notifyRangeListeners(_time0,_time1);
  }
  if (doNotify && notifySelectedTime) {
    notifyTimeListeners(_selectedTime);
  }
}

Fixed version (ground truth):
private void setSelectedTimeInt(long time,boolean ensureVisible,boolean doNotify){
  long time0=_time0;
  long time1=_time1;
  if (ensureVisible) {
    long timeSpace=(long)((_time1 - _time0) * .02);
    long timeMid=(long)((_time1 - _time0) * .5);
    if (time < _time0 + timeSpace) {
      long dt=_time0 - time + timeMid;
      _time0-=dt;
      _time1-=dt;
    }
 else     if (time > _time1 - timeSpace) {
      long dt=time - _time1 + timeMid;
      _time0+=dt;
      _time1+=dt;
    }
    if (_time0 < _time0_) {
      _time1=Math.min(_time1_,_time1 + (_time0_ - _time0));
      _time0=_time0_;
    }
 else     if (_time1 > _time1_) {
      _time0=Math.max(_time0_,_time0 - (_time1 - _time1_));
      _time1=_time1_;
    }
  }
  if (_time1 - _time0 < _minTimeInterval) {
    _time1=Math.min(_time1_,_time0 + _minTimeInterval);
  }
  _stateCtrl.adjustScrolls();
  _stateCtrl.redraw();
  _timeScaleCtrl.redraw();
  boolean notifySelectedTime=(time != _selectedTime);
  _selectedTime=time;
  if (doNotify && ((time0 != _time0) || (time1 != _time1))) {
    notifyRangeListeners(_time0,_time1);
  }
  if (doNotify && notifySelectedTime) {
    notifyTimeListeners(_selectedTime);
  }
}
Program: 92240
Project: 92240
Buggy source:
long getTimeAtX(int x){
  if (null == _timeProvider) {
    return -1;
  }
  long hitTime=-1;
  Point size=getCtrlSize();
  long time0=_timeProvider.getTime0();
  long time1=_timeProvider.getTime1();
  int nameWidth=_timeProvider.getNameSpace();
  x-=nameWidth;
  int timeWidth=size.x - nameWidth - RIGHT_MARGIN;
  if (x >= 0 && size.x >= nameWidth) {
    if (time1 - time0 > timeWidth) {
      hitTime=time0 + (long)((time1 - time0) * ((double)(x + 1) / timeWidth)) - 1;
    }
 else {
      hitTime=time0 + Math.round((time1 - time0) * ((double)x / timeWidth));
    }
  }
  return hitTime;
}

Fixed version (ground truth):
long getTimeAtX(int x){
  if (null == _timeProvider) {
    return -1;
  }
  long hitTime=-1;
  Point size=getCtrlSize();
  long time0=_timeProvider.getTime0();
  long time1=_timeProvider.getTime1();
  int nameWidth=_timeProvider.getNameSpace();
  x-=nameWidth;
  int timeWidth=size.x - nameWidth - RIGHT_MARGIN;
  if (x >= 0 && size.x >= nameWidth) {
    hitTime=time0 + Math.round((time1 - time0) * ((double)x / timeWidth));
  }
  return hitTime;
}
Program: 92241
Project: 92241
Buggy source:
private static void setHoverLocation(Shell shell,Point position){
  Rectangle displayBounds=shell.getDisplay().getBounds();
  Rectangle shellBounds=shell.getBounds();
  shellBounds.x=Math.max(Math.min(position.x,displayBounds.width - shellBounds.width),0);
  shellBounds.y=Math.max(Math.min(position.y + 16,displayBounds.height - shellBounds.height),0);
  shell.setBounds(shellBounds);
}

Fixed version (ground truth):
private static void setHoverLocation(Shell shell,Point position){
  Rectangle displayBounds=shell.getDisplay().getBounds();
  Rectangle shellBounds=shell.getBounds();
  if (position.x + shellBounds.width + 16 > displayBounds.width && position.x - shellBounds.width - 16 >= 0) {
    shellBounds.x=position.x - shellBounds.width - 16;
  }
 else {
    shellBounds.x=Math.max(Math.min(position.x + 16,displayBounds.width - shellBounds.width),0);
  }
  if (position.y + shellBounds.height + 16 > displayBounds.height && position.y - shellBounds.height - 16 >= 0) {
    shellBounds.y=position.y - shellBounds.height - 16;
  }
 else {
    shellBounds.y=Math.max(Math.min(position.y + 16,displayBounds.height - shellBounds.height),0);
  }
  shell.setBounds(shellBounds);
}
Program: 92242
Project: 92242
Buggy source:
/** 
 * Standard constructor
 * @param parent The parent composite object
 * @param rUtilImpl The presentation provider
 * @param timeProv The time provider
 */
public TimeGraphTooltipHandler(Shell parent,ITimeGraphPresentationProvider rUtilImpl,ITimeDataProvider timeProv){
  final Display display=parent.getDisplay();
  this._utilImp=rUtilImpl;
  this._timeDataProvider=timeProv;
  _tipShell=new Shell(parent,SWT.ON_TOP | SWT.TOOL);
  GridLayout gridLayout=new GridLayout();
  gridLayout.numColumns=2;
  gridLayout.marginWidth=2;
  gridLayout.marginHeight=2;
  _tipShell.setLayout(gridLayout);
  GridData data=new GridData(GridData.BEGINNING,GridData.BEGINNING,true,true);
  _tipShell.setLayoutData(data);
  _tipShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
  _tipTable=new Table(_tipShell,SWT.NONE);
  new TableColumn(_tipTable,SWT.NONE);
  new TableColumn(_tipTable,SWT.NONE);
  _tipTable.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
  _tipTable.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
  _tipTable.setHeaderVisible(false);
  _tipTable.setLinesVisible(false);
}

Fixed version (ground truth):
/** 
 * Standard constructor
 * @param parent The parent shell (unused, can be null)
 * @param rUtilImpl The presentation provider
 * @param timeProv The time provider
 */
public TimeGraphTooltipHandler(Shell parent,ITimeGraphPresentationProvider rUtilImpl,ITimeDataProvider timeProv){
  this._utilImp=rUtilImpl;
  this._timeDataProvider=timeProv;
}
Program: 92244
Project: 92244
Buggy source:
@Override public void mouseMove(MouseEvent e){
  if (_tipShell.isVisible()) {
    _tipShell.setVisible(false);
  }
}

Fixed version (ground truth):
@Override public void mouseMove(MouseEvent e){
  if (_tipShell != null && !_tipShell.isDisposed()) {
    _tipShell.dispose();
  }
}
Program: 92246
Project: 92246
Buggy source:
@Override public void mouseDown(MouseEvent e){
  if (_tipShell.isVisible()) {
    _tipShell.setVisible(false);
  }
}

Fixed version (ground truth):
@Override public void mouseDown(MouseEvent e){
  if (_tipShell != null && !_tipShell.isDisposed()) {
    _tipShell.dispose();
  }
}
Program: 92247
Project: 92247
Buggy source:
@Override public void mouseHover(MouseEvent event){
  Point pt=new Point(event.x,event.y);
  TimeGraphControl threadStates=(TimeGraphControl)event.widget;
  ITimeGraphEntry entry=threadStates.getEntry(pt);
  _tipTable.remove(0,_tipTable.getItemCount() - 1);
  fillValues(pt,threadStates,entry);
  if (_tipTable.getItemCount() == 0) {
    return;
  }
  _tipTable.getColumn(0).pack();
  _tipTable.getColumn(1).pack();
  _tipShell.pack();
  _tipPosition=control.toDisplay(pt);
  _tipShell.pack();
  setHoverLocation(_tipShell,_tipPosition);
  _tipShell.setVisible(true);
}

Fixed version (ground truth):
@Override public void mouseHover(MouseEvent event){
  Point pt=new Point(event.x,event.y);
  TimeGraphControl timeGraphControl=(TimeGraphControl)event.widget;
  createTooltipShell(timeGraphControl.getShell());
  ITimeGraphEntry entry=timeGraphControl.getEntry(pt);
  _tipTable.remove(0,_tipTable.getItemCount() - 1);
  fillValues(pt,timeGraphControl,entry);
  if (_tipTable.getItemCount() == 0) {
    return;
  }
  _tipTable.getColumn(0).pack();
  _tipTable.getColumn(1).pack();
  _tipShell.pack();
  _tipPosition=control.toDisplay(pt);
  _tipShell.pack();
  setHoverLocation(_tipShell,_tipPosition);
  _tipShell.setVisible(true);
}
Program: 92248
Project: 92248
Buggy source:
@Override public void mouseExit(MouseEvent e){
  if (_tipShell.isVisible()) {
    _tipShell.setVisible(false);
  }
}

Fixed version (ground truth):
@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();
    }
  }
}
Program: 92249
Project: 92249
Buggy source:
/** 
 * N means: <list> <li>-1: Previous Event</li> <li>0: Current Event</li> <li> 1: Next Event</li> <li>2: Previous Event when located in a non Event Area </list>
 * @param entry
 * @param time
 * @param n
 * @return
 */
static ITimeEvent findEvent(ITimeGraphEntry entry,long time,int n){
  if (null == entry || !entry.hasTimeEvents()) {
    return null;
  }
  Iterator<ITimeEvent> iterator=entry.getTimeEventsIterator();
  if (iterator == null) {
    return null;
  }
  ITimeEvent nextEvent=null;
  ITimeEvent currEvent=null;
  ITimeEvent prevEvent=null;
  while (iterator.hasNext()) {
    nextEvent=iterator.next();
    long nextStartTime=nextEvent.getTime();
    if (nextStartTime > time) {
      break;
    }
    if (currEvent == null || currEvent.getTime() != nextStartTime) {
      prevEvent=currEvent;
      currEvent=nextEvent;
    }
  }
  if (n == -1) {
    if (currEvent != null && currEvent.getTime() + currEvent.getDuration() >= time) {
      return prevEvent;
    }
    return currEvent;
  }
 else   if (n == 0) {
    if (currEvent != null && currEvent.getTime() + currEvent.getDuration() >= time) {
      return currEvent;
    }
    return null;
  }
 else   if (n == 1) {
    return nextEvent;
  }
 else   if (n == 2) {
    return currEvent;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * N means: <list> <li>-1: Previous Event</li> <li>0: Current Event</li> <li> 1: Next Event</li> <li>2: Previous Event when located in a non Event Area </list>
 * @param entry
 * @param time
 * @param n
 * @return
 */
static ITimeEvent findEvent(ITimeGraphEntry entry,long time,int n){
  if (null == entry || !entry.hasTimeEvents()) {
    return null;
  }
  Iterator<ITimeEvent> iterator=entry.getTimeEventsIterator();
  if (iterator == null) {
    return null;
  }
  ITimeEvent nextEvent=null;
  ITimeEvent currEvent=null;
  ITimeEvent prevEvent=null;
  while (iterator.hasNext()) {
    nextEvent=iterator.next();
    long nextStartTime=nextEvent.getTime();
    if (nextStartTime > time) {
      break;
    }
    if (currEvent == null || currEvent.getTime() != nextStartTime) {
      prevEvent=currEvent;
      currEvent=nextEvent;
    }
  }
  if (n == -1) {
    if (currEvent != null && currEvent.getTime() + currEvent.getDuration() >= time) {
      return prevEvent;
    }
    return currEvent;
  }
 else   if (n == 0) {
    if (currEvent != null && currEvent.getTime() + currEvent.getDuration() >= time) {
      return currEvent;
    }
    return null;
  }
 else   if (n == 1) {
    if (nextEvent != null && nextEvent.getTime() > time) {
      return nextEvent;
    }
    return null;
  }
 else   if (n == 2) {
    return currEvent;
  }
  return null;
}
Program: 92250
Project: 92250
Buggy source:
protected String createLaunchStr(IPath valgrindPath) throws CoreException {
  String projectName=configUtils.getProjectName();
  IProject project=ConfigUtils.getProject(projectName);
  URI projectURI=project.getLocationURI();
  String Location=projectURI.getScheme() + "String_Node_Str" + projectURI.getHost();
  return config.getName() + "String_Node_Str" + valgrindPath.toString()+ "String_Node_Str"+ getPlugin().getToolName(toolID)+ "String_Node_Str"+ Location+ "String_Node_Str";
}

Fixed version (ground truth):
protected String createLaunchStr(IPath valgrindPath) throws CoreException {
  String projectName=configUtils.getProjectName();
  IProject project=ConfigUtils.getProject(projectName);
  URI projectURI=project.getLocationURI();
  String host=projectURI.getHost();
  if (host == null) {
    host=projectURI.getAuthority();
  }
  String location;
  if (host == null) {
    location="String_Node_Str";
  }
 else {
    location=projectURI.getScheme() + "String_Node_Str" + host;
  }
  return config.getName() + "String_Node_Str" + valgrindPath.toString()+ "String_Node_Str"+ getPlugin().getToolName(toolID)+ "String_Node_Str"+ location+ "String_Node_Str";
}
Program: 92251
Project: 92251
Buggy source:
@Override public void run(){
  if (fTimeGraphCombo.isDisposed()) {
    return;
  }
  fTimeGraphCombo.redraw();
  fTimeGraphCombo.update();
}

Fixed version (ground truth):
@Override public void run(){
  if (fTimeGraphCombo.isDisposed()) {
    return;
  }
  fTimeGraphCombo.redraw();
  fTimeGraphCombo.update();
synchronized (fSyncObj) {
    if (fRedrawState == State.PENDING) {
      fRedrawState=State.IDLE;
      redraw();
    }
 else {
      fRedrawState=State.IDLE;
    }
  }
}
Program: 92252
Project: 92252
Buggy source:
private void zoom(ControlFlowEntry entry,IProgressMonitor monitor){
  if (fZoomStartTime <= fStartTime && fZoomEndTime >= fEndTime) {
    entry.setZoomedEventList(null);
  }
 else {
    List<ITimeEvent> zoomedEventList=getEventList(entry,fZoomStartTime,fZoomEndTime,fResolution,monitor);
    if (zoomedEventList != null) {
      entry.setZoomedEventList(zoomedEventList);
    }
  }
  for (  ControlFlowEntry child : entry.getChildren()) {
    if (fMonitor.isCanceled()) {
      return;
    }
    zoom(child,monitor);
  }
}

Fixed version (ground truth):
private void zoom(ControlFlowEntry entry,IProgressMonitor monitor){
  if (fZoomStartTime <= fStartTime && fZoomEndTime >= fEndTime) {
    entry.setZoomedEventList(null);
  }
 else {
    List<ITimeEvent> zoomedEventList=getEventList(entry,fZoomStartTime,fZoomEndTime,fResolution,monitor);
    if (zoomedEventList != null) {
      entry.setZoomedEventList(zoomedEventList);
    }
  }
  redraw();
  for (  ControlFlowEntry child : entry.getChildren()) {
    if (fMonitor.isCanceled()) {
      return;
    }
    zoom(child,monitor);
  }
}
Program: 92253
Project: 92253
Buggy source:
private static List<ITimeEvent> getEventList(ControlFlowEntry entry,long startTime,long endTime,long resolution,IProgressMonitor monitor){
  startTime=Math.max(startTime,entry.getStartTime());
  endTime=Math.min(endTime,entry.getEndTime());
  if (endTime <= startTime) {
    return null;
  }
  IStateSystemQuerier ssq=entry.getTrace().getStateSystem();
  List<ITimeEvent> eventList=null;
  try {
    int statusQuark=ssq.getQuarkRelative(entry.getThreadQuark(),Attributes.STATUS);
    List<ITmfStateInterval> statusIntervals=ssq.queryHistoryRange(statusQuark,startTime,endTime - 1,resolution);
    eventList=new ArrayList<ITimeEvent>(statusIntervals.size());
    long lastEndTime=-1;
    for (    ITmfStateInterval statusInterval : statusIntervals) {
      if (monitor.isCanceled()) {
        return null;
      }
      long time=statusInterval.getStartTime();
      long duration=statusInterval.getEndTime() - time + 1;
      int status=-1;
      try {
        status=statusInterval.getStateValue().unboxInt();
      }
 catch (      StateValueTypeException e) {
        e.printStackTrace();
      }
      if (lastEndTime != time && lastEndTime != -1) {
        eventList.add(new ControlFlowEvent(entry,lastEndTime,time - lastEndTime,0));
      }
      eventList.add(new ControlFlowEvent(entry,time,duration,status));
      lastEndTime=time + duration;
    }
  }
 catch (  AttributeNotFoundException e) {
    e.printStackTrace();
  }
catch (  TimeRangeException e) {
    e.printStackTrace();
  }
  return eventList;
}

Fixed version (ground truth):
private static List<ITimeEvent> getEventList(ControlFlowEntry entry,long startTime,long endTime,long resolution,IProgressMonitor monitor){
  startTime=Math.max(startTime,entry.getStartTime());
  endTime=Math.min(endTime,entry.getEndTime());
  if (endTime <= startTime) {
    return null;
  }
  IStateSystemQuerier ssq=entry.getTrace().getStateSystem();
  List<ITimeEvent> eventList=null;
  try {
    int statusQuark=ssq.getQuarkRelative(entry.getThreadQuark(),Attributes.STATUS);
    List<ITmfStateInterval> statusIntervals=ssq.queryHistoryRange(statusQuark,startTime,endTime - 1,resolution,monitor);
    eventList=new ArrayList<ITimeEvent>(statusIntervals.size());
    long lastEndTime=-1;
    for (    ITmfStateInterval statusInterval : statusIntervals) {
      if (monitor.isCanceled()) {
        return null;
      }
      long time=statusInterval.getStartTime();
      long duration=statusInterval.getEndTime() - time + 1;
      int status=-1;
      try {
        status=statusInterval.getStateValue().unboxInt();
      }
 catch (      StateValueTypeException e) {
        e.printStackTrace();
      }
      if (lastEndTime != time && lastEndTime != -1) {
        eventList.add(new ControlFlowEvent(entry,lastEndTime,time - lastEndTime,0));
      }
      eventList.add(new ControlFlowEvent(entry,time,duration,status));
      lastEndTime=time + duration;
    }
  }
 catch (  AttributeNotFoundException e) {
    e.printStackTrace();
  }
catch (  TimeRangeException e) {
    e.printStackTrace();
  }
  return eventList;
}
Program: 92254
Project: 92254
Buggy source:
private void redraw(){
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphCombo.isDisposed()) {
        return;
      }
      fTimeGraphCombo.redraw();
      fTimeGraphCombo.update();
    }
  }
);
}

Fixed version (ground truth):
private void redraw(){
synchronized (fSyncObj) {
    if (fRedrawState == State.IDLE) {
      fRedrawState=State.BUSY;
    }
 else {
      fRedrawState=State.PENDING;
      return;
    }
  }
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphCombo.isDisposed()) {
        return;
      }
      fTimeGraphCombo.redraw();
      fTimeGraphCombo.update();
synchronized (fSyncObj) {
        if (fRedrawState == State.PENDING) {
          fRedrawState=State.IDLE;
          redraw();
        }
 else {
          fRedrawState=State.IDLE;
        }
      }
    }
  }
);
}
Program: 92255
Project: 92255
Buggy source:
@Override public void run(){
  if (fTimeGraphViewer.getControl().isDisposed()) {
    return;
  }
  fTimeGraphViewer.getControl().redraw();
  fTimeGraphViewer.getControl().update();
}

Fixed version (ground truth):
@Override public void run(){
  if (fTimeGraphViewer.getControl().isDisposed()) {
    return;
  }
  fTimeGraphViewer.getControl().redraw();
  fTimeGraphViewer.getControl().update();
synchronized (fSyncObj) {
    if (fRedrawState == State.PENDING) {
      fRedrawState=State.IDLE;
      redraw();
    }
 else {
      fRedrawState=State.IDLE;
    }
  }
}
Program: 92257
Project: 92257
Buggy source:
private void redraw(){
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphViewer.getControl().isDisposed()) {
        return;
      }
      fTimeGraphViewer.getControl().redraw();
      fTimeGraphViewer.getControl().update();
    }
  }
);
}

Fixed version (ground truth):
private void redraw(){
synchronized (fSyncObj) {
    if (fRedrawState == State.IDLE) {
      fRedrawState=State.BUSY;
    }
 else {
      fRedrawState=State.PENDING;
      return;
    }
  }
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphViewer.getControl().isDisposed()) {
        return;
      }
      fTimeGraphViewer.getControl().redraw();
      fTimeGraphViewer.getControl().update();
synchronized (fSyncObj) {
        if (fRedrawState == State.PENDING) {
          fRedrawState=State.IDLE;
          redraw();
        }
 else {
          fRedrawState=State.IDLE;
        }
      }
    }
  }
);
}
Program: 92258
Project: 92258
Buggy source:
@Override public List<ITmfStateInterval> queryHistoryRange(int attributeQuark,long t1,long t2,long resolution) throws TimeRangeException, AttributeNotFoundException {
  List<ITmfStateInterval> intervals;
  ITmfStateInterval currentInterval;
  long ts, tEnd;
  if (t2 < t1 || resolution <= 0) {
    throw new TimeRangeException();
  }
  if (t2 > this.getCurrentEndTime()) {
    tEnd=this.getCurrentEndTime();
  }
 else {
    tEnd=t2;
  }
  intervals=new ArrayList<ITmfStateInterval>();
  currentInterval=querySingleState(t1,attributeQuark);
  intervals.add(currentInterval);
  for (ts=t1; (currentInterval.getEndTime() != -1) && (ts < tEnd); ts+=resolution) {
    if (ts <= currentInterval.getEndTime()) {
      continue;
    }
    currentInterval=querySingleState(ts,attributeQuark);
    intervals.add(currentInterval);
  }
  if (currentInterval.getEndTime() < tEnd) {
    currentInterval=querySingleState(tEnd,attributeQuark);
    intervals.add(currentInterval);
  }
  return intervals;
}

Fixed version (ground truth):
@Override public List<ITmfStateInterval> queryHistoryRange(int attributeQuark,long t1,long t2,long resolution,IProgressMonitor monitor) throws TimeRangeException, AttributeNotFoundException {
  List<ITmfStateInterval> intervals;
  ITmfStateInterval currentInterval;
  long ts, tEnd;
  if (t2 < t1 || resolution <= 0) {
    throw new TimeRangeException();
  }
  if (t2 > this.getCurrentEndTime()) {
    tEnd=this.getCurrentEndTime();
  }
 else {
    tEnd=t2;
  }
  intervals=new ArrayList<ITmfStateInterval>();
  currentInterval=querySingleState(t1,attributeQuark);
  intervals.add(currentInterval);
  for (ts=t1; (currentInterval.getEndTime() != -1) && (ts < tEnd); ts+=resolution) {
    if (monitor.isCanceled()) {
      return intervals;
    }
    if (ts <= currentInterval.getEndTime()) {
      continue;
    }
    currentInterval=querySingleState(ts,attributeQuark);
    intervals.add(currentInterval);
  }
  if (currentInterval.getEndTime() < tEnd) {
    currentInterval=querySingleState(tEnd,attributeQuark);
    intervals.add(currentInterval);
  }
  return intervals;
}
Program: 92259
Project: 92259
Buggy source:
/** 
 * Return the state history of a given attribute, but with at most one update per "resolution". This can be useful for populating views (where it's useless to have more than one query per pixel, for example).
 * @param attributeQuark Which attribute this query is interested in
 * @param t1 Start time of the range query
 * @param t2 Target end time of the query. If t2 is greater than the end of the trace, we will return what we have up to the end of the history.
 * @param resolution The "step" of this query
 * @return The List of states that happened between t1 and t2
 * @throws TimeRangeException If t1 is invalid, if t2 <= t1, or if the resolution isn't greater than zero.
 * @throws AttributeNotFoundException If the attribute doesn't exist
 */
public List<ITmfStateInterval> queryHistoryRange(int attributeQuark,long t1,long t2,long resolution) throws TimeRangeException, AttributeNotFoundException ;

Fixed version (ground truth):
/** 
 * Return the state history of a given attribute, but with at most one update per "resolution". This can be useful for populating views (where it's useless to have more than one query per pixel, for example). A progress monitor can be used to cancel the query before completion.
 * @param attributeQuark Which attribute this query is interested in
 * @param t1 Start time of the range query
 * @param t2 Target end time of the query. If t2 is greater than the end of the trace, we will return what we have up to the end of the history.
 * @param resolution The "step" of this query
 * @param monitor A progress monitor. If the monitor is canceled during a query, we will return what has been found up to that point.
 * @return The List of states that happened between t1 and t2
 * @throws TimeRangeException If t1 is invalid, if t2 <= t1, or if the resolution isn't greater than zero.
 * @throws AttributeNotFoundException If the attribute doesn't exist
 * @since 1.1
 */
public List<ITmfStateInterval> queryHistoryRange(int attributeQuark,long t1,long t2,long resolution,IProgressMonitor monitor) throws TimeRangeException, AttributeNotFoundException ;
Program: 92261
Project: 92261
Buggy source:
/** 
 * Method readNextEvent.
 * @param context ITmfContext
 * @return CtfTmfEvent
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getNext(ITmfContext)
 */
@Override public synchronized CtfTmfEvent getNext(final ITmfContext context){
  CtfTmfEvent event=null;
  if (context instanceof CtfTmfLightweightContext) {
    if (CtfLocation.INVALID_LOCATION.equals(context.getLocation())) {
      return null;
    }
    CtfTmfLightweightContext ctfContext=(CtfTmfLightweightContext)context;
    if (ctfContext.getLocation().equals(CtfLocation.INVALID_LOCATION)) {
      return null;
    }
    event=ctfContext.getCurrentEvent();
    if (event != null) {
      updateAttributes(context,event.getTimestamp());
      ctfContext.advance();
      ctfContext.increaseRank();
    }
  }
  return event;
}

Fixed version (ground truth):
/** 
 * Method readNextEvent.
 * @param context ITmfContext
 * @return CtfTmfEvent
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getNext(ITmfContext)
 */
@Override public synchronized CtfTmfEvent getNext(final ITmfContext context){
  CtfTmfEvent event=null;
  if (context instanceof CtfTmfLightweightContext) {
    if (CtfLocation.INVALID_LOCATION.equals(context.getLocation().getLocation())) {
      return null;
    }
    CtfTmfLightweightContext ctfContext=(CtfTmfLightweightContext)context;
    event=ctfContext.getCurrentEvent();
    if (event != null) {
      updateAttributes(context,event.getTimestamp());
      ctfContext.advance();
      ctfContext.increaseRank();
    }
  }
  return event;
}
Program: 92262
Project: 92262
Buggy source:
public LttngLocation(final LttngLocation oldLocation){
  this.isLastOperationParse=oldLocation.isLastOperationParse;
  this.isLastOperationReadNext=oldLocation.isLastOperationReadNext;
  this.isLastOperationSeek=oldLocation.isLastOperationSeek;
  this.operationTime=oldLocation.operationTime;
}

Fixed version (ground truth):
public LttngLocation(final LttngLocation oldLocation){
  this.isLastOperationParse=oldLocation.isLastOperationParse;
  this.isLastOperationReadNext=oldLocation.isLastOperationReadNext;
  this.isLastOperationSeek=oldLocation.isLastOperationSeek;
  this.operationTime=oldLocation.operationTime.clone();
}
Program: 92263
Project: 92263
Buggy source:
@Override public synchronized LttngEvent getNext(final ITmfContext context){
  if (PRINT_DEBUG)   System.out.println("String_Node_Str" + context.getLocation());
  LttngEvent returnedEvent=null;
  LttngLocation curLocation=null;
  curLocation=(LttngLocation)context.getLocation();
  if (curLocation == null)   curLocation=getCurrentLocation(context);
  if ((!(curLocation.isLastOperationParse())) || (previousLocation.getOperationTimeValue() != curLocation.getOperationTimeValue())) {
    if (previousLocation.getOperationTimeValue() != curLocation.getOperationTimeValue()) {
      if (PRINT_DEBUG)       System.out.println("String_Node_Str" + previousLocation.getOperationTimeValue() + "String_Node_Str"+ curLocation.getOperationTimeValue()+ "String_Node_Str");
      seekEvent(curLocation.getOperationTime());
    }
    returnedEvent=readNextEvent(curLocation);
  }
 else {
    returnedEvent=currentLttngEvent;
    previousLocation.setLastOperationReadNext();
    curLocation.setLastOperationReadNext();
  }
  if (returnedEvent != null)   setPreviousAndCurrentTimes(context,returnedEvent,curLocation);
  return returnedEvent;
}

Fixed version (ground truth):
@Override public synchronized LttngEvent getNext(final ITmfContext context){
  if (PRINT_DEBUG)   System.out.println("String_Node_Str" + context.getLocation());
  LttngEvent returnedEvent=null;
  LttngLocation curLocation=null;
  curLocation=(LttngLocation)context.getLocation();
  if (curLocation == null)   curLocation=getCurrentLocation(context);
  if ((!(curLocation.isLastOperationParse())) || (previousLocation.getOperationTimeValue() != curLocation.getOperationTimeValue())) {
    if (previousLocation.getOperationTimeValue() != curLocation.getOperationTimeValue()) {
      if (PRINT_DEBUG)       System.out.println("String_Node_Str" + previousLocation.getOperationTimeValue() + "String_Node_Str"+ curLocation.getOperationTimeValue()+ "String_Node_Str");
      seekEvent(curLocation.getOperationTime());
      if (curLocation.isLastOperationReadNext()) {
        readNextEvent(curLocation);
      }
    }
    returnedEvent=readNextEvent(curLocation);
  }
 else {
    returnedEvent=currentLttngEvent;
    previousLocation.setLastOperationReadNext();
    curLocation.setLastOperationReadNext();
  }
  if (returnedEvent != null)   setPreviousAndCurrentTimes(context,returnedEvent,curLocation);
  return returnedEvent;
}
Program: 92264
Project: 92264
Buggy source:
private void refresh(final long windowRange){
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphCombo.isDisposed()) {
        return;
      }
      ITimeGraphEntry[] entries=fEntryList.toArray(new ITimeGraphEntry[0]);
      Arrays.sort(entries,fControlFlowEntryComparator);
      fTimeGraphCombo.setInput(entries);
      fTimeGraphCombo.getTimeGraphViewer().setTimeBounds(fStartTime,fEndTime);
      long endTime=fStartTime + windowRange;
      if (fEndTime < endTime) {
        endTime=fEndTime;
      }
      fTimeGraphCombo.getTimeGraphViewer().setStartFinishTime(fStartTime,endTime);
      for (      TreeColumn column : fTimeGraphCombo.getTreeViewer().getTree().getColumns()) {
        column.pack();
      }
      startZoomThread(fStartTime,endTime);
    }
  }
);
}

Fixed version (ground truth):
private void refresh(final long windowRange){
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphCombo.isDisposed()) {
        return;
      }
      ITimeGraphEntry[] entries=null;
synchronized (fEntryListSyncObj) {
        entries=fEntryList.toArray(new ITimeGraphEntry[0]);
      }
      Arrays.sort(entries,fControlFlowEntryComparator);
      fTimeGraphCombo.setInput(entries);
      fTimeGraphCombo.getTimeGraphViewer().setTimeBounds(fStartTime,fEndTime);
      long endTime=fStartTime + windowRange;
      if (fEndTime < endTime) {
        endTime=fEndTime;
      }
      fTimeGraphCombo.getTimeGraphViewer().setStartFinishTime(fStartTime,endTime);
      for (      TreeColumn column : fTimeGraphCombo.getTreeViewer().getTree().getColumns()) {
        column.pack();
      }
      startZoomThread(fStartTime,endTime);
    }
  }
);
}
Program: 92266
Project: 92266
Buggy source:
private void refresh(final long windowRange){
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphViewer.getControl().isDisposed()) {
        return;
      }
      ITimeGraphEntry[] entries=fEntryList.toArray(new ITimeGraphEntry[0]);
      Arrays.sort(entries,new TraceEntryComparator());
      fTimeGraphViewer.setInput(entries);
      fTimeGraphViewer.setTimeBounds(fStartTime,fEndTime);
      long endTime=fStartTime + windowRange;
      if (fEndTime < endTime) {
        endTime=fEndTime;
      }
      fTimeGraphViewer.setStartFinishTime(fStartTime,endTime);
      startZoomThread(fStartTime,endTime);
    }
  }
);
}

Fixed version (ground truth):
private void refresh(final long windowRange){
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphViewer.getControl().isDisposed()) {
        return;
      }
      ITimeGraphEntry[] entries=null;
synchronized (fEntryListSyncObj) {
        entries=fEntryList.toArray(new ITimeGraphEntry[0]);
      }
      Arrays.sort(entries,new TraceEntryComparator());
      fTimeGraphViewer.setInput(entries);
      fTimeGraphViewer.setTimeBounds(fStartTime,fEndTime);
      long endTime=fStartTime + windowRange;
      if (fEndTime < endTime) {
        endTime=fEndTime;
      }
      fTimeGraphViewer.setStartFinishTime(fStartTime,endTime);
      startZoomThread(fStartTime,endTime);
    }
  }
);
}
Program: 92269
Project: 92269
Buggy source:
/** 
 * Method readNextEvent.
 * @param context ITmfContext
 * @return CtfTmfEvent
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getNext(ITmfContext)
 */
@Override public synchronized CtfTmfEvent getNext(final ITmfContext context){
  CtfTmfEvent event=null;
  if (context instanceof CtfTmfLightweightContext) {
    if (CtfLocation.INVALID_LOCATION.equals(context.getLocation())) {
      return null;
    }
    CtfTmfLightweightContext ctfContext=(CtfTmfLightweightContext)context;
    event=ctfContext.getCurrentEvent();
    if (event != null) {
      updateAttributes(context,event.getTimestamp());
      ctfContext.advance();
      ctfContext.increaseRank();
    }
  }
  return event;
}

Fixed version (ground truth):
/** 
 * Method readNextEvent.
 * @param context ITmfContext
 * @return CtfTmfEvent
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getNext(ITmfContext)
 */
@Override public synchronized CtfTmfEvent getNext(final ITmfContext context){
  CtfTmfEvent event=null;
  if (context instanceof CtfTmfLightweightContext) {
    if (CtfLocation.INVALID_LOCATION.equals(context.getLocation())) {
      return null;
    }
    CtfTmfLightweightContext ctfContext=(CtfTmfLightweightContext)context;
    if (ctfContext.getLocation().equals(CtfLocation.INVALID_LOCATION)) {
      return null;
    }
    event=ctfContext.getCurrentEvent();
    if (event != null) {
      updateAttributes(context,event.getTimestamp());
      ctfContext.advance();
      ctfContext.increaseRank();
    }
  }
  return event;
}
Program: 92270
Project: 92270
Buggy source:
@Override public TmfLocationArray clone(){
  ITmfLocation<? extends Comparable<?>>[] clones=(ITmfLocation<? extends Comparable<?>>[])new ITmfLocation<?>[fLocations.length];
  for (int i=0; i < fLocations.length; i++) {
    ITmfLocation<?> location=fLocations[i];
    clones[i]=(location != null) ? location : null;
  }
  return new TmfLocationArray(clones);
}

Fixed version (ground truth):
@Override public TmfLocationArray clone(){
  ITmfLocation<? extends Comparable<?>>[] clones=(ITmfLocation<? extends Comparable<?>>[])new ITmfLocation<?>[fLocations.length];
  for (int i=0; i < fLocations.length; i++) {
    ITmfLocation<?> location=fLocations[i];
    clones[i]=(location != null) ? location.clone() : null;
  }
  return new TmfLocationArray(clones);
}
Program: 92273
Project: 92273
Buggy source:
@SuppressWarnings("String_Node_Str") public void testGetLocationRatio() throws Exception {
  ITmfContext context=fExperiment.seekEvent((ITmfLocation)null);
  double ratio=fExperiment.getLocationRatio(context.getLocation());
  context=fExperiment.seekEvent(ratio);
  double ratio2=fExperiment.getLocationRatio(context.getLocation());
  assertEquals("String_Node_Str",ratio,ratio2);
  context=fExperiment.seekEvent(NB_EVENTS / 2);
  ratio=fExperiment.getLocationRatio(context.getLocation());
  context=fExperiment.seekEvent(ratio);
  ratio2=fExperiment.getLocationRatio(context.getLocation());
  assertEquals("String_Node_Str",ratio,ratio2);
  context=fExperiment.seekEvent(NB_EVENTS - 1);
  ratio=fExperiment.getLocationRatio(context.getLocation());
  context=fExperiment.seekEvent(ratio);
  ratio2=fExperiment.getLocationRatio(context.getLocation());
  assertEquals("String_Node_Str",ratio,ratio2);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void testGetLocationRatio() throws Exception {
  ITmfContext context=fExperiment.seekEvent((ITmfLocation)null);
  double ratio=fExperiment.getLocationRatio(context.getLocation());
  assertEquals("String_Node_Str",0.0,ratio);
  context=fExperiment.seekEvent(NB_EVENTS / 2);
  ratio=fExperiment.getLocationRatio(context.getLocation());
  assertEquals("String_Node_Str",(double)(NB_EVENTS / 2) / NB_EVENTS,ratio);
  context=fExperiment.seekEvent(NB_EVENTS - 1);
  ratio=fExperiment.getLocationRatio(context.getLocation());
  assertEquals("String_Node_Str",(double)(NB_EVENTS - 1) / NB_EVENTS,ratio);
}
Program: 92274
Project: 92274
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public String toString(){
  StringBuilder result=new StringBuilder("String_Node_Str");
  ITmfLocation<? extends Comparable<?>>[] locations=((TmfLocationArray)getLocation()).getLocations();
  for (  ITmfLocation<?> location : locations) {
    result.append("String_Node_Str" + location + "String_Node_Str");
  }
  result.append("String_Node_Str");
  return result.toString();
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public String toString(){
  StringBuilder result=new StringBuilder("String_Node_Str");
  TmfRankedLocation[] locations=((TmfLocationArray)getLocation()).getLocations();
  for (  TmfRankedLocation location : locations) {
    result.append("String_Node_Str" + location + "String_Node_Str");
  }
  result.append("String_Node_Str");
  return result.toString();
}
Program: 92275
Project: 92275
Buggy source:
@Override public TmfLocationArray clone(){
  ITmfLocation<? extends Comparable<?>>[] clones=(ITmfLocation<? extends Comparable<?>>[])new ITmfLocation<?>[fLocations.length];
  for (int i=0; i < fLocations.length; i++) {
    ITmfLocation<?> location=fLocations[i];
    clones[i]=(location != null) ? location.clone() : null;
  }
  return new TmfLocationArray(clones);
}

Fixed version (ground truth):
@Override public TmfLocationArray clone(){
  TmfRankedLocation[] clones=new TmfRankedLocation[fLocations.length];
  for (int i=0; i < fLocations.length; i++) {
    TmfRankedLocation location=fLocations[i];
    clones[i]=(location != null) ? location.clone() : null;
  }
  return new TmfLocationArray(clones);
}
Program: 92276
Project: 92276
Buggy source:
/** 
 * The standard constructor
 * @param locations the locations
 */
public ITmfLocation<? extends Comparable<?>>[] getLocations(){
  return fLocations;
}

Fixed version (ground truth):
/** 
 * The standard constructor
 * @param locations the locations
 */
public TmfRankedLocation[] getLocations(){
  return fLocations;
}
Program: 92277
Project: 92277
Buggy source:
@Override @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public int compareTo(TmfLocationArray o){
  for (int i=0; i < fLocations.length; i++) {
    ITmfLocation<? extends Comparable> l1=(ITmfLocation<? extends Comparable>)fLocations[i].getLocation();
    ITmfLocation<? extends Comparable> l2=(ITmfLocation<? extends Comparable>)o.fLocations[i].getLocation();
    int result=l1.getLocation().compareTo(l2.getLocation());
    if (result != 0) {
      return result;
    }
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compareTo(TmfLocationArray o){
  for (int i=0; i < fLocations.length; i++) {
    TmfRankedLocation l1=fLocations[i];
    TmfRankedLocation l2=o.fLocations[i];
    int result=l1.compareTo(l2);
    if (result != 0) {
      return result;
    }
  }
  return 0;
}
Program: 92278
Project: 92278
Buggy source:
/** 
 * The standard constructor
 * @param locations the locations
 */
public TmfLocationArray(ITmfLocation<? extends Comparable<?>>[] locations){
  fLocations=locations;
}

Fixed version (ground truth):
/** 
 * The standard constructor
 * @param locations the locations
 */
public TmfLocationArray(TmfRankedLocation[] locations){
  fLocations=locations;
}
Program: 92279
Project: 92279
Buggy source:
public CustomTxtTrace(final IResource resource,final CustomTxtTraceDefinition definition,final String path,final int pageSize) throws TmfTraceException {
  super(resource,CustomTxtEvent.class,path,(pageSize > 0) ? pageSize : DEFAULT_CACHE_SIZE);
  fDefinition=definition;
  fEventType=new CustomTxtEventType(fDefinition);
  indexTrace(false);
}

Fixed version (ground truth):
public CustomTxtTrace(final IResource resource,final CustomTxtTraceDefinition definition,final String path,final int cacheSize) throws TmfTraceException {
  this(definition);
  setCacheSize((cacheSize > 0) ? cacheSize : DEFAULT_CACHE_SIZE);
  initTrace(resource,path,CustomTxtEvent.class);
}
Program: 92280
Project: 92280
Buggy source:
public CustomXmlTrace(final IResource resource,final CustomXmlTraceDefinition definition,final String path,final int pageSize) throws TmfTraceException {
  super(null,CustomXmlEvent.class,path,(pageSize > 0) ? pageSize : DEFAULT_CACHE_SIZE);
  fDefinition=definition;
  fEventType=new CustomXmlEventType(fDefinition);
  fRecordInputElement=getRecordInputElement(fDefinition.rootInputElement);
  indexTrace(false);
}

Fixed version (ground truth):
public CustomXmlTrace(final IResource resource,final CustomXmlTraceDefinition definition,final String path,final int pageSize) throws TmfTraceException {
  this(definition);
  setCacheSize((pageSize > 0) ? pageSize : DEFAULT_CACHE_SIZE);
  initTrace(resource,path,CustomXmlEvent.class);
}