nus-yam/ex-repair huggingface dataset:
Program: 92084
Project: 92084
Buggy source:
/** 
 * zoom in using single click
 */
public void zoomIn(){
  long _time0=_timeProvider.getTime0();
  long _time1=_timeProvider.getTime1();
  long _range=_time1 - _time0;
  long selTime=_timeProvider.getSelectedTime();
  if (selTime <= _time0 || selTime >= _time1) {
    selTime=(_time0 + _time1) / 2;
  }
  long time0=selTime - (long)((selTime - _time0) / zoomCoeff);
  long time1=selTime + (long)((_time1 - selTime) / zoomCoeff);
  long inaccuracy=(_timeProvider.getMaxTime() - _timeProvider.getMinTime()) - (time1 - time0);
  if (inaccuracy > 0 && inaccuracy < 100) {
    _timeProvider.setStartFinishTimeNotify(_timeProvider.getMinTime(),_timeProvider.getMaxTime());
    return;
  }
  long m=_timeProvider.getMinTimeInterval();
  if ((time1 - time0) < m) {
    time0=selTime - (selTime - _time0) * m / _range;
    time1=time0 + m;
  }
  _timeProvider.setStartFinishTimeNotify(time0,time1);
}

Fixed version (ground truth):
/** 
 * zoom in using single click
 */
public void zoomIn(){
  long _time0=_timeProvider.getTime0();
  long _time1=_timeProvider.getTime1();
  long _range=_time1 - _time0;
  if (_range == 0) {
    return;
  }
  long selTime=_timeProvider.getSelectedTime();
  if (selTime <= _time0 || selTime >= _time1) {
    selTime=(_time0 + _time1) / 2;
  }
  long time0=selTime - (long)((selTime - _time0) / zoomCoeff);
  long time1=selTime + (long)((_time1 - selTime) / zoomCoeff);
  long inaccuracy=(_timeProvider.getMaxTime() - _timeProvider.getMinTime()) - (time1 - time0);
  if (inaccuracy > 0 && inaccuracy < 100) {
    _timeProvider.setStartFinishTimeNotify(_timeProvider.getMinTime(),_timeProvider.getMaxTime());
    return;
  }
  long m=_timeProvider.getMinTimeInterval();
  if ((time1 - time0) < m) {
    time0=selTime - (selTime - _time0) * m / _range;
    time1=time0 + m;
  }
  _timeProvider.setStartFinishTimeNotify(time0,time1);
}
Program: 92087
Project: 92087
Buggy source:
private void stopmodule(DashboardModule module){
  IViewPart ivp=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(ActiveModuleBrowserView.ID);
  ActiveModuleBrowserView ambv=(ActiveModuleBrowserView)ivp;
  GraphTreeNode graphNode;
  DashboardGraphData graphData;
  if (ambv.isActive(module)) {
    ActiveModuleTreeNode node=ambv.remove(module);
    ActiveModuleData amd=(ActiveModuleData)node.getData();
    ivp=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(DashboardView.ID);
    DashboardView dv=(DashboardView)ivp;
    for (int i=0; i < node.getChildCount(); i++) {
      graphNode=(GraphTreeNode)node.getChildAt(i);
      graphData=(DashboardGraphData)graphNode.getData();
      if (null != graphData.adapter) {
        dv.removeGraph(graphData.adapter,module.getcategory());
        graphData.adapter=null;
      }
    }
    if (!amd.paused) {
      if (amd.cmd.isRunning())       amd.cmd.stop();
      amd.data=null;
    }
    dv.closeComposite(amd.module.category);
    amd=null;
    fireActionEvent();
  }
  setEnablement(false);
  buildEnablementChecks();
}

Fixed version (ground truth):
private void stopmodule(DashboardModule module){
  IViewPart ivp=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(ActiveModuleBrowserView.ID);
  ActiveModuleBrowserView ambv=(ActiveModuleBrowserView)ivp;
  GraphTreeNode graphNode;
  DashboardGraphData graphData;
  if (ambv.isActive(module)) {
    ActiveModuleTreeNode node=ambv.remove(module);
    ActiveModuleData amd=(ActiveModuleData)node.getData();
    ivp=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(DashboardView.ID);
    DashboardView dv=(DashboardView)ivp;
    for (int i=0; i < node.getChildCount(); i++) {
      graphNode=(GraphTreeNode)node.getChildAt(i);
      graphData=(DashboardGraphData)graphNode.getData();
      if (null != graphData.adapter) {
        dv.removeGraph(graphData.adapter,module.getcategory());
        graphData.adapter=null;
      }
    }
    if (!amd.paused) {
      if (amd.cmd.isRunning()) {
        amd.cmd.stop();
      }
      amd.data=null;
    }
    dv.closeComposite(amd.module.category);
    amd=null;
    fireActionEvent();
  }
  setEnablement(false);
  buildEnablementChecks();
}
Program: 92088
Project: 92088
Buggy source:
/** 
 * This method fires the event when a module is run to every listener that is registered.
 */
private static void fireActionEvent(){
  for (int i=0; i < listeners.size(); i++)   listeners.get(i).handleActionEvent();
}

Fixed version (ground truth):
/** 
 * This method fires the event when a module is run to every listener that is registered.
 */
private static void fireActionEvent(){
  for (int i=0; i < listeners.size(); i++) {
    listeners.get(i).handleActionEvent();
  }
}
Program: 92089
Project: 92089
Buggy source:
public void performCommand(String[] cmd,int fd){
  BufferedReader buff=null;
  BufferedReader bufftmp=null;
  try {
    Process proc=RuntimeProcessFactory.getFactory().exec(cmd,null);
switch (fd) {
case 1:
      buff=new BufferedReader(new InputStreamReader(proc.getInputStream()));
    bufftmp=new BufferedReader(new InputStreamReader(proc.getErrorStream()));
  break;
case 2:
buff=new BufferedReader(new InputStreamReader(proc.getErrorStream()));
bufftmp=new BufferedReader(new InputStreamReader(proc.getInputStream()));
break;
default :
buff=new BufferedReader(new InputStreamReader(proc.getInputStream()));
bufftmp=new BufferedReader(new InputStreamReader(proc.getErrorStream()));
}
StringBuffer strBuff=new StringBuffer();
String line="String_Node_Str";
while (bufftmp.readLine() != null) {
}
while ((line=buff.readLine()) != null) {
strBuff.append(line);
strBuff.append("String_Node_Str");
}
text=strBuff.toString();
}
 catch (IOException e) {
text="String_Node_Str";
}
 finally {
try {
if (buff != null) {
buff.close();
}
if (bufftmp != null) {
bufftmp.close();
}
}
 catch (IOException e) {
}
}
}

Fixed version (ground truth):
public void performCommand(String[] cmd,int fd){
  BufferedReader buffData=null;
  BufferedReader buffTmp=null;
  try {
    Process proc=RuntimeProcessFactory.getFactory().exec(cmd,null);
    StringBuffer strBuffData=new StringBuffer();
    StringBuffer strBuffTmp=new StringBuffer();
    String line="String_Node_Str";
switch (fd) {
case 1:
      buffData=new BufferedReader(new InputStreamReader(proc.getInputStream()));
    buffTmp=new BufferedReader(new InputStreamReader(proc.getErrorStream()));
  while ((line=buffData.readLine()) != null) {
    strBuffData.append(line);
    strBuffData.append("String_Node_Str");
  }
while ((line=buffTmp.readLine()) != null) {
  strBuffTmp.append(line);
  strBuffTmp.append("String_Node_Str");
}
break;
case 2:
buffData=new BufferedReader(new InputStreamReader(proc.getErrorStream()));
buffTmp=new BufferedReader(new InputStreamReader(proc.getInputStream()));
while ((line=buffTmp.readLine()) != null) {
strBuffTmp.append(line);
strBuffTmp.append("String_Node_Str");
}
while ((line=buffData.readLine()) != null) {
strBuffData.append(line);
strBuffData.append("String_Node_Str");
}
break;
default :
buffData=new BufferedReader(new InputStreamReader(proc.getInputStream()));
buffTmp=new BufferedReader(new InputStreamReader(proc.getErrorStream()));
while ((line=buffData.readLine()) != null) {
strBuffData.append(line);
strBuffData.append("String_Node_Str");
}
while ((line=buffTmp.readLine()) != null) {
strBuffTmp.append(line);
strBuffTmp.append("String_Node_Str");
}
}
text=strBuffData.toString();
}
 catch (IOException e) {
text="String_Node_Str";
}
 finally {
try {
if (buffData != null) {
buffData.close();
}
if (buffTmp != null) {
buffTmp.close();
}
}
 catch (IOException e) {
}
}
}
Program: 92090
Project: 92090
Buggy source:
public static int openError(String title,Exception e){
  Status status=new Status(IStatus.ERROR,StructuresPlugin.PLUGIN_ID,title,e);
  StringWriter writer=new StringWriter();
  e.printStackTrace(new PrintWriter(writer));
  return ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),title,writer.toString(),status);
}

Fixed version (ground truth):
public static int openError(String message,Exception e){
  StringWriter writer=new StringWriter();
  e.printStackTrace(new PrintWriter(writer));
  Status status=new Status(IStatus.ERROR,StructuresPlugin.PLUGIN_ID,e.toString(),new Throwable(writer.toString()));
  return ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),message,message,status);
}
Program: 92093
Project: 92093
Buggy source:
@Override protected URI oprofileWorkingDirURI(){
  return oprofileProject().getLocationURI();
}

Fixed version (ground truth):
@Override protected URI oprofileWorkingDirURI(ILaunchConfiguration config){
  return oprofileProject().getLocationURI();
}
Program: 92095
Project: 92095
Buggy source:
/** 
 * Return the URI of the current working directory from the current project's file proxy.
 * @return URI URI of the working directory.
 * @throws CoreException
 */
protected URI oprofileWorkingDirURI() throws CoreException {
  IRemoteFileProxy proxy=RemoteProxyManager.getInstance().getFileProxy(oprofileProject());
  return proxy.getWorkingDir();
}

Fixed version (ground truth):
/** 
 * Return the URI of the current working directory from the current project's file proxy.
 * @return URI URI of the working directory.
 * @throws CoreException
 */
protected URI oprofileWorkingDirURI(ILaunchConfiguration config) throws CoreException {
  File workingDirectory=this.getWorkingDirectory(config);
  if (workingDirectory == null) {
    return getProject().getLocationURI();
  }
 else {
    URI uri=null;
    try {
      uri=new URI(workingDirectory.getAbsolutePath());
    }
 catch (    URISyntaxException e) {
      Status status=new Status(IStatus.ERROR,OprofileCorePlugin.getId(),OprofileLaunchMessages.getString("String_Node_Str"));
      throw new CoreException(status);
    }
    return uri;
  }
}
Program: 92096
Project: 92096
Buggy source:
/** 
 * Given data, extract <tapset>
 * @param data - hint data
 * @return
 */
private String getTapset(String data){
  int i=data.indexOf('.');
  if (i < 0)   throw new StringIndexOutOfBoundsException();
  return data.substring(0,data.indexOf('.'));
}

Fixed version (ground truth):
/** 
 * Given data, extract <tapset>
 * @param data - hint data
 * @return
 */
private String getTapset(String data){
  int i=data.indexOf('.');
  if (i < 0) {
    return data;
  }
  return data.substring(0,data.indexOf('.'));
}
Program: 92097
Project: 92097
Buggy source:
@Override public synchronized void resume(){
  super.resume();
  monitor.notifyAll();
}

Fixed version (ground truth):
@Override public synchronized void resume(){
  super.resume();
synchronized (monitor) {
    monitor.notifyAll();
  }
}
Program: 92099
Project: 92099
Buggy source:
@Override public void run(){
  TmfCoreTracer.traceRequest(fRequest,"String_Node_Str" + fProvider.getName());
  fRequest.start();
  long nbRequested=fRequest.getNbRequested();
  int nbRead=0;
  isCompleted=false;
  ITmfContext context=fProvider.armRequest(fRequest);
  if (context == null) {
    fRequest.cancel();
    return;
  }
  try {
    ITmfEvent event=fProvider.getNext(context);
    TmfCoreTracer.traceRequest(fRequest,"String_Node_Str");
    while (event != null && !fProvider.isCompleted(fRequest,event,nbRead)) {
      if (isPaused) {
        try {
          while (isPaused) {
synchronized (object) {
              object.wait();
            }
          }
        }
 catch (        InterruptedException e) {
        }
      }
      TmfCoreTracer.traceEvent(fProvider,fRequest,event);
      fRequest.handleEvent(event);
      if (++nbRead < nbRequested) {
        event=fProvider.getNext(context);
      }
    }
    isCompleted=true;
    if (fRequest.isCancelled()) {
      fRequest.cancel();
    }
 else {
      fRequest.done();
    }
  }
 catch (  Exception e) {
    fRequest.fail();
  }
  context.dispose();
}

Fixed version (ground truth):
@Override public void run(){
  TmfCoreTracer.traceRequest(fRequest,"String_Node_Str" + fProvider.getName());
  fRequest.start();
  long nbRequested=fRequest.getNbRequested();
  int nbRead=0;
  isCompleted=false;
  ITmfContext context=fProvider.armRequest(fRequest);
  if (context == null) {
    fRequest.cancel();
    return;
  }
  try {
    ITmfEvent event=fProvider.getNext(context);
    TmfCoreTracer.traceRequest(fRequest,"String_Node_Str");
    while (event != null && !fProvider.isCompleted(fRequest,event,nbRead)) {
      while (isPaused) {
        try {
synchronized (object) {
            if (isPaused) {
              object.wait();
            }
          }
        }
 catch (        InterruptedException e) {
        }
      }
      TmfCoreTracer.traceEvent(fProvider,fRequest,event);
      fRequest.handleEvent(event);
      if (++nbRead < nbRequested) {
        event=fProvider.getNext(context);
      }
    }
    isCompleted=true;
    if (fRequest.isCancelled()) {
      fRequest.cancel();
    }
 else {
      fRequest.done();
    }
  }
 catch (  Exception e) {
    fRequest.fail();
  }
  context.dispose();
}
Program: 92100
Project: 92100
Buggy source:
@Override public void notifyParent(ITmfRequest child){
  if (--fNbSubRequests <= 0) {
    done();
    super.notifyParent(this);
  }
}

Fixed version (ground truth):
@Override public synchronized void notifyParent(ITmfRequest child){
  if (--fNbSubRequests <= 0) {
    done();
    super.notifyParent(this);
  }
}
Program: 92101
Project: 92101
Buggy source:
/** 
 * @param pattern the new default time pattern
 */
public static void setDefaultTimeFormat(final String pattern){
  fDefaultTimePattern=pattern;
  fDefaultTimeFormat=new TmfTimestampFormat(fDefaultTimePattern);
  TmfSignalManager.dispatchSignal(new TmfTimestampFormatUpdateSignal(null));
}

Fixed version (ground truth):
/** 
 * @param pattern the new default time pattern
 */
public static synchronized void setDefaultTimeFormat(final String pattern){
  fDefaultTimePattern=pattern;
  fDefaultTimeFormat=new TmfTimestampFormat(fDefaultTimePattern);
  TmfSignalManager.dispatchSignal(new TmfTimestampFormatUpdateSignal(null));
}
Program: 92102
Project: 92102
Buggy source:
/** 
 * @return the default time format pattern
 */
public static TmfTimestampFormat getDefaulTimeFormat(){
  if (fDefaultTimeFormat == null) {
    fDefaultTimeFormat=new TmfTimestampFormat(DEFAULT_TIME_PATTERN);
  }
  return fDefaultTimeFormat;
}

Fixed version (ground truth):
/** 
 * @return the default time format pattern
 */
public static synchronized TmfTimestampFormat getDefaulTimeFormat(){
  if (fDefaultTimeFormat == null) {
    fDefaultTimeFormat=new TmfTimestampFormat(DEFAULT_TIME_PATTERN);
  }
  return fDefaultTimeFormat;
}
Program: 92103
Project: 92103
Buggy source:
/** 
 * @return the default interval format pattern
 */
public static TmfTimestampFormat getDefaulIntervalFormat(){
  if (fDefaultIntervalFormat == null) {
    fDefaultIntervalFormat=new TmfTimestampFormat(DEFAULT_INTERVAL_PATTERN);
  }
  return fDefaultIntervalFormat;
}

Fixed version (ground truth):
/** 
 * @return the default interval format pattern
 */
public static synchronized TmfTimestampFormat getDefaulIntervalFormat(){
  if (fDefaultIntervalFormat == null) {
    fDefaultIntervalFormat=new TmfTimestampFormat(DEFAULT_INTERVAL_PATTERN);
  }
  return fDefaultIntervalFormat;
}
Program: 92104
Project: 92104
Buggy source:
/** 
 * @param pattern the new default interval pattern
 */
public static void setDefaultIntervalFormat(final String pattern){
  fDefaultIntervalPattern=pattern;
  fDefaultIntervalFormat=new TmfTimestampFormat(fDefaultIntervalPattern);
  TmfSignalManager.dispatchSignal(new TmfTimestampFormatUpdateSignal(null));
}

Fixed version (ground truth):
/** 
 * @param pattern the new default interval pattern
 */
public static synchronized void setDefaultIntervalFormat(final String pattern){
  fDefaultIntervalPattern=pattern;
  fDefaultIntervalFormat=new TmfTimestampFormat(fDefaultIntervalPattern);
  TmfSignalManager.dispatchSignal(new TmfTimestampFormatUpdateSignal(null));
}
Program: 92105
Project: 92105
Buggy source:
/** 
 * Handler for the range sync signal
 * @param signal The signal that's received
 */
@TmfSignalHandler public void synchToRange(final TmfRangeSynchSignal signal){
  if (signal.getSource() == this || fTrace == null) {
    return;
  }
  final long startTime=signal.getCurrentRange().getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  final long endTime=signal.getCurrentRange().getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  final long time=signal.getCurrentTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphCombo.isDisposed()) {
        return;
      }
      fTimeGraphCombo.getTimeGraphViewer().setStartFinishTime(startTime,endTime);
      fTimeGraphCombo.getTimeGraphViewer().setSelectedTime(time,false);
      startZoomThread(startTime,endTime);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Handler for the range sync signal
 * @param signal The signal that's received
 */
@TmfSignalHandler public void synchToRange(final TmfRangeSynchSignal signal){
  if (signal.getSource() == this || fTrace == null) {
    return;
  }
  if (signal.getCurrentRange().getIntersection(fTrace.getTimeRange()) == null) {
    return;
  }
  final long startTime=signal.getCurrentRange().getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  final long endTime=signal.getCurrentRange().getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  final long time=signal.getCurrentTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphCombo.isDisposed()) {
        return;
      }
      fTimeGraphCombo.getTimeGraphViewer().setStartFinishTime(startTime,endTime);
      fTimeGraphCombo.getTimeGraphViewer().setSelectedTime(time,false);
      startZoomThread(startTime,endTime);
    }
  }
);
}
Program: 92106
Project: 92106
Buggy source:
/** 
 * Handler for the RangeSynch signal
 * @param signal The incoming signal
 */
@TmfSignalHandler public void synchToRange(final TmfRangeSynchSignal signal){
  if (signal.getSource() == this || fTrace == null) {
    return;
  }
  final long startTime=signal.getCurrentRange().getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  final long endTime=signal.getCurrentRange().getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  final long time=signal.getCurrentTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphViewer.getControl().isDisposed()) {
        return;
      }
      fTimeGraphViewer.setStartFinishTime(startTime,endTime);
      fTimeGraphViewer.setSelectedTime(time,false);
      startZoomThread(startTime,endTime);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Handler for the RangeSynch signal
 * @param signal The incoming signal
 */
@TmfSignalHandler public void synchToRange(final TmfRangeSynchSignal signal){
  if (signal.getSource() == this || fTrace == null) {
    return;
  }
  if (signal.getCurrentRange().getIntersection(fTrace.getTimeRange()) == null) {
    return;
  }
  final long startTime=signal.getCurrentRange().getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  final long endTime=signal.getCurrentRange().getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  final long time=signal.getCurrentTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphViewer.getControl().isDisposed()) {
        return;
      }
      fTimeGraphViewer.setStartFinishTime(startTime,endTime);
      fTimeGraphViewer.setSelectedTime(time,false);
      startZoomThread(startTime,endTime);
    }
  }
);
}
Program: 92107
Project: 92107
Buggy source:
/** 
 * Broadcast TmfSignal about new selected time range.
 * @param newDuration new duration (relative to current start time)
 */
public synchronized void updateTimeRange(long newDuration){
  if (fTrace != null) {
    long delta=newDuration - fWindowSpan;
    long newStartTime=fWindowStartTime + (delta / 2);
    setNewRange(newStartTime,newDuration);
  }
}

Fixed version (ground truth):
/** 
 * Broadcast TmfSignal about new selected time range.
 * @param newDuration new duration (relative to current start time)
 */
public synchronized void updateTimeRange(long newDuration){
  if (fTrace != null) {
    long delta=newDuration - fWindowSpan;
    long newStartTime=fWindowStartTime - (delta / 2);
    setNewRange(newStartTime,newDuration);
  }
}
Program: 92108
Project: 92108
Buggy source:
private void setNewRange(long startTime,long duration){
  if (startTime < fTraceStartTime) {
    startTime=fTraceStartTime;
  }
  long endTime=startTime + duration;
  if (endTime > fTraceEndTime) {
    endTime=fTraceEndTime;
    if ((endTime - duration) > fTraceEndTime) {
      startTime=endTime - duration;
    }
 else {
      startTime=fTraceStartTime;
    }
  }
  updateTimeRange(startTime,endTime);
}

Fixed version (ground truth):
private void setNewRange(long startTime,long duration){
  if (startTime < fTraceStartTime) {
    startTime=fTraceStartTime;
  }
  long endTime=startTime + duration;
  if (endTime > fTraceEndTime) {
    endTime=fTraceEndTime;
    if ((endTime - duration) > fTraceStartTime) {
      startTime=endTime - duration;
    }
 else {
      startTime=fTraceStartTime;
    }
  }
  updateTimeRange(startTime,endTime);
}
Program: 92109
Project: 92109
Buggy source:
/** 
 * Updates the current time range in the time range histogram and full range histogram.
 * @param signal the signal to process
 */
@TmfSignalHandler public void timeRangeUpdated(TmfRangeSynchSignal signal){
  assert(signal != null);
  if (fTrace != null) {
    fWindowStartTime=signal.getCurrentRange().getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
    fWindowEndTime=signal.getCurrentRange().getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
    fWindowSpan=fWindowEndTime - fWindowStartTime;
    sendTimeRangeRequest(fWindowStartTime,fWindowEndTime);
    fFullTraceHistogram.setTimeRange(fWindowStartTime,fWindowSpan);
    fTimeSpanControl.setValue(fWindowSpan);
  }
}

Fixed version (ground truth):
/** 
 * Updates the current time range in the time range histogram and full range histogram.
 * @param signal the signal to process
 */
@TmfSignalHandler public void timeRangeUpdated(TmfRangeSynchSignal signal){
  assert(signal != null);
  if (fTrace != null) {
    TmfTimeRange range=signal.getCurrentRange().getIntersection(fTrace.getTimeRange());
    if (range == null) {
      return;
    }
    fWindowStartTime=range.getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
    fWindowEndTime=range.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
    fWindowSpan=fWindowEndTime - fWindowStartTime;
    sendTimeRangeRequest(fWindowStartTime,fWindowEndTime);
    fFullTraceHistogram.setTimeRange(fWindowStartTime,fWindowSpan);
    fTimeSpanControl.setValue(fWindowSpan);
  }
}
Program: 92110
Project: 92110
Buggy source:
protected void packColumns(){
  if (fPackDone) {
    return;
  }
  for (  final TableColumn column : fTable.getColumns()) {
    final int headerWidth=column.getWidth();
    column.pack();
    if (column.getWidth() < headerWidth) {
      column.setWidth(headerWidth);
    }
  }
  fPackDone=true;
}

Fixed version (ground truth):
protected void packColumns(){
  if (fPackDone) {
    return;
  }
  boolean isLinux=System.getProperty("String_Node_Str").contains("String_Node_Str") ? true : false;
  TableColumn tableColumns[]=fTable.getColumns();
  for (int i=0; i < tableColumns.length; i++) {
    final TableColumn column=tableColumns[i];
    final int headerWidth=column.getWidth();
    column.pack();
    if (isLinux && (i == 0)) {
      column.setWidth(column.getWidth() + SEARCH_IMAGE.getBounds().width);
    }
    if (column.getWidth() < headerWidth) {
      column.setWidth(headerWidth);
    }
  }
  fPackDone=true;
}
Program: 92111
Project: 92111
Buggy source:
@Override public void run(){
  if (!fCanvas.isDisposed()) {
    final int canvasWidth=fCanvas.getBounds().width;
    final int canvasHeight=fCanvas.getBounds().height;
    if (canvasWidth <= 0 || canvasHeight <= 0) {
      return;
    }
    fDataModel.setCurrentEvent(fCurrentEventTime);
    fScaledData=fDataModel.scaleTo(canvasWidth,canvasHeight,1);
synchronized (fScaledData) {
      if (fScaledData != null) {
        fCanvas.redraw();
        fTimeRangeStartText.setText(TmfTimestampFormat.getDefaulTimeFormat().format(fDataModel.getFirstBucketTime()));
        fTimeRangeEndText.setText(TmfTimestampFormat.getDefaulTimeFormat().format(fDataModel.getEndTime()));
        fMaxNbEventsText.setText(Long.toString(fScaledData.fMaxValue));
        fMaxNbEventsText.getParent().layout();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (!fCanvas.isDisposed()) {
    final int canvasWidth=fCanvas.getBounds().width;
    final int canvasHeight=fCanvas.getBounds().height;
    if (canvasWidth <= 0 || canvasHeight <= 0) {
      return;
    }
    fDataModel.setCurrentEvent(fCurrentEventTime);
    fScaledData=fDataModel.scaleTo(canvasWidth,canvasHeight,1);
synchronized (fDataModel) {
      if (fScaledData != null) {
        fCanvas.redraw();
        fTimeRangeStartText.setText(TmfTimestampFormat.getDefaulTimeFormat().format(fDataModel.getFirstBucketTime()));
        fTimeRangeEndText.setText(TmfTimestampFormat.getDefaulTimeFormat().format(fDataModel.getEndTime()));
        fMaxNbEventsText.setText(Long.toString(fScaledData.fMaxValue));
        fMaxNbEventsText.getParent().layout();
      }
    }
  }
}
Program: 92112
Project: 92112
Buggy source:
/** 
 * Clear the histogram and reset the data
 */
public void clear(){
  fDataModel.clear();
  fScaledData=null;
}

Fixed version (ground truth):
/** 
 * Clear the histogram and reset the data
 */
public void clear(){
  fDataModel.clear();
synchronized (fDataModel) {
    fScaledData=null;
  }
}
Program: 92113
Project: 92113
Buggy source:
/** 
 * Refresh the histogram display
 */
@Override public void modelUpdated(){
  if (!fCanvas.isDisposed() && fCanvas.getDisplay() != null) {
    fCanvas.getDisplay().asyncExec(new Runnable(){
      @Override public void run(){
        if (!fCanvas.isDisposed()) {
          final int canvasWidth=fCanvas.getBounds().width;
          final int canvasHeight=fCanvas.getBounds().height;
          if (canvasWidth <= 0 || canvasHeight <= 0) {
            return;
          }
          fDataModel.setCurrentEvent(fCurrentEventTime);
          fScaledData=fDataModel.scaleTo(canvasWidth,canvasHeight,1);
synchronized (fScaledData) {
            if (fScaledData != null) {
              fCanvas.redraw();
              fTimeRangeStartText.setText(TmfTimestampFormat.getDefaulTimeFormat().format(fDataModel.getFirstBucketTime()));
              fTimeRangeEndText.setText(TmfTimestampFormat.getDefaulTimeFormat().format(fDataModel.getEndTime()));
              fMaxNbEventsText.setText(Long.toString(fScaledData.fMaxValue));
              fMaxNbEventsText.getParent().layout();
            }
          }
        }
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Refresh the histogram display
 */
@Override public void modelUpdated(){
  if (!fCanvas.isDisposed() && fCanvas.getDisplay() != null) {
    fCanvas.getDisplay().asyncExec(new Runnable(){
      @Override public void run(){
        if (!fCanvas.isDisposed()) {
          final int canvasWidth=fCanvas.getBounds().width;
          final int canvasHeight=fCanvas.getBounds().height;
          if (canvasWidth <= 0 || canvasHeight <= 0) {
            return;
          }
          fDataModel.setCurrentEvent(fCurrentEventTime);
          fScaledData=fDataModel.scaleTo(canvasWidth,canvasHeight,1);
synchronized (fDataModel) {
            if (fScaledData != null) {
              fCanvas.redraw();
              fTimeRangeStartText.setText(TmfTimestampFormat.getDefaulTimeFormat().format(fDataModel.getFirstBucketTime()));
              fTimeRangeEndText.setText(TmfTimestampFormat.getDefaulTimeFormat().format(fDataModel.getEndTime()));
              fMaxNbEventsText.setText(Long.toString(fScaledData.fMaxValue));
              fMaxNbEventsText.getParent().layout();
            }
          }
        }
      }
    }
);
  }
}
Program: 92114
Project: 92114
Buggy source:
@Override protected void updateValue(){
  String string=fTextValue.getText();
  long value=0;
  try {
    value=TmfTimestampFormat.getDefaulTimeFormat().parseValue(string,fTraceStartTime);
  }
 catch (  ParseException e) {
  }
  if (getValue() != value) {
    ITmfTrace trace=fParentView.getTrace();
    if (trace != null) {
      TmfTimeRange range=trace.getTimeRange();
      long startTime=range.getStartTime().getValue();
      long endTime=range.getEndTime().getValue();
      if (value < startTime) {
        value=startTime;
      }
 else       if (value > endTime) {
        value=endTime;
      }
    }
    setValue(value);
    fParentView.updateCurrentEventTime(value);
  }
}

Fixed version (ground truth):
@Override protected void updateValue(){
  String string=fTextValue.getText();
  long value=0;
  try {
    value=TmfTimestampFormat.getDefaulTimeFormat().parseValue(string,fTraceStartTime);
  }
 catch (  ParseException e) {
  }
  if (getValue() != value) {
    ITmfTrace trace=fParentView.getTrace();
    if (trace != null) {
      TmfTimeRange range=trace.getTimeRange();
      long startTime=range.getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
      long endTime=range.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
      if (value < startTime) {
        value=startTime;
      }
 else       if (value > endTime) {
        value=endTime;
      }
    }
    setValue(value);
    fParentView.updateCurrentEventTime(value);
  }
}
Program: 92115
Project: 92115
Buggy source:
@Override public void setFocus(){
  refresh(INITIAL_WINDOW_OFFSET);
  fTimeGraphViewer.setFocus();
}

Fixed version (ground truth):
@Override public void setFocus(){
  fTimeGraphViewer.setFocus();
}
Program: 92116
Project: 92116
Buggy source:
@Override public void mouseUp(MouseEvent event){
  if (fMouseDown) {
    fMouseDown=false;
    if (event.x == fStartPosition) {
      super.mouseDown(event);
      return;
    }
    ((HistogramView)fParentView).updateTimeRange(fRangeStartTime,fRangeStartTime + fZoom.getDuration());
  }
}

Fixed version (ground truth):
@Override public void mouseUp(MouseEvent event){
  if (fMouseDown) {
    fMouseDown=false;
    if (event.x == fStartPosition) {
      super.mouseDown(event);
      return;
    }
    ((HistogramView)fParentView).updateTimeRange(fRangeStartTime,fRangeStartTime + fRangeDuration);
  }
}
Program: 92117
Project: 92117
Buggy source:
/** 
 * Handles the trace updated signal. Used to update time limits (start and end time)
 * @param signal the trace updated signal
 * @since 2.0
 */
@TmfSignalHandler public void traceUpdated(TmfTraceUpdatedSignal signal){
  if (signal.getTrace() != fTrace) {
    return;
  }
  TmfTimeRange fullRange=signal.getTrace().getTimeRange();
  fTraceStartTime=fullRange.getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  fTraceEndTime=fullRange.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  fFullTraceHistogram.setFullRange(fTraceStartTime,fTraceEndTime);
  fTimeRangeHistogram.setFullRange(fTraceStartTime,fTraceEndTime);
  if ((fFullTraceRequest != null) && fFullTraceRequest.getRange().getEndTime().compareTo(signal.getRange().getEndTime()) < 0) {
    sendFullRangeRequest(fullRange);
  }
}

Fixed version (ground truth):
/** 
 * Handles the trace updated signal. Used to update time limits (start and end time)
 * @param signal the trace updated signal
 * @since 2.0
 */
@TmfSignalHandler public void traceUpdated(TmfTraceUpdatedSignal signal){
  if (signal.getTrace() != fTrace) {
    return;
  }
  TmfTimeRange fullRange=signal.getTrace().getTimeRange();
  fTraceStartTime=fullRange.getStartTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  fTraceEndTime=fullRange.getEndTime().normalize(0,ITmfTimestamp.NANOSECOND_SCALE).getValue();
  fFullTraceHistogram.setFullRange(fTraceStartTime,fTraceEndTime);
  fTimeRangeHistogram.setFullRange(fTraceStartTime,fTraceEndTime);
  fFullTraceHistogram.setTimeRange(fTimeRangeHistogram.getStartTime(),fWindowSpan);
  if ((fFullTraceRequest != null) && fFullTraceRequest.getRange().getEndTime().compareTo(signal.getRange().getEndTime()) < 0) {
    sendFullRangeRequest(fullRange);
  }
}
Program: 92118
Project: 92118
Buggy source:
@Override public void resetStartFinishTime(){
  setStartFinishTimeNotify(_time0_,_time1_);
  _timeRangeFixed=false;
}

Fixed version (ground truth):
@Override public void resetStartFinishTime(){
  setStartFinishTime(_time0_,_time1_);
  _timeRangeFixed=false;
}
Program: 92119
Project: 92119
Buggy source:
@Override public void mouseDoubleClick(MouseEvent e){
  if (e.button == 1 && null != _timeProvider && _timeProvider.getTime0() != _timeProvider.getTime1() && (e.stateMask & SWT.BUTTON_MASK) == 0) {
    _timeProvider.resetStartFinishTime();
    _time0bak=_timeProvider.getTime0();
    _time1bak=_timeProvider.getTime1();
  }
}

Fixed version (ground truth):
@Override public void mouseDoubleClick(MouseEvent e){
  if (e.button == 1 && null != _timeProvider && _timeProvider.getTime0() != _timeProvider.getTime1() && (e.stateMask & SWT.BUTTON_MASK) == 0) {
    _timeProvider.resetStartFinishTime();
    _timeProvider.notifyStartFinishTime();
    _time0bak=_timeProvider.getTime0();
    _time1bak=_timeProvider.getTime1();
  }
}
Program: 92121
Project: 92121
Buggy source:
/** 
 * Get id of default profiling launch shortcut that provides the type  of profiling. This looks through extensions of the <code>org.eclipse.linuxtools.profiling.launch.launchProvider</code> extension point that have a specific type attribute.
 * @param type A profiling type (eg. memory, snapshot, timing, etc.)
 * @return an id of the profiling launch shortcut that implements<code>ProfileLaunchShortcut</code> and provides the necessary profiling type, or <code>null</code> if none could be found.
 * @since 1.2
 */
public static String getDefaultLaunchShortcutProviderId(String type){
  IExtensionPoint extPoint=Platform.getExtensionRegistry().getExtensionPoint(ProfileLaunchPlugin.PLUGIN_ID,"String_Node_Str");
  IConfigurationElement[] configs=extPoint.getConfigurationElements();
  for (  IConfigurationElement config : configs) {
    if (config.getName().equals("String_Node_Str")) {
      String currentType=config.getAttribute("String_Node_Str");
      String shortcut=config.getAttribute("String_Node_Str");
      if (currentType != null && shortcut != null && currentType.equals(type)) {
        String isDefault=config.getAttribute("String_Node_Str");
        if (isDefault != null && isDefault.equals("String_Node_Str")) {
          try {
            Object obj=config.createExecutableExtension("String_Node_Str");
            if (obj instanceof ProfileLaunchShortcut) {
              return config.getAttribute("String_Node_Str");
            }
          }
 catch (          CoreException e) {
          }
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get id of default profiling launch shortcut that provides the type  of profiling. This looks through extensions of the <code>org.eclipse.linuxtools.profiling.launch.launchProvider</code> extension point that have a specific type attribute.
 * @param type A profiling type (eg. memory, snapshot, timing, etc.)
 * @return an id of the profiling launch shortcut that implements<code>ProfileLaunchShortcut</code> and provides the necessary profiling type, or <code>null</code> if none could be found.
 * @since 1.2
 */
public static String getDefaultLaunchShortcutProviderId(String type){
  ArrayList<IConfigurationElement> list=getOrderedConfigElements(type);
  for (  IConfigurationElement config : list) {
    try {
      Object obj=config.createExecutableExtension("String_Node_Str");
      if (obj instanceof ProfileLaunchShortcut) {
        return config.getAttribute("String_Node_Str");
      }
    }
 catch (    CoreException e) {
    }
  }
  return null;
}
Program: 92123
Project: 92123
Buggy source:
@Override protected void createFieldEditors(){
  HashMap<String,String> map=ProfileLaunchConfigurationTabGroup.getProviderNamesForType(type);
  String[][] providerList=new String[map.size()][2];
  int i=0;
  for (  Entry<String,String> entry : map.entrySet()) {
    providerList[i][0]=entry.getKey();
    providerList[i][1]=entry.getValue();
    i++;
  }
  RadioGroupFieldEditor editor=new RadioGroupFieldEditor(ProviderProfileConstants.PREFS_KEY,Messages.ProviderPreferencesPage_1,1,providerList,getFieldEditorParent());
  addField(editor);
}

Fixed version (ground truth):
@Override protected void createFieldEditors(){
  String providerId=ProfileLaunchShortcut.getDefaultLaunchShortcutProviderId(type);
  getPreferenceStore().setDefault(ProviderProfileConstants.PREFS_KEY,providerId);
  HashMap<String,String> map=ProfileLaunchConfigurationTabGroup.getProviderNamesForType(type);
  String[][] providerList=new String[map.size()][2];
  int i=0;
  for (  Entry<String,String> entry : map.entrySet()) {
    providerList[i][0]=entry.getKey();
    providerList[i][1]=entry.getValue();
    i++;
  }
  RadioGroupFieldEditor editor=new RadioGroupFieldEditor(ProviderProfileConstants.PREFS_KEY,Messages.ProviderPreferencesPage_1,1,providerList,getFieldEditorParent());
  editor.setPreferenceStore(getPreferenceStore());
  addField(editor);
}
Program: 92124
Project: 92124
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public boolean filter(List<?> filters){
  fLock.lock();
  try {
    cancelOngoingRequests();
    List<FilterCriteria> list=(List<FilterCriteria>)filters;
    fFilterCriteria=new ArrayList<FilterCriteria>(list);
    fillCurrentPage(fEvents);
  }
  finally {
    fLock.unlock();
  }
  return true;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public boolean filter(List<?> filters){
  fLock.lock();
  try {
    cancelOngoingRequests();
    if (filters == null) {
      fFilterCriteria=new ArrayList<FilterCriteria>();
    }
 else {
      List<FilterCriteria> list=(List<FilterCriteria>)filters;
      fFilterCriteria=new ArrayList<FilterCriteria>(list);
    }
    fillCurrentPage(fEvents);
  }
  finally {
    fLock.unlock();
  }
  return true;
}
Program: 92126
Project: 92126
Buggy source:
@Override public TmfContext seekEvent(final double ratio){
  fLock.lock();
  try {
    if (fTrace != null) {
      final ITmfLocation<?> location=new TmfLocation<Long>(Long.valueOf((long)(ratio * fTrace.length())));
      final TmfContext context=seekEvent(location);
      context.setRank(ITmfContext.UNKNOWN_RANK);
      return context;
    }
  }
 catch (  final IOException e) {
    e.printStackTrace();
  }
 finally {
    fLock.unlock();
  }
  return null;
}

Fixed version (ground truth):
@Override public TmfContext seekEvent(final double ratio){
  fLock.lock();
  try {
    if (fTrace != null) {
      final ITmfLocation<?> location=new TmfLocation<Long>(Math.round(ratio * fTrace.length()));
      final TmfContext context=seekEvent(location);
      context.setRank(ITmfContext.UNKNOWN_RANK);
      return context;
    }
  }
 catch (  final IOException e) {
    e.printStackTrace();
  }
 finally {
    fLock.unlock();
  }
  return null;
}
Program: 92127
Project: 92127
Buggy source:
@Override public ITmfContext seekEvent(double ratio){
  CtfTmfLightweightContext context=new CtfTmfLightweightContext(this);
  context.seek((long)(this.getNbEvents() * ratio));
  context.setRank(ITmfContext.UNKNOWN_RANK);
  return context;
}

Fixed version (ground truth):
@Override public ITmfContext seekEvent(double ratio){
  CtfTmfLightweightContext context=new CtfTmfLightweightContext(this);
  context.seek(Math.round(this.getNbEvents() * ratio));
  context.setRank(ITmfContext.UNKNOWN_RANK);
  return context;
}
Program: 92128
Project: 92128
Buggy source:
@Override public ITmfContext seekEvent(final double ratio){
  final ITmfContext context=seekEvent((long)(ratio * getNbEvents()));
  return context;
}

Fixed version (ground truth):
@Override public ITmfContext seekEvent(final double ratio){
  final ITmfContext context=seekEvent(Math.round(ratio * getNbEvents()));
  return context;
}
Program: 92129
Project: 92129
Buggy source:
@Override public synchronized TmfContext seekEvent(final double ratio){
  if (fFile == null) {
    return new CustomTxtTraceContext(NULL_LOCATION,ITmfContext.UNKNOWN_RANK);
  }
  try {
    long pos=(long)(ratio * fFile.length());
    while (pos > 0) {
      fFile.seek(pos - 1);
      if (fFile.read() == '\n') {
        break;
      }
      pos--;
    }
    final ITmfLocation<?> location=new TmfLocation<Long>(pos);
    final TmfContext context=seekEvent(location);
    context.setRank(ITmfContext.UNKNOWN_RANK);
    return context;
  }
 catch (  final IOException e) {
    Activator.getDefault().logError("String_Node_Str" + getPath(),e);
    return new CustomTxtTraceContext(NULL_LOCATION,ITmfContext.UNKNOWN_RANK);
  }
}

Fixed version (ground truth):
@Override public synchronized TmfContext seekEvent(final double ratio){
  if (fFile == null) {
    return new CustomTxtTraceContext(NULL_LOCATION,ITmfContext.UNKNOWN_RANK);
  }
  try {
    long pos=Math.round(ratio * fFile.length());
    while (pos > 0) {
      fFile.seek(pos - 1);
      if (fFile.read() == '\n') {
        break;
      }
      pos--;
    }
    final ITmfLocation<?> location=new TmfLocation<Long>(pos);
    final TmfContext context=seekEvent(location);
    context.setRank(ITmfContext.UNKNOWN_RANK);
    return context;
  }
 catch (  final IOException e) {
    Activator.getDefault().logError("String_Node_Str" + getPath(),e);
    return new CustomTxtTraceContext(NULL_LOCATION,ITmfContext.UNKNOWN_RANK);
  }
}
Program: 92130
Project: 92130
Buggy source:
@Override public synchronized TmfContext seekEvent(final double ratio){
  if (fFile == null) {
    return new CustomTxtTraceContext(NULL_LOCATION,ITmfContext.UNKNOWN_RANK);
  }
  try {
    long pos=(long)(ratio * fFile.length());
    while (pos > 0) {
      fFile.seek(pos - 1);
      if (fFile.read() == '\n') {
        break;
      }
      pos--;
    }
    final ITmfLocation<?> location=new TmfLocation<Long>(pos);
    final TmfContext context=seekEvent(location);
    context.setRank(ITmfContext.UNKNOWN_RANK);
    return context;
  }
 catch (  final IOException e) {
    Activator.getDefault().logError("String_Node_Str" + getPath(),e);
    return new CustomXmlTraceContext(NULL_LOCATION,ITmfContext.UNKNOWN_RANK);
  }
}

Fixed version (ground truth):
@Override public synchronized TmfContext seekEvent(final double ratio){
  if (fFile == null) {
    return new CustomTxtTraceContext(NULL_LOCATION,ITmfContext.UNKNOWN_RANK);
  }
  try {
    long pos=Math.round(ratio * fFile.length());
    while (pos > 0) {
      fFile.seek(pos - 1);
      if (fFile.read() == '\n') {
        break;
      }
      pos--;
    }
    final ITmfLocation<?> location=new TmfLocation<Long>(pos);
    final TmfContext context=seekEvent(location);
    context.setRank(ITmfContext.UNKNOWN_RANK);
    return context;
  }
 catch (  final IOException e) {
    Activator.getDefault().logError("String_Node_Str" + getPath(),e);
    return new CustomXmlTraceContext(NULL_LOCATION,ITmfContext.UNKNOWN_RANK);
  }
}
Program: 92131
Project: 92131
Buggy source:
/** 
 * Moves to the page that contains the time provided by the signal. The messages will be selected if the provided time is the time of a message.
 * @param signal The Time synch signal.
 */
@TmfSignalHandler public void synchToTime(TmfTimeSynchSignal signal){
  fLock.lock();
  try {
    if ((signal.getSource() != this) && (fFrame != null)) {
      fCurrentTime=signal.getCurrentTime();
      fIsSelect=true;
      moveToMessage();
    }
  }
  finally {
    fLock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * Moves to the page that contains the time provided by the signal. The messages will be selected if the provided time is the time of a message.
 * @param signal The Time synch signal.
 */
@TmfSignalHandler public void synchToTime(TmfTimeSynchSignal signal){
  fLock.lock();
  try {
    if ((signal.getSource() != this) && (fFrame != null) && (fCheckPoints.size() > 0)) {
      fCurrentTime=signal.getCurrentTime();
      fIsSelect=true;
      moveToMessage();
    }
  }
  finally {
    fLock.unlock();
  }
}
Program: 92132
Project: 92132
Buggy source:
/** 
 * Moves to the page that contains the current time provided by signal. No message will be selected however the focus will be set to the message if the provided time is the time of a message.
 * @param signal The time range sync signal
 */
@TmfSignalHandler public void synchToTimeRange(TmfRangeSynchSignal signal){
  fLock.lock();
  try {
    if ((signal.getSource() != this) && (fFrame != null) && !fIsSignalSent) {
      TmfTimeRange newTimeRange=signal.getCurrentRange();
      ITmfTimestamp delta=newTimeRange.getEndTime().getDelta(newTimeRange.getStartTime());
      fInitialWindow=delta.getValue();
      fIsSelect=false;
      fCurrentTime=newTimeRange.getStartTime();
      moveToMessage();
    }
  }
  finally {
    fLock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * Moves to the page that contains the current time provided by signal. No message will be selected however the focus will be set to the message if the provided time is the time of a message.
 * @param signal The time range sync signal
 */
@TmfSignalHandler public void synchToTimeRange(TmfRangeSynchSignal signal){
  fLock.lock();
  try {
    if ((signal.getSource() != this) && (fFrame != null) && !fIsSignalSent&& (fCheckPoints.size() > 0)) {
      TmfTimeRange newTimeRange=signal.getCurrentRange();
      ITmfTimestamp delta=newTimeRange.getEndTime().getDelta(newTimeRange.getStartTime());
      fInitialWindow=delta.getValue();
      fIsSelect=false;
      fCurrentTime=newTimeRange.getStartTime();
      moveToMessage();
    }
  }
  finally {
    fLock.unlock();
  }
}
Program: 92134
Project: 92134
Buggy source:
@Override protected synchronized ITmfContext armRequest(final ITmfDataRequest<T> request){
  if (fTraces == null) {
    return null;
  }
  if (request instanceof ITmfEventRequest<?> && !TmfTimestamp.BIG_BANG.equals(((ITmfEventRequest<T>)request).getRange().getStartTime()) && request.getIndex() == 0) {
    final ITmfContext context=seekEvent(((ITmfEventRequest<T>)request).getRange().getStartTime());
    ((ITmfEventRequest<T>)request).setStartIndex((int)context.getRank());
    return context;
  }
  if ((fExperimentContext != null) && fExperimentContext.getRank() == request.getIndex()) {
    return fExperimentContext;
  }
  return seekEvent(request.getIndex());
}

Fixed version (ground truth):
@Override protected synchronized ITmfContext armRequest(final ITmfDataRequest<T> request){
  if (fTraces == null) {
    return null;
  }
  if (request instanceof ITmfEventRequest<?> && !TmfTimestamp.BIG_BANG.equals(((ITmfEventRequest<T>)request).getRange().getStartTime()) && request.getIndex() == 0) {
    final ITmfContext context=seekEvent(((ITmfEventRequest<T>)request).getRange().getStartTime());
    ((ITmfEventRequest<T>)request).setStartIndex((int)context.getRank());
    return context;
  }
  return seekEvent(request.getIndex());
}
Program: 92136
Project: 92136
Buggy source:
/** 
 * Returns the timestamp of the event at the requested index. If none, returns null.
 * @param index the event index (rank)
 * @return the corresponding event timestamp
 */
public ITmfTimestamp getTimestamp(final int index){
  final ITmfContext context=seekEvent(index);
  final ITmfEvent event=getNext(context);
  return (event != null) ? event.getTimestamp() : null;
}

Fixed version (ground truth):
/** 
 * Returns the timestamp of the event at the requested index. If none, returns null.
 * @param index the event index (rank)
 * @return the corresponding event timestamp
 */
public ITmfTimestamp getTimestamp(final int index){
  final ITmfContext context=seekEvent(index);
  final ITmfEvent event=getNext(context);
  context.dispose();
  return (event != null) ? event.getTimestamp() : null;
}