nus-yam/ex-repair huggingface dataset:
Program: 92568
Project: 92568
Buggy source:
@Override public boolean equals(Object other){
  if (this == other)   return true;
  if (other == null)   return false;
  if (!(other instanceof JniEvent))   return false;
  JniEvent event=(JniEvent)other;
  return (getEventTime().equals(event.getEventTime()) && parentTracefile.equals(event.parentTracefile));
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof JniEvent)) {
    return false;
  }
  JniEvent other=(JniEvent)obj;
  if (eventTime == null) {
    if (other.eventTime != null) {
      return false;
    }
  }
 else   if (!eventTime.equals(other.eventTime)) {
    return false;
  }
  if (parentTracefile == null) {
    if (other.parentTracefile != null) {
      return false;
    }
  }
 else   if (!parentTracefile.equals(other.parentTracefile)) {
    return false;
  }
  return true;
}
Program: 92569
Project: 92569
Buggy source:
public TmfEventField[] extractItemFields(){
  if (fData != null)   processData();
  return fColumnData;
}

Fixed version (ground truth):
public TmfEventField[] extractItemFields(){
  if (fData != null)   processData();
  return Arrays.copyOf(fColumnData,fColumnData.length);
}
Program: 92570
Project: 92570
Buggy source:
public CustomEventContent(CustomEvent parent,String content){
  super(ITmfEventField.ROOT_FIELD_ID,content);
  fParent=parent;
}

Fixed version (ground truth):
public CustomEventContent(CustomEvent parent,String content){
  super(ITmfEventField.ROOT_FIELD_ID,content);
}
Program: 92571
Project: 92571
Buggy source:
@Override public TmfContext seekLocation(double ratio){
  try {
    BufferedRandomAccessFile raFile=new BufferedRandomAccessFile(getPath(),"String_Node_Str");
    long pos=(long)(ratio * raFile.length());
    while (pos > 0) {
      raFile.seek(pos - 1);
      if (raFile.read() == '\n')       break;
      pos--;
    }
    ITmfLocation<?> location=new TmfLocation<Long>(new Long(pos));
    TmfContext context=seekLocation(location);
    context.setRank(ITmfContext.UNKNOWN_RANK);
    return context;
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    return new CustomTxtTraceContext(NULL_LOCATION,ITmfContext.INITIAL_RANK);
  }
catch (  IOException e) {
    e.printStackTrace();
    return new CustomTxtTraceContext(NULL_LOCATION,ITmfContext.INITIAL_RANK);
  }
}

Fixed version (ground truth):
@Override public TmfContext seekLocation(double ratio){
  try {
    BufferedRandomAccessFile raFile=new BufferedRandomAccessFile(getPath(),"String_Node_Str");
    long pos=(long)(ratio * raFile.length());
    while (pos > 0) {
      raFile.seek(pos - 1);
      if (raFile.read() == '\n')       break;
      pos--;
    }
    ITmfLocation<?> location=new TmfLocation<Long>(pos);
    TmfContext context=seekLocation(location);
    context.setRank(ITmfContext.UNKNOWN_RANK);
    return context;
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    return new CustomTxtTraceContext(NULL_LOCATION,ITmfContext.INITIAL_RANK);
  }
catch (  IOException e) {
    e.printStackTrace();
    return new CustomTxtTraceContext(NULL_LOCATION,ITmfContext.INITIAL_RANK);
  }
}
Program: 92572
Project: 92572
Buggy source:
public CustomXmlEvent extractEvent(Element element,InputElement inputElement){
  CustomXmlEvent event=new CustomXmlEvent(fDefinition,this,TmfTimestamp.ZERO,"String_Node_Str",fEventType,"String_Node_Str");
  event.setContent(new CustomEventContent(event,new String()));
  parseElement(element,event,inputElement);
  return event;
}

Fixed version (ground truth):
public CustomXmlEvent extractEvent(Element element,InputElement inputElement){
  CustomXmlEvent event=new CustomXmlEvent(fDefinition,this,TmfTimestamp.ZERO,"String_Node_Str",fEventType,"String_Node_Str");
  event.setContent(new CustomEventContent(event,"String_Node_Str"));
  parseElement(element,event,inputElement);
  return event;
}
Program: 92573
Project: 92573
Buggy source:
@Override public TmfContext seekLocation(double ratio){
  try {
    BufferedRandomAccessFile raFile=new BufferedRandomAccessFile(getPath(),"String_Node_Str");
    long pos=(long)(ratio * raFile.length());
    while (pos > 0) {
      raFile.seek(pos - 1);
      if (raFile.read() == '\n')       break;
      pos--;
    }
    ITmfLocation<?> location=new TmfLocation<Long>(new Long(pos));
    TmfContext context=seekLocation(location);
    context.setRank(ITmfContext.UNKNOWN_RANK);
    return context;
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    return new CustomXmlTraceContext(NULL_LOCATION,ITmfContext.INITIAL_RANK);
  }
catch (  IOException e) {
    e.printStackTrace();
    return new CustomXmlTraceContext(NULL_LOCATION,ITmfContext.INITIAL_RANK);
  }
}

Fixed version (ground truth):
@Override public TmfContext seekLocation(double ratio){
  try {
    BufferedRandomAccessFile raFile=new BufferedRandomAccessFile(getPath(),"String_Node_Str");
    long pos=(long)(ratio * raFile.length());
    while (pos > 0) {
      raFile.seek(pos - 1);
      if (raFile.read() == '\n')       break;
      pos--;
    }
    ITmfLocation<?> location=new TmfLocation<Long>(pos);
    TmfContext context=seekLocation(location);
    context.setRank(ITmfContext.UNKNOWN_RANK);
    return context;
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    return new CustomXmlTraceContext(NULL_LOCATION,ITmfContext.INITIAL_RANK);
  }
catch (  IOException e) {
    e.printStackTrace();
    return new CustomXmlTraceContext(NULL_LOCATION,ITmfContext.INITIAL_RANK);
  }
}
Program: 92574
Project: 92574
Buggy source:
private void updatePreviews(boolean updateAll){
  if (inputText == null) {
    return;
  }
  inputText.setStyleRanges(new StyleRange[]{});
  if (selectedElement == null) {
    return;
  }
  timeStampValue=null;
  timeStampFormat=null;
  logEntriesCount=0;
  logEntryFound=false;
  selectedElement.updatePreview();
  if (timeStampValue != null && timeStampFormat != null) {
    try {
      SimpleDateFormat dateFormat=new SimpleDateFormat(timeStampFormat);
      Date date=dateFormat.parse(timeStampValue);
      dateFormat=new SimpleDateFormat(timeStampOutputFormatText.getText().trim());
      timeStampPreviewText.setText(dateFormat.format(date));
    }
 catch (    ParseException e) {
      timeStampPreviewText.setText("String_Node_Str" + timeStampValue + "String_Node_Str"+ timeStampFormat+ "String_Node_Str");
    }
catch (    IllegalArgumentException e) {
      timeStampPreviewText.setText("String_Node_Str");
    }
  }
 else {
    timeStampPreviewText.setText("String_Node_Str");
  }
}

Fixed version (ground truth):
private void updatePreviews(boolean updateAll){
  if (inputText == null) {
    return;
  }
  inputText.setStyleRanges(new StyleRange[]{});
  if (selectedElement == null) {
    return;
  }
  initValues();
  selectedElement.updatePreview();
  if (timeStampValue != null && timeStampFormat != null) {
    try {
      SimpleDateFormat dateFormat=new SimpleDateFormat(timeStampFormat);
      Date date=dateFormat.parse(timeStampValue);
      dateFormat=new SimpleDateFormat(timeStampOutputFormatText.getText().trim());
      timeStampPreviewText.setText(dateFormat.format(date));
    }
 catch (    ParseException e) {
      timeStampPreviewText.setText("String_Node_Str" + timeStampValue + "String_Node_Str"+ timeStampFormat+ "String_Node_Str");
    }
catch (    IllegalArgumentException e) {
      timeStampPreviewText.setText("String_Node_Str");
    }
  }
 else {
    timeStampPreviewText.setText("String_Node_Str");
  }
}
Program: 92575
Project: 92575
Buggy source:
private String getSelectionText(){
  InputStream inputStream=null;
  if (this.selection instanceof IStructuredSelection) {
    Object selection=((IStructuredSelection)this.selection).getFirstElement();
    if (selection instanceof IFile) {
      IFile file=(IFile)selection;
      try {
        inputStream=file.getContents();
      }
 catch (      CoreException e) {
        return "String_Node_Str";
      }
    }
  }
  if (inputStream != null) {
    try {
      BufferedReader reader=new BufferedReader(new InputStreamReader(inputStream));
      StringBuilder sb=new StringBuilder();
      String line=null;
      while ((line=reader.readLine()) != null) {
        sb.append(line + "String_Node_Str");
      }
      parseXmlInput(sb.toString());
      return sb.toString();
    }
 catch (    IOException e) {
      return "String_Node_Str";
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private String getSelectionText(){
  InputStream inputStream=null;
  if (this.selection instanceof IStructuredSelection) {
    Object selection=((IStructuredSelection)this.selection).getFirstElement();
    if (selection instanceof IFile) {
      IFile file=(IFile)selection;
      try {
        inputStream=file.getContents();
      }
 catch (      CoreException e) {
        return "String_Node_Str";
      }
    }
  }
  if (inputStream != null) {
    BufferedReader reader=null;
    try {
      reader=new BufferedReader(new InputStreamReader(inputStream));
      StringBuilder sb=new StringBuilder();
      String line=null;
      while ((line=reader.readLine()) != null) {
        sb.append(line + "String_Node_Str");
      }
      parseXmlInput(sb.toString());
      reader.close();
      return sb.toString();
    }
 catch (    IOException e) {
      return "String_Node_Str";
    }
  }
  return "String_Node_Str";
}
Program: 92576
Project: 92576
Buggy source:
@Override public void run(){
  if ((scrollFrame != null) && (!scrollFrame.isDisposed())) {
    updateScrolls(scrollFrame);
  }
}

Fixed version (ground truth):
@Override public void run(){
  tsfviewer.setTimeBounds(range.getStartTime().getValue(),range.getEndTime().getValue());
}
Program: 92577
Project: 92577
Buggy source:
@Override public void run(){
  if ((tsfviewer != null) && (!tsfviewer.getControl().isDisposed())) {
    tsfviewer.display(items,startBoundTime,endBoundTime,updateTimeBounds);
    if (startVisibleWindow > -1 && endVisibleWindow > -1) {
      tsfviewer.setSelectVisTimeWindow(startVisibleWindow,endVisibleWindow,source);
    }
    tsfviewer.resizeControls();
  }
}

Fixed version (ground truth):
@Override public void run(){
  tsfviewer.setTimeBounds(range.getStartTime().getValue(),range.getEndTime().getValue());
}
Program: 92579
Project: 92579
Buggy source:
@Override public void handleSuccess(){
  if (getRange() != TmfTimeRange.Eternity) {
    lastTime=getRange().getEndTime();
  }
  updateExperiment();
  super.handleSuccess();
}

Fixed version (ground truth):
@Override public void handleSuccess(){
  if (getRange().getEndTime() != TmfTimestamp.BigCrunch) {
    lastTime=getRange().getEndTime();
  }
  updateExperiment();
  super.handleSuccess();
}
Program: 92580
Project: 92580
Buggy source:
void setTimeBounds(){
  _time0_=_beginTime;
  if (_time0_ < 0)   _time0_=0;
  _time1_=_endTime;
  if (!_timeRangeFixed) {
    _time0=_time0_;
    _time1=_time1_;
  }
  if (_time1 - _time0 < _minTimeInterval) {
    _time1=_time0 + _minTimeInterval;
  }
}

Fixed version (ground truth):
@Override public void setTimeBounds(long beginTime,long endTime){
  _beginTime=beginTime;
  _endTime=endTime;
  _time0_=beginTime;
  _time1_=endTime;
  _stateCtrl.adjustScrolls();
  _stateCtrl.redraw();
  _timeScaleCtrl.redraw();
}
Program: 92582
Project: 92582
Buggy source:
public LttngEvent getEvent(){
  return fParentEvent;
}

Fixed version (ground truth):
public synchronized LttngEvent getEvent(){
  return fParentEvent;
}
Program: 92583
Project: 92583
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);
        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(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;
}
Program: 92584
Project: 92584
Buggy source:
@Override public LttngEventContent clone(){
  LttngEventContent clone=(LttngEventContent)super.clone();
  LttngEventField[] fields=getFields();
  LttngEventField[] subfields=new LttngEventField[fields.length];
  for (int i=0; i < fields.length; i++) {
    subfields[i]=(LttngEventField)fields[i].clone();
  }
  clone.setValue(getValue(),subfields);
  clone.fFieldsMap=new HashMap<String,LttngEventField>();
  for (  String key : fFieldsMap.keySet()) {
    clone.fFieldsMap.put(new String(key),((LttngEventField)fFieldsMap.get(key)).clone());
  }
  return clone;
}

Fixed version (ground truth):
@Override public LttngEventContent clone(){
  LttngEventContent clone=(LttngEventContent)super.clone();
  LttngEventField[] fields=getFields();
  LttngEventField[] subfields=new LttngEventField[fields.length];
  for (int i=0; i < fields.length; i++) {
    subfields[i]=(LttngEventField)fields[i].clone();
  }
  clone.setValue(getValue(),subfields);
  clone.fFieldsMap=new HashMap<String,LttngEventField>();
  for (  String key : fFieldsMap.keySet()) {
    clone.fFieldsMap.put(key,((LttngEventField)fFieldsMap.get(key)).clone());
  }
  return clone;
}
Program: 92585
Project: 92585
Buggy source:
public void setEvent(LttngEvent newParent){
  fParentEvent=newParent;
}

Fixed version (ground truth):
public synchronized void setEvent(LttngEvent newParent){
  fParentEvent=newParent;
}
Program: 92586
Project: 92586
Buggy source:
@Override public LttngEventType clone(){
  LttngEventType clone=(LttngEventType)super.clone();
  clone.tracefileName=new String(tracefileName);
  clone.cpuId=new Long(cpuId);
  clone.markerName=new String(markerName);
  clone.markerId=markerId;
  return clone;
}

Fixed version (ground truth):
@Override public LttngEventType clone(){
  LttngEventType clone=(LttngEventType)super.clone();
  clone.tracefileName=tracefileName;
  clone.cpuId=Long.valueOf(cpuId);
  clone.markerName=markerName;
  clone.markerId=markerId;
  return clone;
}
Program: 92587
Project: 92587
Buggy source:
/** 
 * @param range
 * @param offset
 * @param nbEvents
 * @param maxBlockSize
 * @param listener
 * @param experimentTimeRange
 * @param processor
 * @param experimentName
 * @param execType 
 */
public LttngSyntEventRequest(TmfTimeRange range,long offset,int nbEvents,int maxBlockSize,IRequestStatusListener listener,TmfTimeRange experimentTimeRange,ITransEventProcessor processor,String experimentName,ExecutionType execType){
  super(LttngSyntheticEvent.class,range,(int)offset,nbEvents,maxBlockSize,execType);
  fExperimentTimeRange=experimentTimeRange;
  fExperimentName=new String(experimentName);
  addListener(listener);
  fprocessor=processor;
}

Fixed version (ground truth):
/** 
 * @param range
 * @param offset
 * @param nbEvents
 * @param maxBlockSize
 * @param listener
 * @param experimentTimeRange
 * @param processor
 * @param experimentName
 * @param execType 
 */
public LttngSyntEventRequest(TmfTimeRange range,long offset,int nbEvents,int maxBlockSize,IRequestStatusListener listener,TmfTimeRange experimentTimeRange,ITransEventProcessor processor,String experimentName,ExecutionType execType){
  super(LttngSyntheticEvent.class,range,(int)offset,nbEvents,maxBlockSize,execType);
  fExperimentTimeRange=experimentTimeRange;
  fExperimentName=experimentName;
  addListener(listener);
  fprocessor=processor;
}
Program: 92588
Project: 92588
Buggy source:
/** 
 * @return the mapping from int (0..255) to system call names
 */
public String[] getSyscallNames(){
  return syscall_names;
}

Fixed version (ground truth):
/** 
 * @return the mapping from int (0..255) to system call names
 */
public String[] getSyscallNames(){
  return Arrays.copyOf(syscall_names,syscall_names.length);
}
Program: 92589
Project: 92589
Buggy source:
/** 
 * @return the mapping from int (0..255) to trap names
 */
public String[] getTrapNames(){
  return trap_names;
}

Fixed version (ground truth):
/** 
 * @return the mapping from int (0..255) to trap names
 */
public String[] getTrapNames(){
  return Arrays.copyOf(trap_names,trap_names.length);
}
Program: 92590
Project: 92590
Buggy source:
/** 
 * @return the mapping from int (0..31) to soft IRQ names
 */
public String[] getSoftIrqNames(){
  return soft_irq_names;
}

Fixed version (ground truth):
/** 
 * @return the mapping from int (0..31) to soft IRQ names
 */
public String[] getSoftIrqNames(){
  return Arrays.copyOf(soft_irq_names,soft_irq_names.length);
}
Program: 92591
Project: 92591
Buggy source:
/** 
 * @return the mapping from int (0..255) to IRQ names
 */
public String[] getIrqNames(){
  return irq_names;
}

Fixed version (ground truth):
/** 
 * @return the mapping from int (0..255) to IRQ names
 */
public String[] getIrqNames(){
  return Arrays.copyOf(irq_names,irq_names.length);
}
Program: 92592
Project: 92592
Buggy source:
public static void init(){
  String debugTrace=Platform.getDebugOption(pluginID + "String_Node_Str");
  String infoTrace=Platform.getDebugOption(pluginID + "String_Node_Str");
  String warnTrace=Platform.getDebugOption(pluginID + "String_Node_Str");
  if (debugTrace != null) {
    DEBUG=(new Boolean(debugTrace)).booleanValue();
  }
  if (infoTrace != null) {
    INFO=(new Boolean(infoTrace)).booleanValue();
  }
  if (warnTrace != null) {
    WARN=(new Boolean(warnTrace)).booleanValue();
  }
  String cfvTrace=Platform.getDebugOption(pluginID + "String_Node_Str");
  if (cfvTrace != null) {
    CFV=(new Boolean(cfvTrace)).booleanValue();
    if (CFV) {
      try {
        fCFVfile=new PrintWriter(new FileWriter("String_Node_Str"));
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  String rvTrace=Platform.getDebugOption(pluginID + "String_Node_Str");
  if (rvTrace != null) {
    RV=(new Boolean(rvTrace)).booleanValue();
    if (RV) {
      try {
        fRVfile=new PrintWriter(new FileWriter("String_Node_Str"));
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  String svTrace=Platform.getDebugOption(pluginID + "String_Node_Str");
  if (svTrace != null) {
    SV=(new Boolean(svTrace)).booleanValue();
    if (SV) {
      try {
        fSVfile=new PrintWriter(new FileWriter("String_Node_Str"));
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
public static void init(){
  String debugTrace=Platform.getDebugOption(pluginID + "String_Node_Str");
  String infoTrace=Platform.getDebugOption(pluginID + "String_Node_Str");
  String warnTrace=Platform.getDebugOption(pluginID + "String_Node_Str");
  if (debugTrace != null) {
    DEBUG=Boolean.valueOf(debugTrace);
  }
  if (infoTrace != null) {
    INFO=Boolean.valueOf(infoTrace);
  }
  if (warnTrace != null) {
    WARN=Boolean.valueOf(warnTrace);
  }
  String cfvTrace=Platform.getDebugOption(pluginID + "String_Node_Str");
  if (cfvTrace != null) {
    CFV=Boolean.valueOf(cfvTrace);
    if (CFV) {
      try {
        fCFVfile=new PrintWriter(new FileWriter("String_Node_Str"));
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  String rvTrace=Platform.getDebugOption(pluginID + "String_Node_Str");
  if (rvTrace != null) {
    RV=Boolean.valueOf(rvTrace);
    if (RV) {
      try {
        fRVfile=new PrintWriter(new FileWriter("String_Node_Str"));
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  String svTrace=Platform.getDebugOption(pluginID + "String_Node_Str");
  if (svTrace != null) {
    SV=Boolean.valueOf(svTrace);
    if (SV) {
      try {
        fSVfile=new PrintWriter(new FileWriter("String_Node_Str"));
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 92593
Project: 92593
Buggy source:
protected String findObject(StateColor Value,Map<String,StateColor> map){
  Set<String> keys=map.keySet();
  for (  String key : keys) {
    if (map.get(key).equals(Value)) {
      return key;
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
protected String findObject(StateColor Value,Map<String,StateColor> map){
  for (  Entry<String,StateColor> entry : map.entrySet()) {
    if (entry.getValue().equals(Value)) {
      return entry.getKey();
    }
  }
  return "String_Node_Str";
}
Program: 92594
Project: 92594
Buggy source:
/** 
 * Retrieves all provider resources from the remote system and updates local references.  
 * @return provider resources
 * @throws SystemMessageException
 * @throws InterruptedException
 */
public ProviderResource[] getAllProviders() throws SystemMessageException, InterruptedException {
  ProviderResource[] providers=createProviders();
  if (fProviders == null) {
    fProviders=providers;
  }
 else {
    for (int i=0; i < fProviders.length; i++) {
      for (int j=0; j < providers.length; j++) {
        if (fProviders[i].getName().equals(providers[j].getName())) {
          fProviders[i].refreshTargets(providers[j].getTargets());
        }
      }
    }
  }
  return fProviders;
}

Fixed version (ground truth):
/** 
 * Retrieves all provider resources from the remote system and updates local references.  
 * @return provider resources
 * @throws SystemMessageException
 * @throws InterruptedException
 */
public ProviderResource[] getAllProviders() throws SystemMessageException, InterruptedException {
  ProviderResource[] providers=createProviders();
  if (fProviders == null) {
    fProviders=providers;
  }
 else {
    for (int i=0; i < fProviders.length; i++) {
      for (int j=0; j < providers.length; j++) {
        if (fProviders[i].getName().equals(providers[j].getName())) {
          fProviders[i].refreshTargets(providers[j].getTargets());
        }
      }
    }
  }
  return (fProviders != null) ? Arrays.copyOf(fProviders,fProviders.length) : null;
}
Program: 92595
Project: 92595
Buggy source:
@Override @TmfSignalHandler public synchronized void processingStarted(RequestStartedSignal signal){
  LttngSyntEventRequest request=signal.getRequest();
  if (request != null) {
    waitCursor(true);
    TmfTimeRange trange=null;
    trange=request.getRange();
    boolean clearData=request.isclearDataInd();
    ModelUpdatePrep(trange,clearData);
  }
}

Fixed version (ground truth):
@Override @TmfSignalHandler public synchronized void processingStarted(RequestStartedSignal signal){
  LttngSyntEventRequest request=signal.getRequest();
  if (request != null) {
    waitCursor(true);
    TmfTimeRange trange=null;
    trange=request.getRange();
    boolean clearData=request.isclearDataInd();
    modelUpdatePrep(trange,clearData);
  }
}
Program: 92598
Project: 92598
Buggy source:
/** 
 * @param value new field raw value
 * @param fields the corresponding fields
 */
protected void setValue(Object value,ITmfEventField[] fields){
  fValue=value;
  fFields=fields;
  populateStructs();
}

Fixed version (ground truth):
/** 
 * @param value new field raw value
 * @param fields the corresponding fields
 */
protected void setValue(Object value,ITmfEventField[] fields){
  fValue=value;
  fFields=(fields != null) ? Arrays.copyOf(fields,fields.length) : null;
  populateStructs();
}
Program: 92599
Project: 92599
Buggy source:
/** 
 * Handle the completion of the request. It is called when there is no more data available either because: - the request completed normally - the request failed - the request was canceled As a convenience, handleXXXX methods are provided. They are meant to be overridden by the application if it needs to handle these conditions.
 */
@Override public void handleCompleted(){
  if (fRequestFailed) {
    handleFailure();
  }
 else   if (fRequestCanceled) {
    handleCancel();
  }
 else {
    handleSuccess();
  }
  if (Tracer.isRequestTraced())   Tracer.traceRequest(this,"String_Node_Str" + fNbRead + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Handle the completion of the request. It is called when there is no more data available either because: - the request completed normally - the request failed - the request was canceled As a convenience, handleXXXX methods are provided. They are meant to be overridden by the application if it needs to handle these conditions.
 */
@Override public synchronized void handleCompleted(){
  if (fRequestFailed) {
    handleFailure();
  }
 else   if (fRequestCanceled) {
    handleCancel();
  }
 else {
    handleSuccess();
  }
  if (Tracer.isRequestTraced())   Tracer.traceRequest(this,"String_Node_Str" + fNbRead + "String_Node_Str");
}
Program: 92600
Project: 92600
Buggy source:
@Override public TmfContext seekEvent(long rank){
  int index=(int)rank / fIndexPageSize;
  ITmfLocation<?> location;
synchronized (fCheckpoints) {
    if (fCheckpoints.size() == 0) {
      location=null;
    }
 else {
      if (index >= fCheckpoints.size()) {
        index=fCheckpoints.size() - 1;
      }
      location=fCheckpoints.elementAt(index).getLocation();
    }
  }
  TmfContext context=seekLocation(location);
  long pos=index * fIndexPageSize;
  context.setRank(pos);
  if (pos < rank) {
    ITmfEvent event=getNextEvent(context);
    while (event != null && ++pos < rank) {
      event=getNextEvent(context);
    }
  }
  return context;
}

Fixed version (ground truth):
@Override public TmfContext seekEvent(long rank){
  int index=(int)rank / fIndexPageSize;
  ITmfLocation<?> location;
synchronized (fCheckpoints) {
    if (fCheckpoints.isEmpty()) {
      location=null;
    }
 else {
      if (index >= fCheckpoints.size()) {
        index=fCheckpoints.size() - 1;
      }
      location=fCheckpoints.elementAt(index).getLocation();
    }
  }
  TmfContext context=seekLocation(location);
  long pos=index * fIndexPageSize;
  context.setRank(pos);
  if (pos < rank) {
    ITmfEvent event=getNextEvent(context);
    while (event != null && ++pos < rank) {
      event=getNextEvent(context);
    }
  }
  return context;
}
Program: 92601
Project: 92601
Buggy source:
@Override public long getNbEvents(){
  return fNbEvents;
}

Fixed version (ground truth):
@Override public synchronized long getNbEvents(){
  return fNbEvents;
}
Program: 92602
Project: 92602
Buggy source:
private void updateTrace(){
  int nbRead=getNbRead();
  if (nbRead != 0) {
    fStartTime=startTime;
    fEndTime=lastTime;
    fNbEvents=nbRead;
    notifyListeners();
  }
}

Fixed version (ground truth):
private synchronized void updateTrace(){
  int nbRead=getNbRead();
  if (nbRead != 0) {
    fStartTime=startTime;
    fEndTime=lastTime;
    fNbEvents=nbRead;
    notifyListeners();
  }
}
Program: 92604
Project: 92604
Buggy source:
public static IConfigurationElement[] getTypeElements(){
  IConfigurationElement[] elements=Platform.getExtensionRegistry().getConfigurationElementsFor(TMF_TRACE_TYPE_ID);
  List<IConfigurationElement> typeElements=new LinkedList<IConfigurationElement>();
  for (  IConfigurationElement element : elements) {
    if (element.getName().equals(TYPE_ELEM)) {
      typeElements.add(element);
    }
  }
  return typeElements.toArray(new IConfigurationElement[0]);
}

Fixed version (ground truth):
public static IConfigurationElement[] getTypeElements(){
  IConfigurationElement[] elements=Platform.getExtensionRegistry().getConfigurationElementsFor(TMF_TRACE_TYPE_ID);
  List<IConfigurationElement> typeElements=new LinkedList<IConfigurationElement>();
  for (  IConfigurationElement element : elements) {
    if (element.getName().equals(TYPE_ELEM)) {
      typeElements.add(element);
    }
  }
  return typeElements.toArray(new IConfigurationElement[typeElements.size()]);
}
Program: 92605
Project: 92605
Buggy source:
private String[] getAvailableTraceTypes(){
  IConfigurationElement[] config=Platform.getExtensionRegistry().getConfigurationElementsFor(TmfTraceType.TMF_TRACE_TYPE_ID);
  for (  IConfigurationElement ce : config) {
    String elementName=ce.getName();
    if (elementName.equals(TmfTraceType.TYPE_ELEM)) {
      String traceTypeId=ce.getAttribute(TmfTraceType.ID_ATTR);
      fTraceTypeAttributes.put(traceTypeId,ce);
    }
 else     if (elementName.equals(TmfTraceType.CATEGORY_ELEM)) {
      String categoryId=ce.getAttribute(TmfTraceType.ID_ATTR);
      fTraceCategories.put(categoryId,ce);
    }
  }
  List<String> traceTypes=new ArrayList<String>();
  for (  String typeId : fTraceTypeAttributes.keySet()) {
    IConfigurationElement ce=fTraceTypeAttributes.get(typeId);
    String traceTypeName=getCategory(ce) + "String_Node_Str" + ce.getAttribute(TmfTraceType.NAME_ATTR);
    fTraceAttributes.put(traceTypeName,ce);
    traceTypes.add(traceTypeName);
  }
  Collections.sort(traceTypes);
  for (  CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
    String traceTypeName=CUSTOM_TXT_CATEGORY + "String_Node_Str" + def.definitionName;
    traceTypes.add(traceTypeName);
  }
  for (  CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
    String traceTypeName=CUSTOM_XML_CATEGORY + "String_Node_Str" + def.definitionName;
    traceTypes.add(traceTypeName);
  }
  return traceTypes.toArray(new String[0]);
}

Fixed version (ground truth):
private String[] getAvailableTraceTypes(){
  IConfigurationElement[] config=Platform.getExtensionRegistry().getConfigurationElementsFor(TmfTraceType.TMF_TRACE_TYPE_ID);
  for (  IConfigurationElement ce : config) {
    String elementName=ce.getName();
    if (elementName.equals(TmfTraceType.TYPE_ELEM)) {
      String traceTypeId=ce.getAttribute(TmfTraceType.ID_ATTR);
      fTraceTypeAttributes.put(traceTypeId,ce);
    }
 else     if (elementName.equals(TmfTraceType.CATEGORY_ELEM)) {
      String categoryId=ce.getAttribute(TmfTraceType.ID_ATTR);
      fTraceCategories.put(categoryId,ce);
    }
  }
  List<String> traceTypes=new ArrayList<String>();
  for (  String typeId : fTraceTypeAttributes.keySet()) {
    IConfigurationElement ce=fTraceTypeAttributes.get(typeId);
    String traceTypeName=getCategory(ce) + "String_Node_Str" + ce.getAttribute(TmfTraceType.NAME_ATTR);
    fTraceAttributes.put(traceTypeName,ce);
    traceTypes.add(traceTypeName);
  }
  Collections.sort(traceTypes);
  for (  CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
    String traceTypeName=CUSTOM_TXT_CATEGORY + "String_Node_Str" + def.definitionName;
    traceTypes.add(traceTypeName);
  }
  for (  CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
    String traceTypeName=CUSTOM_XML_CATEGORY + "String_Node_Str" + def.definitionName;
    traceTypes.add(traceTypeName);
  }
  return traceTypes.toArray(new String[traceTypes.size()]);
}
Program: 92606
Project: 92606
Buggy source:
public void mouseMove(MouseEvent event){
  int newLine=fParentRuler.toDocumentLineNumber(event.y) + 1;
  if (annotationColumn instanceof ISTAnnotationHyperlink) {
    if (((ISTAnnotationHyperlink)annotationColumn).isAnnotationHyperlink(newLine) && annotationColumn.getAnnotation(newLine).trim() != "String_Node_Str") {
      Cursor cursor=new Cursor(event.display,SWT.CURSOR_HAND);
      fCanvas.setCursor(cursor);
    }
 else {
      Cursor cursor=new Cursor(event.display,SWT.CURSOR_ARROW);
      fCanvas.setCursor(cursor);
    }
  }
  if (fIsListeningForMove && !autoScroll(event)) {
    expandSelection(newLine);
  }
  fParentRuler.setLocationOfLastMouseButtonActivity(event.x,event.y);
}

Fixed version (ground truth):
public void mouseMove(MouseEvent event){
  int newLine=fParentRuler.toDocumentLineNumber(event.y) + 1;
  if (annotationColumn instanceof ISTAnnotationHyperlink) {
    if (((ISTAnnotationHyperlink)annotationColumn).isAnnotationHyperlink(newLine) && !annotationColumn.getAnnotation(newLine).trim().isEmpty()) {
      Cursor cursor=new Cursor(event.display,SWT.CURSOR_HAND);
      fCanvas.setCursor(cursor);
    }
 else {
      Cursor cursor=new Cursor(event.display,SWT.CURSOR_ARROW);
      fCanvas.setCursor(cursor);
    }
  }
  if (fIsListeningForMove && !autoScroll(event)) {
    expandSelection(newLine);
  }
  fParentRuler.setLocationOfLastMouseButtonActivity(event.x,event.y);
}
Program: 92608
Project: 92608
Buggy source:
public void setFullRange(long startTime,long endTime){
  fZoom.setFullRange(startTime,endTime);
}

Fixed version (ground truth):
@Override public void setFullRange(long startTime,long endTime){
  fZoom.setFullRange(startTime,endTime);
}
Program: 92609
Project: 92609
Buggy source:
@Override public void run(){
  if (!fCanvas.isDisposed()) {
    int canvasWidth=fCanvas.getBounds().width;
    int canvasHeight=fCanvas.getBounds().height;
    if (canvasWidth <= 0 || canvasHeight <= 0)     return;
    fDataModel.setCurrentEvent(fCurrentEventTime);
    fScaledData=fDataModel.scaleTo(canvasWidth,canvasHeight,HISTOGRAM_BAR_WIDTH);
    fCanvas.redraw();
    fTimeRangeStartText.setText(HistogramUtils.nanosecondsToString(fDataModel.getFirstBucketTime()));
    fTimeRangeEndText.setText(HistogramUtils.nanosecondsToString(fDataModel.getEndTime()));
    fMaxNbEventsText.setText(Long.toString(fScaledData.fMaxValue));
    fMaxNbEventsText.getParent().layout();
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (!fCanvas.isDisposed()) {
    int canvasWidth=fCanvas.getBounds().width;
    int canvasHeight=fCanvas.getBounds().height;
    if (canvasWidth <= 0 || canvasHeight <= 0)     return;
    fDataModel.setCurrentEvent(fCurrentEventTime);
    fScaledData=fDataModel.scaleTo(canvasWidth,canvasHeight,HISTOGRAM_BAR_WIDTH);
    fCanvas.redraw();
    fTimeRangeStartText.setText(HistogramUtils.nanosecondsToString(fDataModel.getFirstBucketTime()));
    fTimeRangeEndText.setText(HistogramUtils.nanosecondsToString(fDataModel.getEndTime()));
    fMaxNbEventsText.setText(Long.toString(fScaledData.fMaxValue));
    setFullRange(fDataModel.getFirstBucketTime(),fDataModel.getEndTime());
    fMaxNbEventsText.getParent().layout();
  }
}
Program: 92610
Project: 92610
Buggy source:
/** 
 * Refresh the histogram display
 */
@Override public void modelUpdated(){
  if (!fCanvas.isDisposed() && fCanvas.getDisplay() != null) {
    fCanvas.getDisplay().asyncExec(new Runnable(){
      @Override public void run(){
        if (!fCanvas.isDisposed()) {
          int canvasWidth=fCanvas.getBounds().width;
          int canvasHeight=fCanvas.getBounds().height;
          if (canvasWidth <= 0 || canvasHeight <= 0)           return;
          fDataModel.setCurrentEvent(fCurrentEventTime);
          fScaledData=fDataModel.scaleTo(canvasWidth,canvasHeight,HISTOGRAM_BAR_WIDTH);
          fCanvas.redraw();
          fTimeRangeStartText.setText(HistogramUtils.nanosecondsToString(fDataModel.getFirstBucketTime()));
          fTimeRangeEndText.setText(HistogramUtils.nanosecondsToString(fDataModel.getEndTime()));
          fMaxNbEventsText.setText(Long.toString(fScaledData.fMaxValue));
          fMaxNbEventsText.getParent().layout();
        }
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Refresh the histogram display
 */
@Override public void modelUpdated(){
  if (!fCanvas.isDisposed() && fCanvas.getDisplay() != null) {
    fCanvas.getDisplay().asyncExec(new Runnable(){
      @Override public void run(){
        if (!fCanvas.isDisposed()) {
          int canvasWidth=fCanvas.getBounds().width;
          int canvasHeight=fCanvas.getBounds().height;
          if (canvasWidth <= 0 || canvasHeight <= 0)           return;
          fDataModel.setCurrentEvent(fCurrentEventTime);
          fScaledData=fDataModel.scaleTo(canvasWidth,canvasHeight,HISTOGRAM_BAR_WIDTH);
          fCanvas.redraw();
          fTimeRangeStartText.setText(HistogramUtils.nanosecondsToString(fDataModel.getFirstBucketTime()));
          fTimeRangeEndText.setText(HistogramUtils.nanosecondsToString(fDataModel.getEndTime()));
          fMaxNbEventsText.setText(Long.toString(fScaledData.fMaxValue));
          setFullRange(fDataModel.getFirstBucketTime(),fDataModel.getEndTime());
          fMaxNbEventsText.getParent().layout();
        }
      }
    }
);
  }
}
Program: 92611
Project: 92611
Buggy source:
public void setFullRange(long startTime,long endTime){
  long currentFirstEvent=getStartTime();
  fZoom.setFullRange((currentFirstEvent == 0) ? startTime : currentFirstEvent,endTime);
}

Fixed version (ground truth):
@Override public void setFullRange(long startTime,long endTime){
  long currentFirstEvent=getStartTime();
  fZoom.setFullRange((currentFirstEvent == 0) ? startTime : currentFirstEvent,endTime);
}
Program: 92612
Project: 92612
Buggy source:
public void start(BundleContext context) throws Exception {
  super.start(context);
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
}
Program: 92613
Project: 92613
Buggy source:
/** 
 * The constructor.
 */
public OprofileLaunchPlugin(){
  plugin=this;
}

Fixed version (ground truth):
/** 
 * The constructor.
 */
public OprofileLaunchPlugin(){
}
Program: 92614
Project: 92614
Buggy source:
/** 
 * The constructor.
 */
public OprofileUiPlugin(){
  plugin=this;
}

Fixed version (ground truth):
/** 
 * The constructor.
 */
public OprofileUiPlugin(){
}
Program: 92615
Project: 92615
Buggy source:
/** 
 * This method is called upon plug-in activation
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
}

Fixed version (ground truth):
/** 
 * This method is called upon plug-in activation
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
}
Program: 92616
Project: 92616
Buggy source:
public static void scrollDown(StapGraph graph){
  if (graph.getDrawMode() == StapGraph.CONSTANT_DRAWMODE_LEVEL) {
    if (graph.getTopLevel() + StapGraph.levelBuffer < graph.getLowestLevelOfNodesAdded()) {
      int newLevel=graph.getTopLevel() + 1;
      if (graph.levels.get(newLevel).get(0) == null)       return;
      graph.setTopLevelTo(newLevel);
      int animMode=graph.getAnimationMode();
      graph.setAnimationMode(StapGraph.CONSTANT_ANIMATION_FASTEST);
      graph.draw(graph.getDrawMode(),StapGraph.CONSTANT_ANIMATION_FASTEST,graph.levels.get(newLevel).get(0));
      graph.setAnimationMode(animMode);
    }
  }
 else   if (graph.getDrawMode() == StapGraph.CONSTANT_DRAWMODE_TREE) {
    graph.extendTree();
  }
}

Fixed version (ground truth):
public static void scrollDown(StapGraph graph){
  if (graph.getDrawMode() == StapGraph.CONSTANT_DRAWMODE_LEVEL) {
    if (graph.getTopLevel() + graph.levelBuffer < graph.getLowestLevelOfNodesAdded()) {
      int newLevel=graph.getTopLevel() + 1;
      if (graph.levels.get(newLevel).get(0) == null)       return;
      graph.setTopLevelTo(newLevel);
      int animMode=graph.getAnimationMode();
      graph.setAnimationMode(StapGraph.CONSTANT_ANIMATION_FASTEST);
      graph.draw(graph.getDrawMode(),StapGraph.CONSTANT_ANIMATION_FASTEST,graph.levels.get(newLevel).get(0));
      graph.setAnimationMode(animMode);
    }
  }
 else   if (graph.getDrawMode() == StapGraph.CONSTANT_DRAWMODE_TREE) {
    graph.extendTree();
  }
}
Program: 92619
Project: 92619
Buggy source:
/** 
 * Validate the binary file. In particular, verify that this binary file can be decoded.
 * @param o
 * @return the binary object, or null.
 */
private IBinaryObject validateBinary(IBinaryFile o){
  if (o instanceof IBinaryObject) {
    IBinaryObject object=(IBinaryObject)o;
    String s=null;
    try {
      s=object.getCPU();
    }
 catch (    Exception _) {
    }
    if (s.length() > 0) {
      return object;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Validate the binary file. In particular, verify that this binary file can be decoded.
 * @param o
 * @return the binary object, or null.
 */
private IBinaryObject validateBinary(IBinaryFile o){
  if (o instanceof IBinaryObject) {
    IBinaryObject object=(IBinaryObject)o;
    String s=null;
    try {
      s=object.getCPU();
    }
 catch (    Exception _) {
    }
    if (s != null && s.length() > 0) {
      return object;
    }
  }
  return null;
}
Program: 92620
Project: 92620
Buggy source:
/** 
 * Updates the tool tip text of the header of this ruler.
 * @since 3.0
 */
private void updateHeaderToolTipText(){
  if (fHeader == null || fHeader.isDisposed())   return;
  fHeader.setToolTipText(null);
  if (!(fAnnotationAccess instanceof IAnnotationAccessExtension))   return;
  String overview="String_Node_Str";
  for (int i=fAnnotationsSortedByLayer.size() - 1; i >= 0; i--) {
    Object annotationType=fAnnotationsSortedByLayer.get(i);
    if (skipInHeader(annotationType) || skip(annotationType))     continue;
    int count=0;
    String annotationTypeLabel=null;
    for (FilterIterator e=new FilterIterator(annotationType,FilterIterator.PERSISTENT | FilterIterator.TEMPORARY | FilterIterator.IGNORE_BAGS); e.hasNext(); ) {
      Annotation annotation=e.next();
      if (annotation != null) {
        if (annotationTypeLabel == null)         annotationTypeLabel=((IAnnotationAccessExtension)fAnnotationAccess).getTypeLabel(annotation);
        count++;
      }
    }
    if (annotationTypeLabel != null) {
      if (overview.length() > 0)       overview+="String_Node_Str";
      overview+=STJFaceTextMessages.getFormattedString("String_Node_Str",new Object[]{annotationTypeLabel,new Integer(count)});
    }
  }
  if (overview.length() > 0)   fHeader.setToolTipText(overview);
}

Fixed version (ground truth):
/** 
 * Updates the tool tip text of the header of this ruler.
 * @since 3.0
 */
private void updateHeaderToolTipText(){
  if (fHeader == null || fHeader.isDisposed())   return;
  fHeader.setToolTipText(null);
  if (!(fAnnotationAccess instanceof IAnnotationAccessExtension))   return;
  String overview="String_Node_Str";
  for (int i=fAnnotationsSortedByLayer.size() - 1; i >= 0; i--) {
    Object annotationType=fAnnotationsSortedByLayer.get(i);
    if (skipInHeader(annotationType) || skip(annotationType))     continue;
    int count=0;
    String annotationTypeLabel=null;
    for (FilterIterator e=new FilterIterator(annotationType,FilterIterator.PERSISTENT | FilterIterator.TEMPORARY | FilterIterator.IGNORE_BAGS); e.hasNext(); ) {
      Annotation annotation=e.next();
      if (annotation != null) {
        if (annotationTypeLabel == null)         annotationTypeLabel=((IAnnotationAccessExtension)fAnnotationAccess).getTypeLabel(annotation);
        count++;
      }
    }
    if (annotationTypeLabel != null) {
      if (overview.length() > 0)       overview+="String_Node_Str";
      overview+=STJFaceTextMessages.getFormattedString("String_Node_Str",new Object[]{annotationTypeLabel,count});
    }
  }
  if (overview.length() > 0)   fHeader.setToolTipText(overview);
}
Program: 92621
Project: 92621
Buggy source:
public void mouseDown(MouseEvent event){
  fParentRuler.setLocationOfLastMouseButtonActivity(event.x,event.y);
  int newLine=fParentRuler.toDocumentLineNumber(event.y) + 1;
  if (annotationColumn instanceof ISTAnnotationHyperlink) {
    ISTAnnotationHyperlink ahp=(ISTAnnotationHyperlink)annotationColumn;
    if (ahp.isAnnotationHyperlink(newLine) && annotationColumn.getAnnotation(newLine).trim() != "String_Node_Str") {
      ahp.handleHyperlink(newLine);
    }
  }
 else {
    if (event.button == 1) {
      startSelecting();
    }
  }
}

Fixed version (ground truth):
public void mouseDown(MouseEvent event){
  fParentRuler.setLocationOfLastMouseButtonActivity(event.x,event.y);
  int newLine=fParentRuler.toDocumentLineNumber(event.y) + 1;
  if (annotationColumn instanceof ISTAnnotationHyperlink) {
    ISTAnnotationHyperlink ahp=(ISTAnnotationHyperlink)annotationColumn;
    if (ahp.isAnnotationHyperlink(newLine) && !annotationColumn.getAnnotation(newLine).trim().isEmpty()) {
      ahp.handleHyperlink(newLine);
    }
  }
 else {
    if (event.button == 1) {
      startSelecting();
    }
  }
}
Program: 92622
Project: 92622
Buggy source:
/** 
 * Paints the line. After this method is called the line numbers are painted on top of the result of this method.
 * @param line the line of the document which the ruler is painted for
 * @param y the y-coordinate of the box being painted for <code>line</code>, relative to <code>gc</code>
 * @param lineheight the height of one line (and therefore of the box being painted)
 * @param gc the drawing context the client may choose to draw on.
 * @param display the display the drawing occurs on
 * @since 3.0
 */
protected void paintLine(int line,int y,int lineheight,GC gc,Display display){
  int widgetLine=JFaceTextUtil.modelLineToWidgetLine(fParentRuler.getTextViewer(),line);
  String s="String_Node_Str";
  int indentation=fCachedNumberOfDigits;
  if (annotationColumn instanceof ISTAnnotationHyperlink) {
    ISTAnnotationHyperlink ah=(ISTAnnotationHyperlink)annotationColumn;
    if (ah.isAnnotationHyperlink(widgetLine)) {
      paintHyperLink(line,y,indentation,lineheight,gc,display);
    }
  }
 else {
    s=annotationColumn.getAnnotation(widgetLine);
    if (widgetLine + 1 == 1) {
      for (int i=0; i < annotationColumn.getTitle().length(); i++)       s=s + "String_Node_Str";
    }
    int baselineBias=getBaselineBias(gc,widgetLine);
    gc.drawString(s,indentation,y + baselineBias,true);
  }
}

Fixed version (ground truth):
/** 
 * Paints the line. After this method is called the line numbers are painted on top of the result of this method.
 * @param line the line of the document which the ruler is painted for
 * @param y the y-coordinate of the box being painted for <code>line</code>, relative to <code>gc</code>
 * @param lineheight the height of one line (and therefore of the box being painted)
 * @param gc the drawing context the client may choose to draw on.
 * @param display the display the drawing occurs on
 * @since 3.0
 */
protected void paintLine(int line,int y,int lineheight,GC gc,Display display){
  int widgetLine=JFaceTextUtil.modelLineToWidgetLine(fParentRuler.getTextViewer(),line);
  String s="String_Node_Str";
  int indentation=fCachedNumberOfDigits;
  if (annotationColumn instanceof ISTAnnotationHyperlink) {
    ISTAnnotationHyperlink ah=(ISTAnnotationHyperlink)annotationColumn;
    if (ah.isAnnotationHyperlink(widgetLine)) {
      paintHyperLink(line,y,indentation,lineheight,gc,display);
    }
  }
 else {
    s=annotationColumn.getAnnotation(widgetLine);
    if (widgetLine == 0) {
      for (int i=0; i < annotationColumn.getTitle().length(); i++)       s=s + "String_Node_Str";
    }
    int baselineBias=getBaselineBias(gc,widgetLine);
    gc.drawString(s,indentation,y + baselineBias,true);
  }
}