nus-yam/ex-repair huggingface dataset:
Program: 92348
Project: 92348
Buggy source:
public static int getColorSettingPriority(ITmfEvent event){
  for (int i=0; i < fColorSettings.length; i++) {
    ColorSetting colorSetting=fColorSettings[i];
    if (colorSetting.getFilter() != null && colorSetting.getFilter().matches(event)) {
      return i;
    }
  }
  return PRIORITY_NONE;
}

Fixed version (ground truth):
/** 
 * Gets the color settings priority for the given event.
 * @param event A event the event to check
 * @return the priority defined for the filter else PRIORITY_NONE
 */
public static int getColorSettingPriority(ITmfEvent event){
  for (int i=0; i < fColorSettings.length; i++) {
    ColorSetting colorSetting=fColorSettings[i];
    if (colorSetting.getFilter() != null && colorSetting.getFilter().matches(event)) {
      return i;
    }
  }
  return PRIORITY_NONE;
}
Program: 92349
Project: 92349
Buggy source:
public static void addColorSettingsListener(IColorSettingsListener listener){
  if (!fListeners.contains(listener)) {
    fListeners.add(listener);
  }
}

Fixed version (ground truth):
/** 
 * Adds a color settings listener.
 * @param listener A listener to add.
 */
public static void addColorSettingsListener(IColorSettingsListener listener){
  if (!fListeners.contains(listener)) {
    fListeners.add(listener);
  }
}
Program: 92350
Project: 92350
Buggy source:
public static void setColorSettings(ColorSetting[] colorSettings){
  fColorSettings=(colorSettings != null) ? Arrays.copyOf(colorSettings,colorSettings.length) : null;
  ColorSettingsXML.save(COLOR_SETTINGS_PATH_NAME,fColorSettings);
  fireColorSettingsChanged();
}

Fixed version (ground truth):
/** 
 * Sets the array of color settings.
 * @param colorSettings A array of color settings to set
 */
public static void setColorSettings(ColorSetting[] colorSettings){
  fColorSettings=(colorSettings != null) ? Arrays.copyOf(colorSettings,colorSettings.length) : null;
  ColorSettingsXML.save(COLOR_SETTINGS_PATH_NAME,fColorSettings);
  fireColorSettingsChanged();
}
Program: 92351
Project: 92351
Buggy source:
public static ColorSetting getColorSetting(int priority){
  if (priority < fColorSettings.length) {
    return fColorSettings[priority];
  }
  return DEFAULT_COLOR_SETTING;
}

Fixed version (ground truth):
/** 
 * Returns the color settings based the priority. 
 * @param priority A priority (index) of color settings
 * @return the color settings defined for the priority else default color settings
 */
public static ColorSetting getColorSetting(int priority){
  if (priority < fColorSettings.length) {
    return fColorSettings[priority];
  }
  return DEFAULT_COLOR_SETTING;
}
Program: 92352
Project: 92352
Buggy source:
public static void removeColorSettingsListener(IColorSettingsListener listener){
  fListeners.remove(listener);
}

Fixed version (ground truth):
/** 
 * Removes a color settings listener.
 * @param listener A listener to remove.
 */
public static void removeColorSettingsListener(IColorSettingsListener listener){
  fListeners.remove(listener);
}
Program: 92353
Project: 92353
Buggy source:
public static ColorSetting[] getColorSettings(){
  return (fColorSettings != null) ? Arrays.copyOf(fColorSettings,fColorSettings.length) : null;
}

Fixed version (ground truth):
/** 
 * Returns an array of color settings.
 * @return an array of color settings.
 */
public static ColorSetting[] getColorSettings(){
  return (fColorSettings != null) ? Arrays.copyOf(fColorSettings,fColorSettings.length) : null;
}
Program: 92354
Project: 92354
Buggy source:
/** 
 * Parse a single field from its given name.<p>
 * @return  The parsed field or null.
 * @see @see org.eclipse.linuxtools.lttng.event.LttngEventField
 */
@Override public synchronized LttngEventField getField(String name){
  if (name.equals(LttngEventType.CONTENT_LABEL) || name.equals(ITmfEvent.EVENT_FIELD_CONTENT)) {
    return new LttngEventField(toString());
  }
 else   if (name.equals(LttngEventType.MARKER_LABEL) || name.equals(ITmfEvent.EVENT_FIELD_TYPE)) {
    return new LttngEventField(fParentEvent.getType().getName());
  }
 else   if (name.equals(LttngEventType.TRACE_LABEL) || name.equals(ITmfEvent.EVENT_FIELD_REFERENCE)) {
    return new LttngEventField(fParentEvent.getReference());
  }
 else   if (name.equals(LttngEventType.TIMESTAMP_LABEL) || name.equals(ITmfEvent.EVENT_FIELD_TIMESTAMP)) {
    return new LttngEventField(fParentEvent.getTimestamp().toString());
  }
 else   if (name.equals(ITmfEvent.EVENT_FIELD_SOURCE)) {
    return new LttngEventField(fParentEvent.getSource());
  }
  LttngEventField returnedField=fFieldsMap.get(name);
  if (returnedField == null) {
    JniEvent tmpEvent=((LttngEvent)getEvent()).convertEventTmfToJni();
    if (tmpEvent != null) {
      Object newValue=tmpEvent.parseFieldByName(name);
      if (newValue != null) {
        returnedField=new LttngEventField(name,newValue);
        fFieldsMap.put(name,returnedField);
      }
    }
  }
  return returnedField;
}

Fixed version (ground truth):
/** 
 * Parse a single field from its given name.<p>
 * @return  The parsed field or null.
 * @see @see org.eclipse.linuxtools.lttng.event.LttngEventField
 */
@Override public synchronized LttngEventField getField(String name){
  if (name.equals(LttngEventType.CONTENT_LABEL) || name.equals(ITmfEvent.EVENT_FIELD_CONTENT)) {
    return new LttngEventField(LttngEventType.CONTENT_LABEL,toString());
  }
 else   if (name.equals(LttngEventType.MARKER_LABEL) || name.equals(ITmfEvent.EVENT_FIELD_TYPE)) {
    return new LttngEventField(LttngEventType.MARKER_LABEL,fParentEvent.getType().getName());
  }
 else   if (name.equals(LttngEventType.TRACE_LABEL) || name.equals(ITmfEvent.EVENT_FIELD_REFERENCE)) {
    return new LttngEventField(LttngEventType.TRACE_LABEL,fParentEvent.getReference());
  }
 else   if (name.equals(LttngEventType.TIMESTAMP_LABEL) || name.equals(ITmfEvent.EVENT_FIELD_TIMESTAMP)) {
    return new LttngEventField(LttngEventType.TIMESTAMP_LABEL,fParentEvent.getTimestamp().toString());
  }
 else   if (name.equals(ITmfEvent.EVENT_FIELD_SOURCE)) {
    return new LttngEventField(ITmfEvent.EVENT_FIELD_SOURCE,fParentEvent.getSource());
  }
  LttngEventField returnedField=fFieldsMap.get(name);
  if (returnedField == null) {
    JniEvent tmpEvent=((LttngEvent)getEvent()).convertEventTmfToJni();
    if (tmpEvent != null) {
      Object newValue=tmpEvent.parseFieldByName(name);
      if (newValue != null) {
        returnedField=new LttngEventField(name,newValue);
        fFieldsMap.put(name,returnedField);
      }
    }
  }
  return returnedField;
}
Program: 92355
Project: 92355
Buggy source:
@Override public void initTrace(final IResource resource,final String path,final Class<CustomTxtEvent> eventType) throws TmfTraceException {
  super.initTrace(resource,path,eventType);
}

Fixed version (ground truth):
@Override public void initTrace(final IResource resource,final String path,final Class<CustomTxtEvent> eventType) throws TmfTraceException {
  super.initTrace(resource,path,eventType);
  indexTrace(false);
}
Program: 92356
Project: 92356
Buggy source:
@Override public void initTrace(final IResource resource,final String path,final Class<CustomXmlEvent> eventType) throws TmfTraceException {
  super.initTrace(resource,path,eventType);
}

Fixed version (ground truth):
@Override public void initTrace(final IResource resource,final String path,final Class<CustomXmlEvent> eventType) throws TmfTraceException {
  super.initTrace(resource,path,eventType);
  indexTrace(false);
}
Program: 92358
Project: 92358
Buggy source:
/** 
 * Method readNextEvent.
 * @param context ITmfContext
 * @return CtfTmfEvent
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getNext(ITmfContext)
 */
@Override public synchronized CtfTmfEvent getNext(final ITmfContext context){
  CtfTmfEvent event=null;
  if (context instanceof CtfIterator) {
    CtfIterator ctfIterator=(CtfIterator)context;
    event=ctfIterator.getCurrentEvent();
    ctfIterator.advance();
  }
  return event;
}

Fixed version (ground truth):
/** 
 * Method readNextEvent.
 * @param context ITmfContext
 * @return CtfTmfEvent
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getNext(ITmfContext)
 */
@Override public synchronized CtfTmfEvent getNext(final ITmfContext context){
  CtfTmfEvent event=null;
  if (context instanceof CtfIterator) {
    CtfIterator ctfIterator=(CtfIterator)context;
    event=ctfIterator.getCurrentEvent();
    ctfIterator.advance();
    if (event != null) {
      updateAttributes(context,event.getTimestamp());
    }
  }
  return event;
}
Program: 92359
Project: 92359
Buggy source:
/** 
 * Method initTrace.
 * @param resource IResource
 * @param path String
 * @param eventType Class<CtfTmfEvent>
 * @throws TmfTraceException
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#initTrace(IResource, String, Class<CtfTmfEvent>)
 */
@Override public void initTrace(final IResource resource,final String path,final Class<CtfTmfEvent> eventType) throws TmfTraceException {
  super.initTrace(resource,path,eventType);
  EventDeclaration ed;
  ITmfEventField eventField;
  @SuppressWarnings("String_Node_Str") CtfTmfEventType type;
  try {
    this.fTrace=new CTFTrace(path);
    for (int i=0; i < this.fTrace.getNbEventTypes(); i++) {
      ed=this.fTrace.getEventType(i);
      eventField=parseDeclaration(ed);
      type=new CtfTmfEventType(ed.getName(),eventField);
    }
    final CtfIterator iterator=new CtfIterator(this,0,0);
    if (iterator.getLocation().equals(CtfIterator.NULL_LOCATION)) {
      this.setStartTime(TmfTimestamp.BIG_BANG);
    }
 else {
      this.setStartTime(iterator.getCurrentEvent().getTimestamp());
      if (iterator.hasMoreEvents()) {
        iterator.goToLastEvent();
      }
      this.setEndTime(iterator.getCurrentEvent().getTimestamp());
    }
  }
 catch (  final CTFReaderException e) {
    throw new TmfTraceException(e.getMessage(),e);
  }
  TmfSignalManager.register(this);
  buildStateSystem();
  if (resource != null) {
    try {
      resource.getProject().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      throw new TmfTraceException(e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Method initTrace.
 * @param resource IResource
 * @param path String
 * @param eventType Class<CtfTmfEvent>
 * @throws TmfTraceException
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#initTrace(IResource, String, Class<CtfTmfEvent>)
 */
@Override public void initTrace(final IResource resource,final String path,final Class<CtfTmfEvent> eventType) throws TmfTraceException {
  super.initTrace(resource,path,eventType);
  EventDeclaration ed;
  ITmfEventField eventField;
  setCacheSize();
  @SuppressWarnings("String_Node_Str") CtfTmfEventType type;
  try {
    this.fTrace=new CTFTrace(path);
    for (int i=0; i < this.fTrace.getNbEventTypes(); i++) {
      ed=this.fTrace.getEventType(i);
      eventField=parseDeclaration(ed);
      type=new CtfTmfEventType(ed.getName(),eventField);
    }
    final CtfIterator iterator=new CtfIterator(this,0,0);
    if (iterator.getLocation().equals(CtfIterator.NULL_LOCATION)) {
      this.setStartTime(TmfTimestamp.BIG_BANG);
    }
 else {
      this.setStartTime(iterator.getCurrentEvent().getTimestamp());
      if (iterator.hasMoreEvents()) {
        iterator.goToLastEvent();
      }
      this.setEndTime(iterator.getCurrentEvent().getTimestamp());
    }
  }
 catch (  final CTFReaderException e) {
    throw new TmfTraceException(e.getMessage(),e);
  }
  buildStateSystem();
  if (resource != null) {
    try {
      resource.getProject().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      throw new TmfTraceException(e.getMessage(),e);
    }
  }
}
Program: 92360
Project: 92360
Buggy source:
private void refresh(final long windowRange){
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphCombo.isDisposed()) {
        return;
      }
      ITimeGraphEntry[] entries=fEntryList.toArray(new ITimeGraphEntry[0]);
      Arrays.sort(entries);
      fTimeGraphCombo.setInput(entries);
      fTimeGraphCombo.getTimeGraphViewer().setTimeBounds(fStartTime,fEndTime);
      long endTime=fStartTime + windowRange;
      if (fEndTime < endTime) {
        endTime=fEndTime;
      }
      fTimeGraphCombo.getTimeGraphViewer().setStartFinishTime(fStartTime,endTime);
      for (      TreeColumn column : fTimeGraphCombo.getTreeViewer().getTree().getColumns()) {
        column.pack();
      }
      startZoomThread(fStartTime,endTime);
    }
  }
);
}

Fixed version (ground truth):
private void refresh(final long windowRange){
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphCombo.isDisposed()) {
        return;
      }
      ITimeGraphEntry[] entries=fEntryList.toArray(new ITimeGraphEntry[0]);
      Arrays.sort(entries,fControlFlowEntryComparator);
      fTimeGraphCombo.setInput(entries);
      fTimeGraphCombo.getTimeGraphViewer().setTimeBounds(fStartTime,fEndTime);
      long endTime=fStartTime + windowRange;
      if (fEndTime < endTime) {
        endTime=fEndTime;
      }
      fTimeGraphCombo.getTimeGraphViewer().setStartFinishTime(fStartTime,endTime);
      for (      TreeColumn column : fTimeGraphCombo.getTreeViewer().getTree().getColumns()) {
        column.pack();
      }
      startZoomThread(fStartTime,endTime);
    }
  }
);
}
Program: 92362
Project: 92362
Buggy source:
public TraceEntry(CtfKernelTrace trace,String name){
  fTrace=trace;
  fChildren=new ArrayList<ResourcesEntry>();
  fName=name;
}

Fixed version (ground truth):
public TraceEntry(CtfKernelTrace trace,String name,long startTime,long endTime){
  fTrace=trace;
  fChildren=new ArrayList<ResourcesEntry>();
  fName=name;
  fTraceStartTime=startTime;
  fTraceEndTime=endTime;
}
Program: 92363
Project: 92363
Buggy source:
@Override public long getEndTime(){
  return -1;
}

Fixed version (ground truth):
@Override public long getEndTime(){
  return fTraceEndTime;
}
Program: 92364
Project: 92364
Buggy source:
@Override public long getStartTime(){
  return -1;
}

Fixed version (ground truth):
@Override public long getStartTime(){
  return fTraceStartTime;
}
Program: 92365
Project: 92365
Buggy source:
private void refresh(final long windowRange){
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphViewer.getControl().isDisposed()) {
        return;
      }
      ITimeGraphEntry[] entries=fEntryList.toArray(new ITimeGraphEntry[0]);
      Arrays.sort(entries);
      fTimeGraphViewer.setInput(entries);
      fTimeGraphViewer.setTimeBounds(fStartTime,fEndTime);
      long endTime=fStartTime + windowRange;
      if (fEndTime < endTime) {
        endTime=fEndTime;
      }
      fTimeGraphViewer.setStartFinishTime(fStartTime,endTime);
      startZoomThread(fStartTime,endTime);
    }
  }
);
}

Fixed version (ground truth):
private void refresh(final long windowRange){
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      if (fTimeGraphViewer.getControl().isDisposed()) {
        return;
      }
      ITimeGraphEntry[] entries=fEntryList.toArray(new ITimeGraphEntry[0]);
      Arrays.sort(entries,new TraceEntryComparator());
      fTimeGraphViewer.setInput(entries);
      fTimeGraphViewer.setTimeBounds(fStartTime,fEndTime);
      long endTime=fStartTime + windowRange;
      if (fEndTime < endTime) {
        endTime=fEndTime;
      }
      fTimeGraphViewer.setStartFinishTime(fStartTime,endTime);
      startZoomThread(fStartTime,endTime);
    }
  }
);
}
Program: 92368
Project: 92368
Buggy source:
private void processData(){
  String timeStampString=fData.get(CustomTraceDefinition.TAG_TIMESTAMP);
  String timeStampInputFormat=fData.get(TIMESTAMP_INPUT_FORMAT_KEY);
  Date date=null;
  if (timeStampInputFormat != null && timeStampString != null) {
    SimpleDateFormat dateFormat=new SimpleDateFormat(timeStampInputFormat);
    try {
      date=dateFormat.parse(timeStampString);
      setTimestamp(new TmfTimestamp(date.getTime(),TIMESTAMP_SCALE));
    }
 catch (    ParseException e) {
      setTimestamp(TmfTimestamp.ZERO);
    }
  }
 else {
    setTimestamp(TmfTimestamp.ZERO);
  }
  int i=0;
  fColumnData=new TmfEventField[fDefinition.outputs.size()];
  for (  OutputColumn outputColumn : fDefinition.outputs) {
    String value=fData.get(outputColumn.name);
    if (outputColumn.name.equals(CustomTraceDefinition.TAG_TIMESTAMP) && date != null) {
      SimpleDateFormat dateFormat=new SimpleDateFormat(fDefinition.timeStampOutputFormat);
      fColumnData[i++]=new TmfEventField(outputColumn.name,dateFormat.format(date));
    }
 else {
      fColumnData[i++]=new TmfEventField(outputColumn.name,(value != null ? value : "String_Node_Str"));
    }
  }
  fData=null;
}

Fixed version (ground truth):
private void processData(){
  String timeStampString=fData.get(CustomTraceDefinition.TAG_TIMESTAMP);
  String timeStampInputFormat=fData.get(TIMESTAMP_INPUT_FORMAT_KEY);
  Date date=null;
  if (timeStampInputFormat != null && timeStampString != null) {
    SimpleDateFormat dateFormat=new SimpleDateFormat(timeStampInputFormat);
    try {
      date=dateFormat.parse(timeStampString);
      setTimestamp(new TmfTimestamp(date.getTime(),TIMESTAMP_SCALE));
    }
 catch (    ParseException e) {
      setTimestamp(TmfTimestamp.ZERO);
    }
  }
 else {
    setTimestamp(TmfTimestamp.ZERO);
  }
  int i=0;
  fColumnData=new TmfEventField[fDefinition.outputs.size()];
  for (  OutputColumn outputColumn : fDefinition.outputs) {
    String value=fData.get(outputColumn.name);
    if (outputColumn.name.equals(CustomTraceDefinition.TAG_TIMESTAMP) && date != null) {
      SimpleDateFormat dateFormat=new SimpleDateFormat(fDefinition.timeStampOutputFormat);
      fColumnData[i++]=new TmfEventField(outputColumn.name,dateFormat.format(date));
    }
 else {
      fColumnData[i++]=new TmfEventField(outputColumn.name,(value != null ? value : "String_Node_Str"));
    }
  }
  CustomEventContent content=(CustomEventContent)getContent();
  content.setFields(fColumnData);
  fData=null;
}
Program: 92369
Project: 92369
Buggy source:
/** 
 * Given a timestamp, this methods returns the first PacketIndexEntry that could include the timestamp, that is the last packet with a begin timestamp smaller than the given timestamp.
 * @param timestamp The timestamp to look for.
 * @return The StreamInputPacketEntry that corresponds to the packet thatincludes the given timestamp.
 */
public ListIterator<StreamInputPacketIndexEntry> search(final long timestamp){
  int max=this.entries.size() - 1;
  int min=0;
  int guessI;
  StreamInputPacketIndexEntry guessEntry=null;
  if (timestamp < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (; ; ) {
    guessI=(max + min + 1) / 2;
    guessEntry=this.entries.get(guessI);
    if (min == max) {
      break;
    }
    if (timestamp < guessEntry.getTimestampBegin()) {
      max=guessI - 1;
    }
 else     if (timestamp >= guessEntry.getTimestampBegin()) {
      min=guessI;
    }
  }
  return this.entries.listIterator(guessI);
}

Fixed version (ground truth):
/** 
 * Given a timestamp, this methods returns the first PacketIndexEntry that could include the timestamp, that is the last packet with a begin timestamp smaller than the given timestamp.
 * @param timestamp The timestamp to look for.
 * @return The StreamInputPacketEntry that corresponds to the packet thatincludes the given timestamp.
 */
public ListIterator<StreamInputPacketIndexEntry> search(final long timestamp){
  int max=this.entries.size() - 1;
  int min=0;
  int guessI;
  StreamInputPacketIndexEntry guessEntry=null;
  if (this.getEntries().isEmpty()) {
    return this.getEntries().listIterator();
  }
  if (timestamp < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (; ; ) {
    guessI=(max + min + 1) / 2;
    guessEntry=this.entries.get(guessI);
    if (min == max) {
      break;
    }
    if (timestamp < guessEntry.getTimestampBegin()) {
      max=guessI - 1;
    }
 else     if (timestamp >= guessEntry.getTimestampBegin()) {
      min=guessI;
    }
  }
  return this.entries.listIterator(guessI);
}
Program: 92370
Project: 92370
Buggy source:
/** 
 * Method increaseRank.
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfContext#increaseRank()
 */
@Override public void increaseRank(){
  curRank++;
}

Fixed version (ground truth):
/** 
 * Method increaseRank.
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfContext#increaseRank()
 */
@Override public void increaseRank(){
  if (hasValidRank()) {
    curRank++;
  }
}
Program: 92371
Project: 92371
Buggy source:
/** 
 * Method readNextEvent.
 * @param context ITmfContext
 * @return CtfTmfEvent
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getNext(ITmfContext)
 */
@Override public synchronized CtfTmfEvent getNext(final ITmfContext context){
  CtfTmfEvent event=null;
  if (context instanceof CtfIterator) {
    CtfIterator ctfIterator=(CtfIterator)context;
    event=ctfIterator.getCurrentEvent();
    ctfIterator.advance();
    if (event != null) {
      updateAttributes(context,event.getTimestamp());
    }
  }
  return event;
}

Fixed version (ground truth):
/** 
 * Method readNextEvent.
 * @param context ITmfContext
 * @return CtfTmfEvent
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getNext(ITmfContext)
 */
@Override public synchronized CtfTmfEvent getNext(final ITmfContext context){
  CtfTmfEvent event=null;
  if (context instanceof CtfIterator) {
    CtfIterator ctfIterator=(CtfIterator)context;
    event=ctfIterator.getCurrentEvent();
    if (event != null) {
      updateAttributes(context,event.getTimestamp());
      ctfIterator.advance();
      ctfIterator.increaseRank();
    }
  }
  return event;
}
Program: 92372
Project: 92372
Buggy source:
/** 
 * Method initTrace.
 * @param resource IResource
 * @param path String
 * @param eventType Class<CtfTmfEvent>
 * @throws TmfTraceException
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#initTrace(IResource, String, Class<CtfTmfEvent>)
 */
@Override public void initTrace(final IResource resource,final String path,final Class<CtfTmfEvent> eventType) throws TmfTraceException {
  super.initTrace(resource,path,eventType);
  EventDeclaration ed;
  ITmfEventField eventField;
  setCacheSize();
  @SuppressWarnings("String_Node_Str") CtfTmfEventType type;
  try {
    this.fTrace=new CTFTrace(path);
    for (int i=0; i < this.fTrace.getNbEventTypes(); i++) {
      ed=this.fTrace.getEventType(i);
      eventField=parseDeclaration(ed);
      type=new CtfTmfEventType(ed.getName(),eventField);
    }
    final CtfIterator iterator=new CtfIterator(this,0,0);
    if (iterator.getLocation().equals(CtfIterator.NULL_LOCATION)) {
      this.setStartTime(TmfTimestamp.BIG_BANG);
    }
 else {
      this.setStartTime(iterator.getCurrentEvent().getTimestamp());
      if (iterator.hasMoreEvents()) {
        iterator.goToLastEvent();
      }
      this.setEndTime(iterator.getCurrentEvent().getTimestamp());
    }
  }
 catch (  final CTFReaderException e) {
    throw new TmfTraceException(e.getMessage(),e);
  }
  buildStateSystem();
  if (resource != null) {
    try {
      resource.getProject().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      throw new TmfTraceException(e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Method initTrace.
 * @param resource IResource
 * @param path String
 * @param eventType Class<CtfTmfEvent>
 * @throws TmfTraceException
 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#initTrace(IResource, String, Class<CtfTmfEvent>)
 */
@Override public void initTrace(final IResource resource,final String path,final Class<CtfTmfEvent> eventType) throws TmfTraceException {
  setCacheSize();
  super.initTrace(resource,path,eventType);
  EventDeclaration ed;
  ITmfEventField eventField;
  @SuppressWarnings("String_Node_Str") CtfTmfEventType type;
  try {
    this.fTrace=new CTFTrace(path);
    for (int i=0; i < this.fTrace.getNbEventTypes(); i++) {
      ed=this.fTrace.getEventType(i);
      eventField=parseDeclaration(ed);
      type=new CtfTmfEventType(ed.getName(),eventField);
    }
    final CtfIterator iterator=new CtfIterator(this,0,0);
    if (iterator.getLocation().equals(CtfIterator.NULL_LOCATION)) {
      this.setStartTime(TmfTimestamp.BIG_BANG);
    }
 else {
      this.setStartTime(iterator.getCurrentEvent().getTimestamp());
      this.setEndTime(iterator.getCurrentEvent().getTimestamp());
    }
  }
 catch (  final CTFReaderException e) {
    throw new TmfTraceException(e.getMessage(),e);
  }
  buildStateSystem();
  if (resource != null) {
    try {
      resource.getProject().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      throw new TmfTraceException(e.getMessage(),e);
    }
  }
}
Program: 92373
Project: 92373
Buggy source:
@Override public void setTimeBounds(long beginTime,long endTime){
  _beginTime=beginTime;
  _endTime=endTime;
  _time0_=beginTime;
  _time1_=endTime;
  _stateCtrl.adjustScrolls();
  _stateCtrl.redraw();
  _timeScaleCtrl.redraw();
}

Fixed version (ground truth):
@Override public void setTimeBounds(long beginTime,long endTime){
  _beginTime=beginTime;
  _endTime=endTime;
  _time0_=beginTime;
  _time1_=endTime;
  _stateCtrl.adjustScrolls();
}
Program: 92374
Project: 92374
Buggy source:
@Override public void initTrace(final IResource resource,final String path,final Class<T> type) throws TmfTraceException {
  initialize(resource,path,type);
}

Fixed version (ground truth):
@Override @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void initTrace(final IResource resource,final String path,final Class<T> type) throws TmfTraceException {
  fIndexer=new TmfCheckpointIndexer(this,fCacheSize);
  initialize(resource,path,type);
}
Program: 92376
Project: 92376
Buggy source:
@Override protected void finalize(){
  for (  FileChannel fc : streamFileChannels) {
    if (fc != null) {
      try {
        fc.close();
      }
 catch (      IOException e) {
      }
    }
  }
  try {
    super.finalize();
  }
 catch (  Throwable e) {
  }
}

Fixed version (ground truth):
@Override protected void finalize() throws Throwable {
  for (  FileChannel fc : streamFileChannels) {
    if (fc != null) {
      try {
        fc.close();
      }
 catch (      IOException e) {
      }
    }
  }
  super.finalize();
}
Program: 92377
Project: 92377
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public String toString(){
  if (equals(BIG_BANG)) {
    return "String_Node_Str";
  }
  if (equals(BIG_CRUNCH)) {
    return "String_Node_Str";
  }
  if (equals(ZERO)) {
    return "String_Node_Str";
  }
  return "String_Node_Str" + fValue + "String_Node_Str"+ fScale+ "String_Node_Str"+ fPrecision+ "String_Node_Str";
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public String toString(){
  return "String_Node_Str" + fValue + "String_Node_Str"+ fScale+ "String_Node_Str"+ fPrecision+ "String_Node_Str";
}
Program: 92378
Project: 92378
Buggy source:
@Override public ITmfContext armRequest(final ITmfDataRequest<T> request){
  ITmfTimestamp timestamp=(request instanceof ITmfEventRequest<?>) ? ((ITmfEventRequest<T>)request).getRange().getStartTime() : null;
  if (TmfTimestamp.BIG_BANG.equals(timestamp) || request.getIndex() > 0) {
    timestamp=null;
  }
  if (request.getIndex() == 600001) {
    System.out.println("String_Node_Str");
  }
  ITmfContext context=null;
  if (timestamp != null) {
    context=seekEvent(timestamp);
    ((ITmfEventRequest<T>)request).setStartIndex((int)context.getRank());
  }
 else {
    context=seekEvent(request.getIndex());
  }
  return context;
}

Fixed version (ground truth):
@Override public ITmfContext armRequest(final ITmfDataRequest<T> request){
  ITmfTimestamp timestamp=(request instanceof ITmfEventRequest<?>) ? ((ITmfEventRequest<T>)request).getRange().getStartTime() : null;
  if (TmfTimestamp.BIG_BANG.equals(timestamp) || request.getIndex() > 0) {
    timestamp=null;
  }
  ITmfContext context=null;
  if (timestamp != null) {
    context=seekEvent(timestamp);
    ((ITmfEventRequest<T>)request).setStartIndex((int)context.getRank());
  }
 else {
    context=seekEvent(request.getIndex());
  }
  return context;
}
Program: 92379
Project: 92379
Buggy source:
@Override public synchronized void updateIndex(final ITmfContext context,final ITmfTimestamp timestamp){
  final long rank=context.getRank();
  if ((rank % fCheckpointInterval) == 0) {
    final long position=rank / fCheckpointInterval;
    if (fTraceIndex.size() == position) {
      final ITmfLocation<?> location=context.getLocation().clone();
      fTraceIndex.add(new TmfCheckpoint(timestamp.clone(),location));
      System.out.println("String_Node_Str" + "String_Node_Str" + (fTraceIndex.size() - 1) + "String_Node_Str"+ timestamp+ "String_Node_Str"+ location.toString());
    }
  }
}

Fixed version (ground truth):
@Override public synchronized void updateIndex(final ITmfContext context,final ITmfTimestamp timestamp){
  final long rank=context.getRank();
  if ((rank % fCheckpointInterval) == 0) {
    final long position=rank / fCheckpointInterval;
    if (fTraceIndex.size() == position) {
      final ITmfLocation<?> location=context.getLocation().clone();
      fTraceIndex.add(new TmfCheckpoint(timestamp.clone(),location));
    }
  }
}
Program: 92381
Project: 92381
Buggy source:
@Override public void handleData(final ITmfEvent event){
  super.handleData(event);
  if (event != null) {
    final ITmfTimestamp timestamp=event.getTimestamp();
    if (startTime == null) {
      startTime=timestamp.clone();
    }
    lastTime=timestamp.clone();
    if (Tracer.isEventTraced()) {
      Tracer.traceEvent(fTrace,this,event);
    }
    if ((getNbRead() % fCheckpointInterval) == 0) {
      updateTraceStatus();
    }
  }
}

Fixed version (ground truth):
@Override public void handleData(final ITmfEvent event){
  super.handleData(event);
  if (event != null) {
    final ITmfTimestamp timestamp=event.getTimestamp();
    if (startTime == null) {
      startTime=timestamp.clone();
    }
    lastTime=timestamp.clone();
    if ((getNbRead() % fCheckpointInterval) == 0) {
      updateTraceStatus();
    }
  }
}
Program: 92382
Project: 92382
Buggy source:
private void sendFullRangeRequest(TmfTimeRange fullRange){
  if (fFullTraceRequest != null && !fFullTraceRequest.isCompleted()) {
    fFullTraceRequest.cancel();
  }
  int cacheSize=fCurrentExperiment.getCacheSize();
  fFullTraceRequest=new HistogramRequest(fFullTraceHistogram.getDataModel(),fullRange,(int)fFullTraceHistogram.fDataModel.getNbEvents(),TmfDataRequest.ALL_DATA,cacheSize,ExecutionType.BACKGROUND);
  fCurrentExperiment.sendRequest(fFullTraceRequest);
}

Fixed version (ground truth):
private void sendFullRangeRequest(TmfTimeRange fullRange){
  if (fFullTraceRequest != null && !fFullTraceRequest.isCompleted()) {
    fFullTraceRequest.cancel();
  }
  if (fullRange.equals(TmfTimeRange.NULL_RANGE)) {
    return;
  }
  int cacheSize=fCurrentExperiment.getCacheSize();
  fFullTraceRequest=new HistogramRequest(fFullTraceHistogram.getDataModel(),fullRange,(int)fFullTraceHistogram.fDataModel.getNbEvents(),TmfDataRequest.ALL_DATA,cacheSize,ExecutionType.BACKGROUND);
  fCurrentExperiment.sendRequest(fFullTraceRequest);
}
Program: 92383
Project: 92383
Buggy source:
public PieChart(Composite parent,int style){
  super(parent,style);
  for (  Control child : getChildren()) {
    if (child.getClass().getName().equals("String_Node_Str") || child.getClass().getName().equals("String_Node_Str")) {
      child.setVisible(false);
    }
  }
  this.addPaintListener(new PieChartPaintListener(this));
}

Fixed version (ground truth):
public PieChart(Composite parent,int style){
  super(parent,style);
  Control plotArea=null;
  for (  Control child : getChildren()) {
    if (child.getClass().getName().equals("String_Node_Str"))     child.setVisible(false);
 else     if (child.getClass().getName().equals("String_Node_Str")) {
      child.setVisible(false);
      plotArea=child;
    }
  }
  this.addPaintListener(new PieChartPaintListener(this,plotArea));
}
Program: 92384
Project: 92384
Buggy source:
public void paintControl(PaintEvent e){
  GC gc=e.gc;
  Rectangle bounds=gc.getClipping();
  double[][] series=this.getPieSeriesArray();
  int width=(bounds.width - bounds.x) / series.length;
  int x=bounds.x;
  for (  double s[] : series) {
    drawPieChart(e,s,new Rectangle(x,bounds.y,width,bounds.height));
    x+=width;
  }
}

Fixed version (ground truth):
public void paintControl(PaintEvent e){
  GC gc=e.gc;
  Rectangle bounds;
  if (plotArea == null)   bounds=gc.getClipping();
 else   bounds=plotArea.getBounds();
  double[][] series=this.getPieSeriesArray();
  int width=(bounds.width - bounds.x) / series.length;
  int x=bounds.x;
  for (  double s[] : series) {
    drawPieChart(e,s,new Rectangle(x,bounds.y,width,bounds.height));
    x+=width;
  }
}
Program: 92385
Project: 92385
Buggy source:
private void drawPieChart(PaintEvent e,double series[],Rectangle bounds){
  int nelemSeries=series.length;
  double sumTotal=0;
  for (int i=0; i < nelemSeries; i++) {
    sumTotal+=series[i];
  }
  GC gc=e.gc;
  gc.setLineWidth(1);
  int pieWidth=Math.min(bounds.width,bounds.height) / 2;
  int pieX=bounds.x + (bounds.width - pieWidth) / 2;
  int pieY=bounds.y + (bounds.height - pieWidth) / 2;
  if (sumTotal == 0)   gc.drawOval(pieX,pieY,pieWidth,pieWidth);
 else {
    double factor=100 / sumTotal;
    int sweepAngle=0;
    int incrementAngle=0;
    int initialAngle=90;
    for (int i=0; i < nelemSeries; i++) {
      gc.setBackground(new Color(e.display,IColorsConstants.COLORS[i]));
      if (i == (nelemSeries - 1))       sweepAngle=360 - incrementAngle;
 else {
        double angle=series[i] * factor * 3.6;
        sweepAngle=(int)Math.round(angle);
      }
      gc.fillArc(pieX,pieY,pieWidth,pieWidth,initialAngle,(-sweepAngle));
      gc.drawArc(pieX,pieY,pieWidth,pieWidth,initialAngle,(-sweepAngle));
      incrementAngle+=sweepAngle;
      initialAngle+=(-sweepAngle);
    }
  }
}

Fixed version (ground truth):
private void drawPieChart(PaintEvent e,double series[],Rectangle bounds){
  int nelemSeries=series.length;
  double sumTotal=0;
  for (int i=0; i < nelemSeries; i++) {
    sumTotal+=series[i];
  }
  GC gc=e.gc;
  gc.setLineWidth(1);
  int pieWidth=Math.min(bounds.width - X_GAP,bounds.height);
  int pieX=bounds.x + (bounds.width - pieWidth) / 2;
  int pieY=bounds.y + (bounds.height - pieWidth) / 2;
  if (sumTotal == 0)   gc.drawOval(pieX,pieY,pieWidth,pieWidth);
 else {
    double factor=100 / sumTotal;
    int sweepAngle=0;
    int incrementAngle=0;
    int initialAngle=90;
    for (int i=0; i < nelemSeries; i++) {
      gc.setBackground(new Color(e.display,IColorsConstants.COLORS[i]));
      if (i == (nelemSeries - 1))       sweepAngle=360 - incrementAngle;
 else {
        double angle=series[i] * factor * 3.6;
        sweepAngle=(int)Math.round(angle);
      }
      gc.fillArc(pieX,pieY,pieWidth,pieWidth,initialAngle,(-sweepAngle));
      gc.drawArc(pieX,pieY,pieWidth,pieWidth,initialAngle,(-sweepAngle));
      incrementAngle+=sweepAngle;
      initialAngle+=(-sweepAngle);
    }
  }
}
Program: 92386
Project: 92386
Buggy source:
public PieChartPaintListener(PieChart chart){
  this.chart=chart;
}

Fixed version (ground truth):
public PieChartPaintListener(PieChart chart,Control plotArea){
  this.chart=chart;
  this.plotArea=plotArea;
}
Program: 92387
Project: 92387
Buggy source:
/** 
 * Method getType.
 * @return ITmfEventType
 * @see org.eclipse.linuxtools.tmf.core.event.ITmfEvent#getType()
 */
@Override public ITmfEventType getType(){
  return CtfTmfEventType.get(eventName);
}

Fixed version (ground truth):
/** 
 * Method getType.
 * @return ITmfEventType
 * @see org.eclipse.linuxtools.tmf.core.event.ITmfEvent#getType()
 */
@Override public ITmfEventType getType(){
  CtfTmfEventType ctfTmfEventType=CtfTmfEventType.get(eventName);
  if (ctfTmfEventType == null) {
    ctfTmfEventType=new CtfTmfEventType(this.getEventName(),this.getContent());
  }
  return ctfTmfEventType;
}
Program: 92388
Project: 92388
Buggy source:
@Override public synchronized ITmfEvent readNextEvent(final ITmfContext context){
  final ITmfEvent event=parseEvent(context);
  if (event != null) {
    updateAttributes(context,event.getTimestamp());
    TmfExperimentContext expContext=(TmfExperimentContext)context;
    int trace=expContext.getLastTrace();
    if (trace != TmfExperimentContext.NO_TRACE) {
      TmfExperimentLocation location=(TmfExperimentLocation)expContext.getLocation();
      location.getLocation().getLocations()[trace]=expContext.getContexts()[trace].getLocation();
    }
    context.increaseRank();
    processEvent(event);
  }
  return event;
}

Fixed version (ground truth):
@Override public synchronized ITmfEvent readNextEvent(final ITmfContext context){
  final ITmfContext previousContext=(TmfExperimentContext)context.clone();
  final ITmfEvent event=parseEvent(context);
  if (event != null) {
    updateAttributes(previousContext,event.getTimestamp());
    TmfExperimentContext expContext=(TmfExperimentContext)context;
    int trace=expContext.getLastTrace();
    if (trace != TmfExperimentContext.NO_TRACE) {
      TmfExperimentLocation location=(TmfExperimentLocation)expContext.getLocation();
      location.getLocation().getLocations()[trace]=expContext.getContexts()[trace].getLocation();
    }
    context.increaseRank();
    processEvent(event);
  }
  return event;
}
Program: 92389
Project: 92389
Buggy source:
/** 
 * @return the location of the event referred to by the context
 */
public ITmfLocation<? extends Comparable<?>> getLocation();

Fixed version (ground truth):
/** 
 * @return the location of the event at the context rank
 */
public ITmfLocation<? extends Comparable<?>> getLocation();
Program: 92390
Project: 92390
Buggy source:
/** 
 * @return the rank of the event referred to by the context
 */
public long getRank();

Fixed version (ground truth):
/** 
 * @return the rank of the event at the context location
 */
public long getRank();
Program: 92391
Project: 92391
Buggy source:
@Override public ITmfEventField getField(int index){
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public ITmfEventField getField(int index){
  return null;
}
Program: 92392
Project: 92392
Buggy source:
@Override public String getFieldName(int index){
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public String getFieldName(int index){
  return null;
}
Program: 92393
Project: 92393
Buggy source:
@Override public String getName(){
  final String temp[]=this.fTrace.getPath().split(System.getProperty("String_Node_Str"));
  if (temp.length > 2) {
    return temp[temp.length - 1];
  }
  return temp[0];
}

Fixed version (ground truth):
@Override public String getName(){
  String traceName=(fResource != null) ? fResource.getName() : null;
  if (traceName == null) {
    final String path=this.fTrace.getPath();
    final int sep=path.lastIndexOf(IPath.SEPARATOR);
    traceName=(sep >= 0) ? path.substring(sep + 1) : path;
  }
  return traceName;
}
Program: 92394
Project: 92394
Buggy source:
@Override public void initTrace(final IResource resource,final String path,final Class<CtfTmfEvent> eventType) throws TmfTraceException {
  this.fResource=resource;
  try {
    this.fTrace=new CTFTrace(path);
  }
 catch (  final CTFReaderException e) {
    throw new TmfTraceException(e.getMessage());
  }
  this.iterator=new CtfIterator(this,0,0);
  setStartTime(TmfTimestamp.BIG_BANG);
  if (!this.iterator.getLocation().equals(CtfIterator.nullLocation)) {
    setStartTime(iterator.getCurrentEvent().getTimestamp());
  }
  TmfSignalManager.register(this);
  buildStateSystem();
  if (resource != null) {
    try {
      resource.getProject().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      throw new TmfTraceException(e.getMessage());
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void initTrace(final IResource resource,final String path,final Class<CtfTmfEvent> eventType) throws TmfTraceException {
  this.fResource=resource;
  try {
    this.fTrace=new CTFTrace(path);
  }
 catch (  final CTFReaderException e) {
    throw new TmfTraceException(e.getMessage());
  }
  this.iterator=new CtfIterator(this,0,0);
  setStartTime(TmfTimestamp.BIG_BANG);
  if (!this.iterator.getLocation().equals(CtfIterator.nullLocation)) {
    setStartTime(iterator.getCurrentEvent().getTimestamp());
  }
  TmfSignalManager.register(this);
  buildStateSystem();
  if (resource != null) {
    try {
      resource.getProject().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
      throw new TmfTraceException(e.getMessage());
    }
  }
}
Program: 92395
Project: 92395
Buggy source:
@Override public boolean validate(final IProject project,final String path){
  try {
    final CTFTrace temp=new CTFTrace(path);
    return temp.majortIsSet();
  }
 catch (  final CTFReaderException e) {
    return false;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public boolean validate(final IProject project,final String path){
  try {
    final CTFTrace temp=new CTFTrace(path);
    return temp.majortIsSet();
  }
 catch (  final CTFReaderException e) {
    return false;
  }
}
Program: 92396
Project: 92396
Buggy source:
@Override public CtfTmfEvent readNextEvent(final ITmfContext context){
  iterator.advance();
  return iterator.getCurrentEvent();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public CtfTmfEvent readNextEvent(final ITmfContext context){
  iterator.advance();
  return iterator.getCurrentEvent();
}
Program: 92397
Project: 92397
Buggy source:
/** 
 * Suppressing the warning, because the 'throws' will usually happen in sub-classes.
 */
@SuppressWarnings("String_Node_Str") protected void buildStateSystem() throws TmfTraceException {
  return;
}

Fixed version (ground truth):
/** 
 * Suppressing the warning, because the 'throws' will usually happen in sub-classes.
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected void buildStateSystem() throws TmfTraceException {
  return;
}
Program: 92398
Project: 92398
Buggy source:
/** 
 * The trace reader keeps its own iterator: the "context" parameter here will be ignored. If you wish to specify a new context, instantiate a new CtfIterator and seek() it to where you want, and use that to read events. FIXME merge with getNextEvent below once they both use the same parameter type.
 */
@Override public CtfTmfEvent getNext(final ITmfContext context){
  iterator.advance();
  return iterator.getCurrentEvent();
}

Fixed version (ground truth):
/** 
 * The trace reader keeps its own iterator: the "context" parameter here will be ignored. If you wish to specify a new context, instantiate a new CtfIterator and seek() it to where you want, and use that to read events. FIXME merge with getNextEvent below once they both use the same parameter type.
 */
@SuppressWarnings("String_Node_Str") @Override public CtfTmfEvent getNext(final ITmfContext context){
  iterator.advance();
  return iterator.getCurrentEvent();
}
Program: 92400
Project: 92400
Buggy source:
/** 
 * Sets or clears the input for this time graph combo.
 * @param input the input of this time graph combo, or <code>null</code> if none
 */
public void setInput(ITimeGraphEntry[] input){
  fTreeViewer.setInput(input);
  fTreeViewer.expandAll();
  fTreeViewer.getTree().getVerticalBar().setEnabled(false);
  fTimeGraphViewer.setInput(input);
}

Fixed version (ground truth):
/** 
 * Sets or clears the input for this time graph combo.
 * @param input the input of this time graph combo, or <code>null</code> if none
 */
public void setInput(ITimeGraphEntry[] input){
  fTreeViewer.setInput(input);
  fTreeViewer.expandAll();
  fTreeViewer.getTree().getVerticalBar().setEnabled(false);
  fTreeViewer.getTree().getVerticalBar().setVisible(false);
  fTimeGraphViewer.setInput(input);
}
Program: 92401
Project: 92401
Buggy source:
@Override public void handleEvent(Event event){
  ArrayList<TreeItem> treeItems=getVisibleExpandedItems(tree);
  if (treeItems.size() == 0) {
    return;
  }
  if (event.keyCode == SWT.ARROW_DOWN) {
    int index=Math.min(fTimeGraphViewer.getSelectionIndex() + 1,treeItems.size() - 1);
    fTimeGraphViewer.setSelection((ITimeGraphEntry)treeItems.get(index).getData());
    event.doit=false;
  }
 else   if (event.keyCode == SWT.PAGE_DOWN) {
    int height=tree.getSize().y - tree.getHeaderHeight() - tree.getHorizontalBar().getSize().y;
    int countPerPage=height / (tree.getItemHeight() + getTreeItemHeightAdjustement());
    int index=Math.min(fTimeGraphViewer.getSelectionIndex() + countPerPage - 1,treeItems.size() - 1);
    fTimeGraphViewer.setSelection((ITimeGraphEntry)treeItems.get(index).getData());
    event.doit=false;
  }
 else   if (event.keyCode == SWT.END) {
    fTimeGraphViewer.setSelection((ITimeGraphEntry)treeItems.get(treeItems.size() - 1).getData());
    event.doit=false;
  }
  TreeItem treeItem=treeItems.get(fTimeGraphViewer.getTopIndex());
  tree.setTopItem(treeItem);
  if (fTimeGraphViewer.getSelectionIndex() >= 0) {
    fTreeViewer.setSelection(new StructuredSelection(fTimeGraphViewer.getSelection()));
  }
 else {
    fTreeViewer.setSelection(new StructuredSelection());
  }
}

Fixed version (ground truth):
@Override public void handleEvent(Event event){
  ArrayList<TreeItem> treeItems=getVisibleExpandedItems(tree);
  if (treeItems.size() == 0) {
    return;
  }
  if (event.keyCode == SWT.ARROW_DOWN) {
    int index=Math.min(fTimeGraphViewer.getSelectionIndex() + 1,treeItems.size() - 1);
    fTimeGraphViewer.setSelection((ITimeGraphEntry)treeItems.get(index).getData());
    event.doit=false;
  }
 else   if (event.keyCode == SWT.PAGE_DOWN) {
    int height=tree.getSize().y - tree.getHeaderHeight() - tree.getHorizontalBar().getSize().y;
    int countPerPage=height / getItemHeight(tree);
    int index=Math.min(fTimeGraphViewer.getSelectionIndex() + countPerPage - 1,treeItems.size() - 1);
    fTimeGraphViewer.setSelection((ITimeGraphEntry)treeItems.get(index).getData());
    event.doit=false;
  }
 else   if (event.keyCode == SWT.END) {
    fTimeGraphViewer.setSelection((ITimeGraphEntry)treeItems.get(treeItems.size() - 1).getData());
    event.doit=false;
  }
  TreeItem treeItem=treeItems.get(fTimeGraphViewer.getTopIndex());
  tree.setTopItem(treeItem);
  if (fTimeGraphViewer.getSelectionIndex() >= 0) {
    fTreeViewer.setSelection(new StructuredSelection(fTimeGraphViewer.getSelection()));
  }
 else {
    fTreeViewer.setSelection(new StructuredSelection());
  }
}
Program: 92403
Project: 92403
Buggy source:
/** 
 * Sets or clears the input for this time graph combo.
 * @param input the input of this time graph combo, or <code>null</code> if none
 */
public void setInput(ITimeGraphEntry[] input){
  fTreeViewer.setInput(input);
  fTreeViewer.expandAll();
  fTreeViewer.getTree().getVerticalBar().setEnabled(false);
  fTreeViewer.getTree().getVerticalBar().setVisible(false);
  fTimeGraphViewer.setInput(input);
}

Fixed version (ground truth):
/** 
 * Sets or clears the input for this time graph combo.
 * @param input the input of this time graph combo, or <code>null</code> if none
 */
public void setInput(ITimeGraphEntry[] input){
  fTreeViewer.setInput(input);
  fTreeViewer.expandAll();
  fTreeViewer.getTree().getVerticalBar().setEnabled(false);
  fTreeViewer.getTree().getVerticalBar().setVisible(false);
  fTimeGraphViewer.setItemHeight(getItemHeight(fTreeViewer.getTree()));
  fTimeGraphViewer.setInput(input);
}
Program: 92404
Project: 92404
Buggy source:
@Override public void setRank(final long rank){
  seekRank(rank);
}

Fixed version (ground truth):
@Override public void setRank(final long rank){
  if (!this.curLocation.equals(nullLocation)) {
    seekRank(rank);
  }
}
Program: 92405
Project: 92405
Buggy source:
public boolean seekRank(final long rank){
  boolean ret=false;
  ret=super.seekIndex(rank);
  if (ret)   curLocation.setLocation(getCurrentEvent().getTimestampValue());
  return ret;
}

Fixed version (ground truth):
public boolean seekRank(final long rank){
  boolean ret=false;
  ret=super.seekIndex(rank);
  if (ret) {
    curLocation.setLocation(getCurrentEvent().getTimestampValue());
  }
  return ret;
}