nus-yam/ex-repair huggingface dataset:
Program: 92189
Project: 92189
Buggy source:
public void testCancelCoalescedRequest() throws Exception {
  fTrace=setupTrace(DIRECTORY + File.separator + TEST_STREAM);
  TmfSignalManager.register(this);
  TmfTestTriggerSignal signal=new TmfTestTriggerSignal(this,0,true);
  TmfSignalManager.dispatchSignal(signal);
  request1.waitForCompletion();
  request2.waitForCompletion();
  request3.waitForCompletion();
  assertEquals("String_Node_Str",BLOCK_SIZE,requestedEvents1.size());
  assertTrue("String_Node_Str",request1.isCompleted());
  assertTrue("String_Node_Str",request1.isCancelled());
  assertEquals("String_Node_Str",NB_EVENTS,requestedEvents2.size());
  assertTrue("String_Node_Str",request2.isCompleted());
  assertFalse("String_Node_Str",request2.isCancelled());
  assertEquals("String_Node_Str",NB_EVENTS,requestedEvents3.size());
  assertTrue("String_Node_Str",request3.isCompleted());
  assertFalse("String_Node_Str",request3.isCancelled());
  for (int i=0; i < NB_EVENTS; i++) {
    assertEquals("String_Node_Str",i + 1,requestedEvents2.get(i).getTimestamp().getValue());
    assertEquals("String_Node_Str",i + 1,requestedEvents3.get(i).getTimestamp().getValue());
  }
  TmfSignalManager.deregister(this);
  fTrace.dispose();
  fTrace=null;
}

Fixed version (ground truth):
public void testCancelCoalescedRequest() throws Exception {
  fTrace=setupTrace(DIRECTORY + File.separator + TEST_STREAM);
  TmfSignalManager.register(this);
  TmfTestTriggerSignal signal=new TmfTestTriggerSignal(this,0,true);
  TmfSignalManager.dispatchSignal(signal);
  request1.waitForCompletion();
  request2.waitForCompletion();
  request3.waitForCompletion();
  assertEquals("String_Node_Str",BLOCK_SIZE,requestedEvents1.size());
  assertTrue("String_Node_Str",request1.isCompleted());
  assertTrue("String_Node_Str",request1.isCancelled());
  assertEquals("String_Node_Str",NB_EVENTS,requestedEvents2.size());
  assertTrue("String_Node_Str",request2.isCompleted());
  assertFalse("String_Node_Str",request2.isCancelled());
  assertEquals("String_Node_Str",NB_EVENTS,requestedEvents3.size());
  assertTrue("String_Node_Str",request3.isCompleted());
  assertFalse("String_Node_Str",request3.isCancelled());
  for (int i=0; i < BLOCK_SIZE; i++) {
    assertEquals("String_Node_Str",i + 1 + request1.getIndex(),requestedEvents1.get(i).getTimestamp().getValue());
  }
  for (int i=0; i < NB_EVENTS; i++) {
    assertEquals("String_Node_Str",i + 1 + request2.getIndex(),requestedEvents2.get(i).getTimestamp().getValue());
    assertEquals("String_Node_Str",i + 1 + request3.getIndex(),requestedEvents3.get(i).getTimestamp().getValue());
  }
  TmfSignalManager.deregister(this);
  fTrace.dispose();
  fTrace=null;
}
Program: 92190
Project: 92190
Buggy source:
@TmfSignalHandler @SuppressWarnings("String_Node_Str") public void trigger(final TmfTestTriggerSignal signal){
  TmfTimeRange range=new TmfTimeRange(TmfTimestamp.BIG_BANG,TmfTimestamp.BIG_CRUNCH);
  requestedEvents1=new Vector<TmfEvent>();
  request1=new TmfEventRequest<TmfEvent>(TmfEvent.class,range,signal.fIndex,NB_EVENTS,BLOCK_SIZE){
    int nbRead=0;
    @Override public void handleData(    TmfEvent event){
      super.handleData(event);
      if (!isCompleted()) {
        requestedEvents1.add(event);
        if (++nbRead >= BLOCK_SIZE && signal.forceCancel) {
          cancel();
        }
      }
    }
  }
;
  requestedEvents2=new Vector<TmfEvent>();
  request2=new TmfEventRequest<TmfEvent>(TmfEvent.class,range,signal.fIndex,NB_EVENTS,BLOCK_SIZE){
    @Override public void handleData(    TmfEvent event){
      super.handleData(event);
      if (!isCompleted()) {
        requestedEvents2.add(event);
      }
    }
  }
;
  requestedEvents3=new Vector<TmfEvent>();
  request3=new TmfEventRequest<TmfEvent>(TmfEvent.class,range,signal.fIndex,NB_EVENTS,BLOCK_SIZE){
    @Override public void handleData(    TmfEvent event){
      super.handleData(event);
      if (!isCompleted()) {
        requestedEvents3.add(event);
      }
    }
  }
;
  providers=(ITmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TmfTraceStub.class);
  providers[0].sendRequest(request1);
  providers[0].sendRequest(request2);
  providers[0].sendRequest(request3);
}

Fixed version (ground truth):
@TmfSignalHandler @SuppressWarnings("String_Node_Str") public void trigger(final TmfTestTriggerSignal signal){
  TmfTimeRange range=new TmfTimeRange(TmfTimestamp.BIG_BANG,TmfTimestamp.BIG_CRUNCH);
  final long REQUEST_OFFSET=1000;
  requestedEvents1=new Vector<TmfEvent>();
  request1=new TmfEventRequest<TmfEvent>(TmfEvent.class,range,signal.fIndex,NB_EVENTS,BLOCK_SIZE){
    int nbRead=0;
    @Override public void handleData(    TmfEvent event){
      super.handleData(event);
      if (!isCompleted()) {
        requestedEvents1.add(event);
        if (++nbRead >= BLOCK_SIZE && signal.forceCancel) {
          cancel();
        }
      }
    }
  }
;
  requestedEvents2=new Vector<TmfEvent>();
  request2=new TmfEventRequest<TmfEvent>(TmfEvent.class,range,signal.fIndex + REQUEST_OFFSET,NB_EVENTS,BLOCK_SIZE){
    @Override public void handleData(    TmfEvent event){
      super.handleData(event);
      if (!isCompleted()) {
        requestedEvents2.add(event);
      }
    }
  }
;
  requestedEvents3=new Vector<TmfEvent>();
  request3=new TmfEventRequest<TmfEvent>(TmfEvent.class,range,signal.fIndex + 2 * REQUEST_OFFSET,NB_EVENTS,BLOCK_SIZE){
    @Override public void handleData(    TmfEvent event){
      super.handleData(event);
      if (!isCompleted()) {
        requestedEvents3.add(event);
      }
    }
  }
;
  providers=(ITmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TmfTraceStub.class);
  providers[0].sendRequest(request1);
  providers[0].sendRequest(request2);
  providers[0].sendRequest(request3);
}
Program: 92191
Project: 92191
Buggy source:
@Override public void handleData(T data){
  super.handleData(data);
  if (getClass() == TmfCoalescedDataRequest.class) {
    long index=getIndex() + getNbRead();
    for (    ITmfDataRequest<T> request : fRequests) {
      if (!request.isCompleted()) {
        if (request.getDataType().isInstance(data)) {
          long start=request.getIndex();
          long end=start + request.getNbRequested() - 1;
          if (index >= start && index < end) {
            request.handleData(data);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void handleData(T data){
  super.handleData(data);
  if (getClass() == TmfCoalescedDataRequest.class) {
    long index=getIndex() + getNbRead() - 1;
    for (    ITmfDataRequest<T> request : fRequests) {
      if (!request.isCompleted()) {
        if (request.getDataType().isInstance(data)) {
          long start=request.getIndex();
          long end=start + request.getNbRequested();
          if (index >= start && index < end) {
            request.handleData(data);
          }
        }
      }
    }
  }
}
Program: 92192
Project: 92192
Buggy source:
@Override public void handleData(T data){
  super.handleData(data);
  for (  ITmfDataRequest<T> request : fRequests) {
    if (data == null) {
      request.handleData(null);
    }
 else {
      if (request instanceof TmfEventRequest<?>) {
        TmfEventRequest<T> req=(TmfEventRequest<T>)request;
        if (!req.isCompleted() && (getIndex() + getNbRead() > request.getIndex())) {
          ITmfTimestamp ts=data.getTimestamp();
          if (req.getRange().contains(ts)) {
            if (req.getDataType().isInstance(data)) {
              req.handleData(data);
            }
          }
        }
      }
 else {
        TmfDataRequest<T> req=(TmfDataRequest<T>)request;
        if (!req.isCompleted()) {
          if (req.getDataType().isInstance(data)) {
            req.handleData(data);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void handleData(T data){
  super.handleData(data);
  long index=getIndex() + getNbRead() - 1;
  for (  ITmfDataRequest<T> request : fRequests) {
    if (data == null) {
      request.handleData(null);
    }
 else {
      long start=request.getIndex();
      long end=start + request.getNbRequested();
      if (request instanceof TmfEventRequest<?>) {
        TmfEventRequest<T> req=(TmfEventRequest<T>)request;
        if (!req.isCompleted() && index >= start && index < end) {
          ITmfTimestamp ts=data.getTimestamp();
          if (req.getRange().contains(ts)) {
            if (req.getDataType().isInstance(data)) {
              req.handleData(data);
            }
          }
        }
      }
 else {
        TmfDataRequest<T> req=(TmfDataRequest<T>)request;
        if (!req.isCompleted() && index >= start && index < end) {
          if (req.getDataType().isInstance(data)) {
            req.handleData(data);
          }
        }
      }
    }
  }
}
Program: 92193
Project: 92193
Buggy source:
/** 
 * Sends pending request (if any)
 */
protected void sendPendingUpdate(){
synchronized (fStatisticsUpdateSyncObj) {
    fStatisticsUpdateBusy=false;
    if (fStatisticsUpdatePending) {
      fStatisticsUpdatePending=false;
      requestData(TmfExperiment.getCurrentExperiment(),fStatisticsUpdateRange);
    }
  }
}

Fixed version (ground truth):
/** 
 * Sends pending request (if any)
 */
protected void sendPendingUpdate(){
synchronized (fStatisticsUpdateSyncObj) {
    fStatisticsUpdateBusy=false;
    if (fStatisticsUpdatePending) {
      fStatisticsUpdatePending=false;
      requestData(TmfExperiment.getCurrentExperiment(),fStatisticsUpdateRange);
      fStatisticsUpdateRange=null;
    }
  }
}
Program: 92194
Project: 92194
Buggy source:
/** 
 * Reset update synchronization information
 */
protected void resetUpdateSynchronization(){
synchronized (fStatisticsUpdateSyncObj) {
    fStatisticsUpdateBusy=false;
    fStatisticsUpdatePending=false;
  }
}

Fixed version (ground truth):
/** 
 * Reset update synchronization information
 */
protected void resetUpdateSynchronization(){
synchronized (fStatisticsUpdateSyncObj) {
    fStatisticsUpdateBusy=false;
    fStatisticsUpdatePending=false;
    fStatisticsUpdateRange=null;
  }
}
Program: 92195
Project: 92195
Buggy source:
/** 
 * Checks if statistic update is ongoing. If it is ongoing the new time range is stored as pending
 * @param timeRange - new time range
 * @return true if statistic update is ongoing else false
 */
protected boolean checkUpdateBusy(TmfTimeRange timeRange){
synchronized (fStatisticsUpdateSyncObj) {
    if (fStatisticsUpdateBusy) {
      fStatisticsUpdatePending=true;
      fStatisticsUpdateRange=timeRange;
      return true;
    }
    fStatisticsUpdateBusy=true;
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Checks if statistic update is ongoing. If it is ongoing the new time range is stored as pending
 * @param timeRange - new time range
 * @return true if statistic update is ongoing else false
 */
protected boolean checkUpdateBusy(TmfTimeRange timeRange){
synchronized (fStatisticsUpdateSyncObj) {
    if (fStatisticsUpdateBusy) {
      fStatisticsUpdatePending=true;
      if (fStatisticsUpdateRange == null || timeRange.getEndTime().compareTo(fStatisticsUpdateRange.getEndTime()) > 0) {
        fStatisticsUpdateRange=timeRange;
      }
      return true;
    }
    fStatisticsUpdateBusy=true;
    return false;
  }
}
Program: 92198
Project: 92198
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void run(){
  while (!fExecutor.isShutdown()) {
    final TmfExperiment<?> experiment=TmfExperiment.getCurrentExperiment();
    if (experiment != null) {
      @SuppressWarnings("String_Node_Str") final TmfEventRequest request=new TmfEventRequest<TmfEvent>(TmfEvent.class,TmfTimeRange.ETERNITY,0,ExecutionType.FOREGROUND){
        @Override public void handleCompleted(){
          updateJniTrace();
        }
      }
;
synchronized (experiment) {
        experiment.sendRequest(request);
      }
      try {
        request.waitForCompletion();
      }
 catch (      final InterruptedException e) {
      }
    }
 else     updateJniTrace();
    try {
      Thread.sleep(LTTNG_STREAMING_INTERVAL);
    }
 catch (    final InterruptedException e) {
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void run(){
  while (!fExecutor.isShutdown()) {
    final TmfExperiment<?> experiment=TmfExperiment.getCurrentExperiment();
    if (experiment != null) {
      @SuppressWarnings("String_Node_Str") final TmfEventRequest request=new TmfEventRequest<TmfEvent>(TmfEvent.class,TmfTimeRange.ETERNITY,0,ExecutionType.FOREGROUND){
        @Override public void handleCompleted(){
          updateJniTrace();
        }
      }
;
      experiment.sendRequest(request);
      try {
        request.waitForCompletion();
      }
 catch (      final InterruptedException e) {
      }
    }
 else     updateJniTrace();
    try {
      Thread.sleep(LTTNG_STREAMING_INTERVAL);
    }
 catch (    final InterruptedException e) {
    }
  }
}
Program: 92201
Project: 92201
Buggy source:
@Override public void run(){
  while (!fExecutor.isShutdown()) {
    if (!getIndexer().isIndexing()) {
      ITmfTimestamp startTimestamp=TmfTimestamp.BIG_CRUNCH;
      ITmfTimestamp endTimestamp=TmfTimestamp.BIG_BANG;
      for (      final ITmfTrace<T> trace : fTraces) {
        if (trace.getStartTime().compareTo(startTimestamp) < 0) {
          startTimestamp=trace.getStartTime();
        }
        if (trace.getStreamingInterval() != 0 && trace.getEndTime().compareTo(endTimestamp) > 0) {
          endTimestamp=trace.getEndTime();
        }
      }
      if (safeTimestamp != null && safeTimestamp.compareTo(getTimeRange().getEndTime(),false) > 0) {
        timeRange=new TmfTimeRange(startTimestamp,safeTimestamp);
      }
 else {
        timeRange=null;
      }
      safeTimestamp=endTimestamp;
      if (timeRange != null) {
        final TmfExperimentRangeUpdatedSignal signal=new TmfExperimentRangeUpdatedSignal(TmfExperiment.this,TmfExperiment.this,timeRange);
        broadcast(signal);
      }
    }
    try {
      Thread.sleep(getStreamingInterval());
    }
 catch (    final InterruptedException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (!fExecutor.isShutdown()) {
    if (!getIndexer().isIndexing()) {
      ITmfTimestamp startTimestamp=TmfTimestamp.BIG_CRUNCH;
      ITmfTimestamp endTimestamp=TmfTimestamp.BIG_BANG;
      for (      final ITmfTrace<T> trace : fTraces) {
        if (trace.getStartTime().compareTo(startTimestamp) < 0) {
          startTimestamp=trace.getStartTime();
        }
        if (trace.getStreamingInterval() != 0 && trace.getEndTime().compareTo(endTimestamp) > 0) {
          endTimestamp=trace.getEndTime();
        }
      }
      if (safeTimestamp != null && (lastSafeTimestamp == null || safeTimestamp.compareTo(lastSafeTimestamp,false) > 0)) {
        timeRange=new TmfTimeRange(startTimestamp,safeTimestamp);
        lastSafeTimestamp=safeTimestamp;
      }
 else {
        timeRange=null;
      }
      safeTimestamp=endTimestamp;
      if (timeRange != null) {
        final TmfExperimentRangeUpdatedSignal signal=new TmfExperimentRangeUpdatedSignal(TmfExperiment.this,TmfExperiment.this,timeRange);
        broadcast(signal);
      }
    }
    try {
      Thread.sleep(getStreamingInterval());
    }
 catch (    final InterruptedException e) {
      e.printStackTrace();
    }
  }
}
Program: 92202
Project: 92202
Buggy source:
private String formatToolTipLabel(final int index){
  long startTime=fScaledData.getBucketStartTime(fScaledData.fCurrentBucket);
  if (startTime < 0) {
    startTime=0;
  }
  final long endTime=fScaledData.getBucketEndTime(fScaledData.fCurrentBucket);
  final int nbEvents=(index >= 0) ? fScaledData.fData[index] : 0;
  final StringBuffer buffer=new StringBuffer();
  buffer.append("String_Node_Str");
  buffer.append(HistogramUtils.nanosecondsToString(startTime));
  buffer.append("String_Node_Str");
  buffer.append(HistogramUtils.nanosecondsToString(endTime));
  buffer.append("String_Node_Str");
  buffer.append("String_Node_Str");
  buffer.append(nbEvents);
  return buffer.toString();
}

Fixed version (ground truth):
private String formatToolTipLabel(final int index){
  long startTime=fScaledData.getBucketStartTime(index);
  if (startTime < 0) {
    startTime=0;
  }
  final long endTime=fScaledData.getBucketEndTime(index);
  final int nbEvents=(index >= 0) ? fScaledData.fData[index] : 0;
  final StringBuffer buffer=new StringBuffer();
  buffer.append("String_Node_Str");
  buffer.append(HistogramUtils.nanosecondsToString(startTime));
  buffer.append("String_Node_Str");
  buffer.append(HistogramUtils.nanosecondsToString(endTime));
  buffer.append("String_Node_Str");
  buffer.append("String_Node_Str");
  buffer.append(nbEvents);
  return buffer.toString();
}
Program: 92203
Project: 92203
Buggy source:
@Override protected void updateValue(){
  String stringValue=fTextValue.getText();
  long value=HistogramUtils.stringToNanoseconds(stringValue);
  if (getValue() != value) {
    TmfExperiment<?> exp=TmfExperiment.getCurrentExperiment();
    if (exp != null) {
      TmfTimeRange range=exp.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 stringValue=fTextValue.getText();
  long value=HistogramUtils.stringToNanoseconds(stringValue);
  if (getValue() != value) {
    TmfExperiment<?> exp=TmfExperiment.getCurrentExperiment();
    if (exp != null) {
      TmfTimeRange range=exp.getTimeRange();
      long startTime=range.getStartTime().normalize(0,-9).getValue();
      long endTime=range.getEndTime().normalize(0,-9).getValue();
      if (value < startTime) {
        value=startTime;
      }
 else       if (value > endTime) {
        value=endTime;
      }
    }
    setValue(value);
    fParentView.updateCurrentEventTime(value);
  }
}
Program: 92204
Project: 92204
Buggy source:
/** 
 * Handle the event from the trace by updating the histogram data model.
 * @param event a event from the trace
 * @see org.eclipse.linuxtools.tmf.core.request.TmfDataRequest#handleData(org.eclipse.linuxtools.tmf.core.event.ITmfEvent)
 */
@Override public void handleData(ITmfEvent event){
  super.handleData(event);
  if (event != null) {
    long timestamp=event.getTimestamp().getValue();
    fHistogram.countEvent(getNbRead(),timestamp);
  }
}

Fixed version (ground truth):
/** 
 * Handle the event from the trace by updating the histogram data model.
 * @param event a event from the trace
 * @see org.eclipse.linuxtools.tmf.core.request.TmfDataRequest#handleData(org.eclipse.linuxtools.tmf.core.event.ITmfEvent)
 */
@Override public void handleData(ITmfEvent event){
  super.handleData(event);
  if (event != null) {
    long timestamp=event.getTimestamp().normalize(0,-9).getValue();
    fHistogram.countEvent(getNbRead(),timestamp);
  }
}
Program: 92205
Project: 92205
Buggy source:
private final void createTraceTypeGroup(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.numColumns=3;
  layout.makeColumnsEqualWidth=false;
  composite.setLayout(layout);
  composite.setFont(parent.getFont());
  GridData buttonData=new GridData(SWT.FILL,SWT.FILL,true,false);
  composite.setLayoutData(buttonData);
  Label typeLabel=new Label(composite,SWT.NONE);
  typeLabel.setText(Messages.ImportTraceWizard_TraceType);
  typeLabel.setFont(parent.getFont());
  fTraceTypes=new Combo(composite,SWT.BORDER);
  GridData data=new GridData(SWT.FILL,SWT.FILL,true,false,2,1);
  fTraceTypes.setLayoutData(data);
  fTraceTypes.setFont(parent.getFont());
  String[] availableTraceTypes=getAvailableTraceTypes();
  fTraceTypes.setItems(availableTraceTypes);
  fTraceTypes.addSelectionListener(new SelectionListener(){
    @Override public void widgetSelected(    SelectionEvent e){
      validateSourceGroup();
    }
    @Override public void widgetDefaultSelected(    SelectionEvent e){
    }
  }
);
}

Fixed version (ground truth):
private final void createTraceTypeGroup(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.numColumns=3;
  layout.makeColumnsEqualWidth=false;
  composite.setLayout(layout);
  composite.setFont(parent.getFont());
  GridData buttonData=new GridData(SWT.FILL,SWT.FILL,true,false);
  composite.setLayoutData(buttonData);
  Label typeLabel=new Label(composite,SWT.NONE);
  typeLabel.setText(Messages.ImportTraceWizard_TraceType);
  typeLabel.setFont(parent.getFont());
  fTraceTypes=new Combo(composite,SWT.BORDER);
  GridData data=new GridData(SWT.FILL,SWT.FILL,true,false,2,1);
  fTraceTypes.setLayoutData(data);
  fTraceTypes.setFont(parent.getFont());
  String[] availableTraceTypes=getAvailableTraceTypes();
  fTraceTypes.setItems(availableTraceTypes);
  fTraceTypes.addSelectionListener(new SelectionListener(){
    @Override public void widgetSelected(    SelectionEvent e){
      updateWidgetEnablements();
    }
    @Override public void widgetDefaultSelected(    SelectionEvent e){
    }
  }
);
}
Program: 92206
Project: 92206
Buggy source:
private String formatToolTipLabel(final int index){
  long startTime=fScaledData.getBucketStartTime(fScaledData.fCurrentBucket);
  if (startTime < 0) {
    startTime=0;
  }
  final long endTime=fScaledData.getBucketEndTime(fScaledData.fCurrentBucket);
  final int nbEvents=(index >= 0) ? fScaledData.fData[index] : 0;
  final StringBuffer buffer=new StringBuffer();
  buffer.append("String_Node_Str");
  buffer.append(HistogramUtils.nanosecondsToString(startTime));
  buffer.append("String_Node_Str");
  buffer.append(HistogramUtils.nanosecondsToString(endTime));
  buffer.append("String_Node_Str");
  buffer.append("String_Node_Str");
  buffer.append(nbEvents);
  return buffer.toString();
}

Fixed version (ground truth):
private String formatToolTipLabel(final int index){
  long startTime=fScaledData.getBucketStartTime(index);
  if (startTime < 0) {
    startTime=0;
  }
  final long endTime=fScaledData.getBucketEndTime(index);
  final int nbEvents=(index >= 0) ? fScaledData.fData[index] : 0;
  final StringBuffer buffer=new StringBuffer();
  buffer.append("String_Node_Str");
  buffer.append(HistogramUtils.nanosecondsToString(startTime));
  buffer.append("String_Node_Str");
  buffer.append(HistogramUtils.nanosecondsToString(endTime));
  buffer.append("String_Node_Str");
  buffer.append("String_Node_Str");
  buffer.append(nbEvents);
  return buffer.toString();
}
Program: 92208
Project: 92208
Buggy source:
/** 
 * Sets or clears the input for this time graph combo. The input array should only contain top-level elements.
 * @param input the input of this time graph combo, or <code>null</code> if none
 */
public void setInput(ITimeGraphEntry[] input){
  fInhibitTreeSelection=true;
  fTreeViewer.setInput(input);
  fInhibitTreeSelection=false;
  fTreeViewer.expandAll();
  fTreeViewer.getTree().getVerticalBar().setEnabled(false);
  fTreeViewer.getTree().getVerticalBar().setVisible(false);
  fTimeGraphViewer.setItemHeight(getItemHeight(fTreeViewer.getTree()));
  fTimeGraphViewer.setInput(input);
}

Fixed version (ground truth):
/** 
 * Sets or clears the input for this time graph combo. The input array should only contain top-level elements.
 * @param input the input of this time graph combo, or <code>null</code> if none
 */
public void setInput(ITimeGraphEntry[] input){
  fInhibitTreeSelection=true;
  fTreeViewer.setInput(input);
  for (  SelectionListenerWrapper listenerWrapper : fSelectionListenerMap.values()) {
    listenerWrapper.selection=null;
  }
  fInhibitTreeSelection=false;
  fTreeViewer.expandAll();
  fTreeViewer.getTree().getVerticalBar().setEnabled(false);
  fTreeViewer.getTree().getVerticalBar().setVisible(false);
  fTimeGraphViewer.setItemHeight(getItemHeight(fTreeViewer.getTree()));
  fTimeGraphViewer.setInput(input);
}
Program: 92209
Project: 92209
Buggy source:
/** 
 * Sets or clears the input for this time graph viewer. The input array should only contain top-level elements.
 * @param input the input of this time graph viewer, or <code>null</code> if none
 */
public void setInput(ITimeGraphEntry[] input){
  if (null != _stateCtrl) {
    if (null == input) {
      input=new ITimeGraphEntry[0];
    }
    setTimeRange(input);
    _verticalScrollBar.setEnabled(true);
    setTopIndex(0);
    _selectedTime=0;
    refreshAllData(input);
  }
}

Fixed version (ground truth):
/** 
 * Sets or clears the input for this time graph viewer. The input array should only contain top-level elements.
 * @param input the input of this time graph viewer, or <code>null</code> if none
 */
public void setInput(ITimeGraphEntry[] input){
  if (null != _stateCtrl) {
    if (null == input) {
      input=new ITimeGraphEntry[0];
    }
    setTimeRange(input);
    _verticalScrollBar.setEnabled(true);
    setTopIndex(0);
    _selectedTime=0;
    _selectedEntry=null;
    refreshAllData(input);
  }
}
Program: 92210
Project: 92210
Buggy source:
private void drawTimeRangeWindow(GC imageGC,Image image){
  long bucketSpan=Math.max(fScaledData.fBucketDuration,1);
  int rangeWidth=(int)(fRangeDuration / bucketSpan);
  int left=(int)((fRangeStartTime - fDataModel.getFirstBucketTime()) / bucketSpan);
  int right=left + rangeWidth;
  int center=(left + right) / 2;
  int height=fCanvas.getSize().y - 2;
  imageGC.setForeground(fTimeRangeColor);
  imageGC.setLineWidth(1);
  imageGC.setLineStyle(SWT.LINE_SOLID);
  imageGC.drawRoundRectangle(left,0,rangeWidth,height - 1,15,15);
  imageGC.setBackground(fTimeRangeColor);
  imageGC.setAlpha(35);
  imageGC.fillRoundRectangle(left + 1,1,rangeWidth - 1,height - 2,15,15);
  imageGC.setAlpha(255);
  imageGC.setForeground(fTimeRangeColor);
  imageGC.setLineWidth(1);
  imageGC.setLineStyle(SWT.LINE_SOLID);
  int chHalfWidth=((rangeWidth < 60) ? (rangeWidth * 2) / 3 : 40) / 2;
  imageGC.drawLine(center - chHalfWidth,height / 2,center + chHalfWidth,height / 2);
  imageGC.drawLine(center,(height / 2) - chHalfWidth,center,(height / 2) + chHalfWidth);
}

Fixed version (ground truth):
private void drawTimeRangeWindow(GC imageGC,Image image){
  long bucketSpan=Math.max(fScaledData.fBucketDuration,1);
  int rangeWidth=(int)(fRangeDuration / bucketSpan);
  int left=(int)((fRangeStartTime - fDataModel.getFirstBucketTime()) / bucketSpan);
  int right=left + rangeWidth;
  int center=(left + right) / 2;
  int height=fCanvas.getSize().y;
  imageGC.setForeground(fTimeRangeColor);
  imageGC.setLineWidth(1);
  imageGC.setLineStyle(SWT.LINE_SOLID);
  imageGC.drawRoundRectangle(left,0,rangeWidth,height - 1,15,15);
  imageGC.setBackground(fTimeRangeColor);
  imageGC.setAlpha(35);
  imageGC.fillRoundRectangle(left + 1,1,rangeWidth - 1,height - 2,15,15);
  imageGC.setAlpha(255);
  imageGC.setForeground(fTimeRangeColor);
  imageGC.setLineWidth(1);
  imageGC.setLineStyle(SWT.LINE_SOLID);
  int chHalfWidth=((rangeWidth < 60) ? (rangeWidth * 2) / 3 : 40) / 2;
  imageGC.drawLine(center - chHalfWidth,height / 2,center + chHalfWidth,height / 2);
  imageGC.drawLine(center,(height / 2) - chHalfWidth,center,(height / 2) + chHalfWidth);
}
Program: 92211
Project: 92211
Buggy source:
private void formatImage(final GC imageGC,final Image image){
  if (fScaledData == null) {
    return;
  }
  final HistogramScaledData scaledData=new HistogramScaledData(fScaledData);
  try {
    final int width=image.getBounds().width;
    final int height=image.getBounds().height;
    imageGC.setBackground(fBackgroundColor);
    imageGC.fillRectangle(0,0,image.getBounds().width + 1,image.getBounds().height + 1);
    imageGC.setBackground(fHistoBarColor);
    final int limit=width < scaledData.fWidth ? width : scaledData.fWidth;
    for (int i=1; i < limit; i++) {
      final int value=(int)(scaledData.fData[i] * scaledData.fScalingFactor);
      imageGC.fillRectangle(i,height - value,1,value);
    }
    final int currentBucket=scaledData.fCurrentBucket;
    if (currentBucket >= 0 && currentBucket < limit) {
      drawDelimiter(imageGC,fCurrentEventColor,height,currentBucket);
    }
    int lastEventIndex=limit - 1;
    while (lastEventIndex >= 0 && scaledData.fData[lastEventIndex] == 0) {
      lastEventIndex--;
    }
    lastEventIndex+=(lastEventIndex < limit - 1) ? 1 : 0;
    drawDelimiter(imageGC,fLastEventColor,height,lastEventIndex);
  }
 catch (  final Exception e) {
  }
}

Fixed version (ground truth):
private void formatImage(final GC imageGC,final Image image){
  if (fScaledData == null) {
    return;
  }
  final HistogramScaledData scaledData=new HistogramScaledData(fScaledData);
  try {
    final int width=image.getBounds().width;
    final int height=image.getBounds().height;
    imageGC.setBackground(fBackgroundColor);
    imageGC.fillRectangle(0,0,image.getBounds().width + 1,image.getBounds().height + 1);
    imageGC.setBackground(fHistoBarColor);
    final int limit=width < scaledData.fWidth ? width : scaledData.fWidth;
    for (int i=1; i < limit; i++) {
      final int value=(int)Math.ceil(scaledData.fData[i] * scaledData.fScalingFactor);
      imageGC.fillRectangle(i,height - value,1,value);
    }
    final int currentBucket=scaledData.fCurrentBucket;
    if (currentBucket >= 0 && currentBucket < limit) {
      drawDelimiter(imageGC,fCurrentEventColor,height,currentBucket);
    }
    int lastEventIndex=limit - 1;
    while (lastEventIndex >= 0 && scaledData.fData[lastEventIndex] == 0) {
      lastEventIndex--;
    }
    lastEventIndex+=(lastEventIndex < limit - 1) ? 1 : 0;
    drawDelimiter(imageGC,fLastEventColor,height,lastEventIndex);
  }
 catch (  final Exception e) {
  }
}
Program: 92213
Project: 92213
Buggy source:
/** 
 * Handle the event from the trace by updating the histogram data model.
 * @param event a event from the trace
 * @see org.eclipse.linuxtools.tmf.core.request.TmfDataRequest#handleData(org.eclipse.linuxtools.tmf.core.event.ITmfEvent)
 */
@Override public void handleData(ITmfEvent event){
  super.handleData(event);
  if (event != null) {
    long timestamp=event.getTimestamp().getValue();
    fHistogram.countEvent(getNbRead(),timestamp);
  }
}

Fixed version (ground truth):
/** 
 * Handle the event from the trace by updating the histogram data model.
 * @param event a event from the trace
 * @see org.eclipse.linuxtools.tmf.core.request.TmfDataRequest#handleData(org.eclipse.linuxtools.tmf.core.event.ITmfEvent)
 */
@Override public void handleData(ITmfEvent event){
  super.handleData(event);
  if (event != null) {
    long timestamp=event.getTimestamp().normalize(0,-9).getValue();
    fHistogram.countEvent(getNbRead(),timestamp);
  }
}
Program: 92215
Project: 92215
Buggy source:
/** 
 * Handler for the state system build completed signal
 * @param signal The signal that's received
 */
@TmfSignalHandler public void stateSystemBuildCompleted(final TmfStateSystemBuildCompleted signal){
  final TmfExperiment<?> selectedExperiment=fSelectedExperiment;
  if (selectedExperiment == null) {
    return;
  }
  for (  ITmfTrace<?> trace : selectedExperiment.getTraces()) {
    if (trace == signal.getTrace() && trace instanceof CtfKernelTrace) {
      final Thread thread=new Thread("String_Node_Str"){
        @Override public void run(){
          selectExperiment(selectedExperiment);
        }
      }
;
      thread.start();
    }
  }
}

Fixed version (ground truth):
/** 
 * Handler for the state system build completed signal
 * @param signal The signal that's received
 */
@TmfSignalHandler public void stateSystemBuildCompleted(final TmfStateSystemBuildCompleted signal){
  final TmfExperiment<?> selectedExperiment=fSelectedExperiment;
  if (selectedExperiment == null || selectedExperiment.getTraces() == null) {
    return;
  }
  for (  ITmfTrace<?> trace : selectedExperiment.getTraces()) {
    if (trace == signal.getTrace() && trace instanceof CtfKernelTrace) {
      final Thread thread=new Thread("String_Node_Str"){
        @Override public void run(){
          selectExperiment(selectedExperiment);
        }
      }
;
      thread.start();
    }
  }
}
Program: 92216
Project: 92216
Buggy source:
/** 
 * Handler for the StatesystemBuildCompleted signal
 * @param signal The incoming signal
 */
@TmfSignalHandler public void stateSystemBuildCompleted(final TmfStateSystemBuildCompleted signal){
  final TmfExperiment<?> selectedExperiment=fSelectedExperiment;
  if (selectedExperiment == null) {
    return;
  }
  for (  ITmfTrace<?> trace : selectedExperiment.getTraces()) {
    if (trace == signal.getTrace() && trace instanceof CtfKernelTrace) {
      final Thread thread=new Thread("String_Node_Str"){
        @Override public void run(){
          selectExperiment(selectedExperiment);
        }
      }
;
      thread.start();
    }
  }
}

Fixed version (ground truth):
/** 
 * Handler for the StatesystemBuildCompleted signal
 * @param signal The incoming signal
 */
@TmfSignalHandler public void stateSystemBuildCompleted(final TmfStateSystemBuildCompleted signal){
  final TmfExperiment<?> selectedExperiment=fSelectedExperiment;
  if (selectedExperiment == null || selectedExperiment.getTraces() == null) {
    return;
  }
  for (  ITmfTrace<?> trace : selectedExperiment.getTraces()) {
    if (trace == signal.getTrace() && trace instanceof CtfKernelTrace) {
      final Thread thread=new Thread("String_Node_Str"){
        @Override public void run(){
          selectExperiment(selectedExperiment);
        }
      }
;
      thread.start();
    }
  }
}
Program: 92217
Project: 92217
Buggy source:
/** 
 * Sets or clears the input for this time graph combo. The input array should only contain top-level elements.
 * @param input the input of this time graph combo, or <code>null</code> if none
 */
public void setInput(ITimeGraphEntry[] input){
  fInhibitTreeSelection=true;
  fTreeViewer.setInput(input);
  fInhibitTreeSelection=false;
  fTreeViewer.expandAll();
  fTreeViewer.getTree().getVerticalBar().setEnabled(false);
  fTreeViewer.getTree().getVerticalBar().setVisible(false);
  fTimeGraphViewer.setItemHeight(getItemHeight(fTreeViewer.getTree()));
  fTimeGraphViewer.setInput(input);
}

Fixed version (ground truth):
/** 
 * Sets or clears the input for this time graph combo. The input array should only contain top-level elements.
 * @param input the input of this time graph combo, or <code>null</code> if none
 */
public void setInput(ITimeGraphEntry[] input){
  fInhibitTreeSelection=true;
  fTreeViewer.setInput(input);
  for (  SelectionListenerWrapper listenerWrapper : fSelectionListenerMap.values()) {
    listenerWrapper.selection=null;
  }
  fInhibitTreeSelection=false;
  fTreeViewer.expandAll();
  fTreeViewer.getTree().getVerticalBar().setEnabled(false);
  fTreeViewer.getTree().getVerticalBar().setVisible(false);
  fTimeGraphViewer.setItemHeight(getItemHeight(fTreeViewer.getTree()));
  fTimeGraphViewer.setInput(input);
}
Program: 92218
Project: 92218
Buggy source:
/** 
 * Sets or clears the input for this time graph viewer. The input array should only contain top-level elements.
 * @param input the input of this time graph viewer, or <code>null</code> if none
 */
public void setInput(ITimeGraphEntry[] input){
  if (null != _stateCtrl) {
    if (null == input) {
      input=new ITimeGraphEntry[0];
    }
    setTimeRange(input);
    _verticalScrollBar.setEnabled(true);
    setTopIndex(0);
    _selectedTime=0;
    refreshAllData(input);
  }
}

Fixed version (ground truth):
/** 
 * Sets or clears the input for this time graph viewer. The input array should only contain top-level elements.
 * @param input the input of this time graph viewer, or <code>null</code> if none
 */
public void setInput(ITimeGraphEntry[] input){
  if (null != _stateCtrl) {
    if (null == input) {
      input=new ITimeGraphEntry[0];
    }
    setTimeRange(input);
    _verticalScrollBar.setEnabled(true);
    setTopIndex(0);
    _selectedTime=0;
    _selectedEntry=null;
    refreshAllData(input);
  }
}
Program: 92220
Project: 92220
Buggy source:
private boolean importResources(String rootDirectory,Map<String,File> fileSystemObjects){
  List<File> fileList=new ArrayList<File>();
  for (  Entry<String,File> entry : fileSystemObjects.entrySet()) {
    fileList.add(entry.getValue());
  }
  Collections.sort(fileList,new Comparator<File>(){
    @Override public int compare(    File o1,    File o2){
      String v1=o1.getAbsolutePath() + File.separatorChar;
      String v2=o2.getAbsolutePath() + File.separatorChar;
      return v1.compareTo(v2);
    }
  }
);
  boolean ok=true;
  boolean isLinked=createLinksInWorkspaceButton.getSelection();
  for (int i=0; i < fileList.size(); i++) {
    File resource=fileList.get(i);
    File parentFolder=new File(resource.getParent());
    List<File> subList=new ArrayList<File>();
    subList.add(resource);
    if (resource.isDirectory()) {
      String prefix=resource.getAbsolutePath();
      boolean hasSamePrefix=true;
      for (int j=i; j < fileList.size() && hasSamePrefix; j++) {
        File res=fileList.get(j);
        hasSamePrefix=res.getAbsolutePath().startsWith(prefix);
        if (hasSamePrefix) {
          if (!isLinked) {
            subList.add(res);
          }
          i=j;
        }
      }
    }
    FileSystemStructureProvider fileSystemStructureProvider=FileSystemStructureProvider.INSTANCE;
    ImportOperation operation=new ImportOperation(getContainerFullPath(),parentFolder,fileSystemStructureProvider,this,subList);
    operation.setContext(getShell());
    ok=executeImportOperation(operation);
  }
  return ok;
}

Fixed version (ground truth):
private boolean importResources(String rootDirectory,Map<String,File> fileSystemObjects){
  List<File> fileList=new ArrayList<File>();
  for (  Entry<String,File> entry : fileSystemObjects.entrySet()) {
    fileList.add(entry.getValue());
  }
  Collections.sort(fileList,new Comparator<File>(){
    @Override public int compare(    File o1,    File o2){
      String v1=o1.getAbsolutePath() + File.separatorChar;
      String v2=o2.getAbsolutePath() + File.separatorChar;
      return v1.compareTo(v2);
    }
  }
);
  boolean ok=true;
  boolean isLinked=createLinksInWorkspaceButton.getSelection();
  for (int i=0; i < fileList.size(); i++) {
    File resource=fileList.get(i);
    File parentFolder=new File(resource.getParent());
    List<File> subList=new ArrayList<File>();
    subList.add(resource);
    if (resource.isDirectory()) {
      String prefix=resource.getAbsolutePath() + File.separatorChar;
      boolean hasSamePrefix=true;
      for (int j=i + 1; j < fileList.size() && hasSamePrefix; j++) {
        File res=fileList.get(j);
        hasSamePrefix=res.getAbsolutePath().startsWith(prefix);
        if (hasSamePrefix) {
          if (!isLinked) {
            subList.add(res);
          }
          i=j;
        }
      }
    }
    FileSystemStructureProvider fileSystemStructureProvider=FileSystemStructureProvider.INSTANCE;
    ImportOperation operation=new ImportOperation(getContainerFullPath(),parentFolder,fileSystemStructureProvider,this,subList);
    operation.setContext(getShell());
    ok=executeImportOperation(operation);
  }
  return ok;
}
Program: 92222
Project: 92222
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) {
    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) {
    if (time1 - time0 > timeWidth) {
      hitTime=time0 + (long)Math.ceil((time1 - time0) * ((double)x / timeWidth));
    }
 else {
      hitTime=time0 + (long)Math.floor((time1 - time0) * ((double)x / timeWidth));
    }
  }
  return hitTime;
}
Program: 92223
Project: 92223
Buggy source:
public void testGetTimestamp() throws Exception {
  assertTrue("String_Node_Str",fExperiment.getTimestamp(0).equals(new TmfTimestamp(1,(byte)-3)));
  assertTrue("String_Node_Str",fExperiment.getTimestamp(10).equals(new TmfTimestamp(11,(byte)-3)));
  assertTrue("String_Node_Str",fExperiment.getTimestamp(100).equals(new TmfTimestamp(101,(byte)-3)));
  assertTrue("String_Node_Str",fExperiment.getTimestamp(1000).equals(new TmfTimestamp(1001,(byte)-3)));
  assertTrue("String_Node_Str",fExperiment.getTimestamp(2000).equals(new TmfTimestamp(2001,(byte)-3)));
  assertTrue("String_Node_Str",fExperiment.getTimestamp(2500).equals(new TmfTimestamp(2501,(byte)-3)));
  assertNull("String_Node_Str",fExperiment.getTimestamp(10000));
}

Fixed version (ground truth):
public void testGetTimestamp() throws Exception {
  assertEquals("String_Node_Str",new TmfTimestamp(1,(byte)-3),fExperiment.getTimestamp(0));
  assertEquals("String_Node_Str",new TmfTimestamp(2,(byte)-3),fExperiment.getTimestamp(1));
  assertEquals("String_Node_Str",new TmfTimestamp(11,(byte)-3),fExperiment.getTimestamp(10));
  assertEquals("String_Node_Str",new TmfTimestamp(101,(byte)-3),fExperiment.getTimestamp(100));
  assertEquals("String_Node_Str",new TmfTimestamp(1001,(byte)-3),fExperiment.getTimestamp(1000));
  assertEquals("String_Node_Str",new TmfTimestamp(2001,(byte)-3),fExperiment.getTimestamp(2000));
  assertEquals("String_Node_Str",new TmfTimestamp(2501,(byte)-3),fExperiment.getTimestamp(2500));
  assertEquals("String_Node_Str",new TmfTimestamp(10000,(byte)-3),fExperiment.getTimestamp(9999));
  assertNull("String_Node_Str",fExperiment.getTimestamp(10000));
}
Program: 92225
Project: 92225
Buggy source:
private boolean importResources(String rootDirectory,Map<String,File> fileSystemObjects){
  List<File> fileList=new ArrayList<File>();
  for (  Entry<String,File> entry : fileSystemObjects.entrySet()) {
    fileList.add(entry.getValue());
  }
  Collections.sort(fileList);
  boolean ok=true;
  boolean isLinked=createLinksInWorkspaceButton.getSelection();
  for (int i=0; i < fileList.size(); i++) {
    File resource=fileList.get(i);
    File parentFolder=new File(resource.getParent());
    List<File> subList=new ArrayList<File>();
    subList.add(resource);
    if (resource.isDirectory()) {
      String prefix=resource.getAbsolutePath();
      boolean hasSamePrefix=true;
      for (int j=i; j < fileList.size() && hasSamePrefix; j++) {
        File res=fileList.get(j);
        hasSamePrefix=res.getAbsolutePath().startsWith(prefix);
        if (hasSamePrefix) {
          if (!isLinked) {
            subList.add(res);
          }
          i=j;
        }
      }
    }
    FileSystemStructureProvider fileSystemStructureProvider=FileSystemStructureProvider.INSTANCE;
    ImportOperation operation=new ImportOperation(getContainerFullPath(),parentFolder,fileSystemStructureProvider,this,subList);
    operation.setContext(getShell());
    ok=executeImportOperation(operation);
  }
  return ok;
}

Fixed version (ground truth):
private boolean importResources(String rootDirectory,Map<String,File> fileSystemObjects){
  List<File> fileList=new ArrayList<File>();
  for (  Entry<String,File> entry : fileSystemObjects.entrySet()) {
    fileList.add(entry.getValue());
  }
  Collections.sort(fileList,new Comparator<File>(){
    @Override public int compare(    File o1,    File o2){
      String v1=o1.getAbsolutePath() + File.separatorChar;
      String v2=o2.getAbsolutePath() + File.separatorChar;
      return v1.compareTo(v2);
    }
  }
);
  boolean ok=true;
  boolean isLinked=createLinksInWorkspaceButton.getSelection();
  for (int i=0; i < fileList.size(); i++) {
    File resource=fileList.get(i);
    File parentFolder=new File(resource.getParent());
    List<File> subList=new ArrayList<File>();
    subList.add(resource);
    if (resource.isDirectory()) {
      String prefix=resource.getAbsolutePath();
      boolean hasSamePrefix=true;
      for (int j=i; j < fileList.size() && hasSamePrefix; j++) {
        File res=fileList.get(j);
        hasSamePrefix=res.getAbsolutePath().startsWith(prefix);
        if (hasSamePrefix) {
          if (!isLinked) {
            subList.add(res);
          }
          i=j;
        }
      }
    }
    FileSystemStructureProvider fileSystemStructureProvider=FileSystemStructureProvider.INSTANCE;
    ImportOperation operation=new ImportOperation(getContainerFullPath(),parentFolder,fileSystemStructureProvider,this,subList);
    operation.setContext(getShell());
    ok=executeImportOperation(operation);
  }
  return ok;
}
Program: 92226
Project: 92226
Buggy source:
/** 
 * Convert a string representing a time to the corresponding long. <p>
 * @param time the string to convert
 * @return the corresponding nanoseconds value
 */
public static long stringToNanoseconds(String time){
  long result=0L;
  StringBuffer buffer=new StringBuffer(time);
  try {
    int dot=buffer.indexOf("String_Node_Str");
    if (dot == -1) {
      buffer.insert(0,"String_Node_Str");
      dot=0;
    }
    for (int i=buffer.length() - dot - 1; i < 9; i++)     buffer.append("String_Node_Str");
    int nbDecimals=buffer.substring(dot + 1).length();
    if (nbDecimals > 9)     buffer.delete(buffer.substring(0,dot + 1 + 9).length(),buffer.length());
    long seconds=(dot > 0) ? Long.parseLong(buffer.substring(0,dot)) : 0;
    seconds=Math.abs(seconds);
    long nanosecs=Long.parseLong(buffer.substring(dot + 1));
    result=seconds * 1000000000 + nanosecs;
  }
 catch (  NumberFormatException e) {
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Convert a string representing a time to the corresponding long. <p>
 * @param time the string to convert
 * @return the corresponding nanoseconds value
 */
public static long stringToNanoseconds(String time){
  long result=0L;
  StringBuffer buffer=new StringBuffer(time);
  try {
    int dot=buffer.indexOf("String_Node_Str");
    if (dot == -1) {
      if (time.length() > 9) {
        long nanos=Long.parseLong(time.substring(time.length() - 9));
        long secs=Long.parseLong(time.substring(0,time.length() - 9));
        result=(secs * 1000000000) + nanos;
      }
 else {
        result=Long.parseLong(time);
      }
    }
 else {
      for (int i=buffer.length() - dot - 1; i < 9; i++) {
        buffer.append("String_Node_Str");
      }
      int nbDecimals=buffer.substring(dot + 1).length();
      if (nbDecimals > 9) {
        buffer.delete(buffer.substring(0,dot + 1 + 9).length(),buffer.length());
      }
      long seconds=(dot > 0) ? Long.parseLong(buffer.substring(0,dot)) : 0;
      seconds=Math.abs(seconds);
      long nanosecs=Long.parseLong(buffer.substring(dot + 1));
      result=(seconds * 1000000000) + nanosecs;
    }
  }
 catch (  NumberFormatException e) {
  }
  return result;
}
Program: 92227
Project: 92227
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 (fCurrentExperiment != 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 (fCurrentExperiment != null) {
    long delta=newDuration - fWindowSpan;
    long newStartTime=fWindowStartTime + (delta / 2);
    setNewRange(newStartTime,newDuration);
  }
}