nus-yam/ex-repair huggingface dataset:
Program: 92825
Project: 92825
Buggy source:
private void selectTrace(LTTngTraceNode traceNode){
  if (fSelectedExperiment != null) {
    fSelectedExperiment.dispose();
  }
  try {
    ITmfTrace[] traces=new ITmfTrace[1];
    IResource res=traceNode.getFolder();
    String location=res.getLocation().toOSString();
    IProject project=traceNode.getProject().getProject();
    String traceLibPath=TraceHelper.getTraceLibDirFromProject(project);
    ITmfTrace trace=new LTTngTrace(location,traceLibPath,waitForCompletion,false);
    traces[0]=trace;
    fSelectedExperiment=new LTTngExperiment<LttngEvent>(LttngEvent.class,traceNode.getName(),traces);
    TmfExperiment.setCurrentExperiment(fSelectedExperiment);
    StateManagerFactory.getExperimentManager().experimentSelected_prep((TmfExperiment<LttngEvent>)fSelectedExperiment);
    broadcast(new TmfExperimentSelectedSignal<LttngEvent>(this,fSelectedExperiment));
  }
 catch (  FileNotFoundException e) {
    return;
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void selectTrace(LTTngTraceNode traceNode){
  if (fSelectedExperiment != null) {
    fSelectedExperiment.dispose();
  }
  try {
    ITmfTrace[] traces=new ITmfTrace[1];
    IResource res=traceNode.getFolder();
    String location=res.getLocation().toOSString();
    IProject project=traceNode.getProject().getProject();
    String traceLibPath=TraceHelper.getTraceLibDirFromProject(project);
    ITmfTrace trace=new LTTngTrace(location,traceLibPath,waitForCompletion,false);
    traces[0]=trace;
    fSelectedExperiment=new LTTngExperiment<LttngEvent>(LttngEvent.class,traceNode.getName(),traces);
    TmfExperiment.setCurrentExperiment(fSelectedExperiment);
    StateManagerFactory.getExperimentManager().experimentSelected_prep((TmfExperiment<LttngEvent>)fSelectedExperiment);
    broadcast(new TmfExperimentSelectedSignal<LttngEvent>(this,fSelectedExperiment));
  }
 catch (  FileNotFoundException e) {
    return;
  }
catch (  Exception e) {
    MessageDialog.openError(getViewSite().getShell(),Messages.SelectTrace_ErrorTitle,e.getMessage());
  }
}
Program: 92826
Project: 92826
Buggy source:
protected IValgrindMessage[] parseLogs(IPath outputPath) throws IOException, CoreException {
  List<IValgrindMessage> messages=new ArrayList<IValgrindMessage>();
  for (  File log : outputPath.toFile().listFiles(LOG_FILTER)) {
    ValgrindCoreParser parser=new ValgrindCoreParser(log,launch);
    IValgrindMessage[] results=parser.getMessages();
    messages.addAll(Arrays.asList(results));
    createMarkers(results);
  }
  return messages.toArray(new IValgrindMessage[messages.size()]);
}

Fixed version (ground truth):
protected IValgrindMessage[] parseLogs(IPath outputPath) throws IOException, CoreException {
  List<IValgrindMessage> messages=new ArrayList<IValgrindMessage>();
  for (  File log : outputPath.toFile().listFiles(LOG_FILTER)) {
    ValgrindCoreParser parser=new ValgrindCoreParser(log,launch);
    IValgrindMessage[] results=parser.getMessages();
    if (results.length == 0) {
      results=new IValgrindMessage[1];
      results[0]=new ValgrindInfo(null,Messages.getString("String_Node_Str"),launch);
    }
    messages.addAll(Arrays.asList(results));
    createMarkers(results);
  }
  return messages.toArray(new IValgrindMessage[messages.size()]);
}
Program: 92827
Project: 92827
Buggy source:
@Override protected void initializeDefaultPreferences(IPreferenceStore store){
  ValgrindCommand valCommand=new ValgrindCommand();
  try {
    store.setDefault(ValgrindPreferencePage.VALGRIND_PATH,valCommand.whichValgrind());
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override protected void initializeDefaultPreferences(IPreferenceStore store){
  ValgrindCommand valCommand=new ValgrindCommand();
  try {
    store.setDefault(ValgrindPreferencePage.VALGRIND_ENABLE,true);
    store.setDefault(ValgrindPreferencePage.VALGRIND_PATH,valCommand.whichValgrind());
  }
 catch (  IOException e) {
    store.setDefault(ValgrindPreferencePage.VALGRIND_ENABLE,false);
  }
}
Program: 92828
Project: 92828
Buggy source:
@Override public boolean performOk(){
  if (passesValidityChecks()) {
    ValgrindPlugin.getDefault().savePluginPreferences();
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean performOk(){
  if (isValid()) {
    store.setValue(VALGRIND_ENABLE,enableButton.getSelection());
    store.setValue(VALGRIND_PATH,binText.getText());
    ValgrindPlugin.getDefault().savePluginPreferences();
    return true;
  }
 else {
    return false;
  }
}
Program: 92829
Project: 92829
Buggy source:
@Override protected void performDefaults(){
  super.performDefaults();
  store.setValue(VALGRIND_PATH,store.getDefaultString(VALGRIND_PATH));
  binText.setText(store.getDefaultString(VALGRIND_PATH));
}

Fixed version (ground truth):
@Override protected void performDefaults(){
  store.setValue(VALGRIND_ENABLE,store.getDefaultBoolean(VALGRIND_ENABLE));
  enableButton.setSelection(store.getDefaultBoolean(VALGRIND_ENABLE));
  store.setValue(VALGRIND_PATH,store.getDefaultString(VALGRIND_PATH));
  binText.setText(store.getDefaultString(VALGRIND_PATH));
  super.performDefaults();
}
Program: 92830
Project: 92830
Buggy source:
@Override protected Control createContents(Composite parent){
  Composite composite=new Composite(parent,SWT.NULL);
  GridLayout layout=new GridLayout();
  layout.numColumns=3;
  composite.setLayout(layout);
  GridData data=new GridData();
  data.verticalAlignment=SWT.FILL;
  data.horizontalAlignment=SWT.FILL;
  data.grabExcessHorizontalSpace=true;
  data.grabExcessVerticalSpace=true;
  composite.setLayoutData(data);
  Label pathLabel=new Label(composite,SWT.NONE);
  pathLabel.setText(Messages.getString("String_Node_Str"));
  binText=new Text(composite,SWT.SINGLE | SWT.BORDER);
  GridData binTextData=new GridData();
  binTextData.horizontalAlignment=SWT.FILL;
  binTextData.grabExcessHorizontalSpace=true;
  binText.setLayoutData(binTextData);
  button=new Button(composite,SWT.PUSH);
  button.setText(Messages.getString("String_Node_Str"));
  button.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      Shell shell=new Shell();
      FileDialog dialog=new FileDialog(shell);
      String path=dialog.open();
      if (path != null) {
        binText.setText(path);
      }
    }
  }
);
  loadPreferences();
  return parent;
}

Fixed version (ground truth):
@Override protected Control createContents(Composite parent){
  Composite enableTop=new Composite(parent,SWT.NONE);
  enableTop.setLayout(new GridLayout());
  GridData enableData=new GridData(SWT.FILL,SWT.FILL,true,true);
  enableTop.setLayoutData(enableData);
  enableButton=new Button(enableTop,SWT.CHECK);
  enableButton.setText(Messages.getString("String_Node_Str"));
  enableButton.addSelectionListener(new SelectionListener(){
    public void widgetSelected(    SelectionEvent e){
      checkValgrindEnablement();
    }
    public void widgetDefaultSelected(    SelectionEvent e){
    }
  }
);
  Composite locationTop=new Composite(enableTop,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.numColumns=3;
  layout.marginTop=0;
  locationTop.setLayout(layout);
  GridData data=new GridData();
  data.verticalAlignment=SWT.FILL;
  data.horizontalAlignment=SWT.FILL;
  data.grabExcessHorizontalSpace=true;
  data.grabExcessVerticalSpace=true;
  locationTop.setLayoutData(data);
  Label pathLabel=new Label(locationTop,SWT.NONE);
  pathLabel.setText(Messages.getString("String_Node_Str"));
  binText=new Text(locationTop,SWT.SINGLE | SWT.BORDER);
  GridData binTextData=new GridData();
  binTextData.horizontalAlignment=SWT.FILL;
  binTextData.grabExcessHorizontalSpace=true;
  binText.setLayoutData(binTextData);
  browseButton=new Button(locationTop,SWT.PUSH);
  browseButton.setText(Messages.getString("String_Node_Str"));
  browseButton.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      Shell shell=new Shell();
      FileDialog dialog=new FileDialog(shell);
      String path=dialog.open();
      if (path != null) {
        binText.setText(path);
      }
    }
  }
);
  loadPreferences();
  return parent;
}
Program: 92831
Project: 92831
Buggy source:
private void loadPreferences(){
  binText.setText(store.getString(VALGRIND_PATH));
}

Fixed version (ground truth):
private void loadPreferences(){
  enableButton.setSelection(store.getBoolean(VALGRIND_ENABLE));
  binText.setText(store.getString(VALGRIND_PATH));
  checkValgrindEnablement();
}
Program: 92832
Project: 92832
Buggy source:
public ColorSetting(RGB foreground,RGB background,int tickColorIndex,ITmfFilterTreeNode filter){
  fForegroundRGB=foreground;
  fBackgroundRGB=background;
  fTickColorIndex=tickColorIndex;
  fFilter=filter;
  Display display=Display.getDefault();
  fForegroundColor=new Color(display,fForegroundRGB);
  fBackgroundColor=new Color(display,fBackgroundRGB);
  fDimmedForegroundColor=new Color(display,ColorUtil.blend(fForegroundRGB,fBackgroundRGB));
  fDimmedBackgroundColor=new Color(display,ColorUtil.blend(fBackgroundRGB,display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB()));
}

Fixed version (ground truth):
/** 
 * You must dispose the color setting when it is no longer required.
 */
public ColorSetting(RGB foreground,RGB background,int tickColorIndex,ITmfFilterTreeNode filter){
  fForegroundRGB=foreground;
  fBackgroundRGB=background;
  fTickColorIndex=tickColorIndex;
  fFilter=filter;
  Display display=Display.getDefault();
  fForegroundColor=new Color(display,fForegroundRGB);
  fBackgroundColor=new Color(display,fBackgroundRGB);
  fDimmedForegroundColor=new Color(display,ColorUtil.blend(fForegroundRGB,fBackgroundRGB));
  fDimmedBackgroundColor=new Color(display,ColorUtil.blend(fBackgroundRGB,display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB()));
}
Program: 92833
Project: 92833
Buggy source:
public static ColorSetting[] load(String pathName){
  if (!new File(pathName).canRead()) {
    return new ColorSetting[0];
  }
  SAXParserFactory parserFactory=SAXParserFactory.newInstance();
  parserFactory.setNamespaceAware(true);
  try {
    XMLReader saxReader=parserFactory.newSAXParser().getXMLReader();
    ColorSettingsContentHandler handler=new ColorSettingsContentHandler();
    saxReader.setContentHandler(handler);
    saxReader.parse(pathName);
    return handler.colorSettings.toArray(new ColorSetting[0]);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return new ColorSetting[0];
}

Fixed version (ground truth):
public static ColorSetting[] load(String pathName){
  if (!new File(pathName).canRead()) {
    return new ColorSetting[0];
  }
  SAXParserFactory parserFactory=SAXParserFactory.newInstance();
  parserFactory.setNamespaceAware(true);
  ColorSettingsContentHandler handler=new ColorSettingsContentHandler();
  try {
    XMLReader saxReader=parserFactory.newSAXParser().getXMLReader();
    saxReader.setContentHandler(handler);
    saxReader.parse(pathName);
    return handler.colorSettings.toArray(new ColorSetting[0]);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  for (  ColorSetting colorSetting : handler.colorSettings) {
    colorSetting.dispose();
  }
  return new ColorSetting[0];
}
Program: 92834
Project: 92834
Buggy source:
@Override public void run(){
  FileDialog fileDialog=new FileDialog(fShell,SWT.OPEN);
  fileDialog.setFilterExtensions(new String[]{"String_Node_Str"});
  String pathName=fileDialog.open();
  if (pathName != null) {
    ColorSetting[] colorSettings=ColorSettingsXML.load(pathName);
    if (colorSettings.length > 0) {
      if (fColorSettings.size() > 0) {
        boolean overwrite=MessageDialog.openQuestion(fShell,Messages.ColorsView_ImportOverwriteDialogTitle,Messages.ColorsView_ImportOverwriteDialogMessage1 + Messages.ColorsView_ImportOverwriteDialogMessage2);
        if (overwrite) {
          for (          Control control : fListComposite.getChildren()) {
            if (control instanceof ColorSettingRow) {
              control.dispose();
            }
          }
          fColorSettings=new ArrayList<ColorSetting>();
          fSelectedRow=null;
        }
      }
      for (      ColorSetting colorSetting : colorSettings) {
        ColorSettingRow row=new ColorSettingRow(fListComposite,colorSetting);
        if (fSelectedRow == null) {
          fColorSettings.add(colorSetting);
          row.moveAbove(fFillerComposite);
        }
 else {
          fColorSettings.add(fColorSettings.indexOf(fSelectedRow.getColorSetting()),colorSetting);
          row.moveAbove(fSelectedRow);
        }
      }
      refresh();
      ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  FileDialog fileDialog=new FileDialog(fShell,SWT.OPEN);
  fileDialog.setFilterExtensions(new String[]{"String_Node_Str"});
  String pathName=fileDialog.open();
  if (pathName != null) {
    ColorSetting[] colorSettings=ColorSettingsXML.load(pathName);
    if (colorSettings.length > 0) {
      if (fColorSettings.size() > 0) {
        boolean overwrite=MessageDialog.openQuestion(fShell,Messages.ColorsView_ImportOverwriteDialogTitle,Messages.ColorsView_ImportOverwriteDialogMessage1 + Messages.ColorsView_ImportOverwriteDialogMessage2);
        if (overwrite) {
          for (          Control control : fListComposite.getChildren()) {
            if (control instanceof ColorSettingRow) {
              ((ColorSettingRow)control).fColorSetting.dispose();
              control.dispose();
            }
          }
          fColorSettings=new ArrayList<ColorSetting>();
          fSelectedRow=null;
        }
      }
      for (      ColorSetting colorSetting : colorSettings) {
        ColorSettingRow row=new ColorSettingRow(fListComposite,colorSetting);
        if (fSelectedRow == null) {
          fColorSettings.add(colorSetting);
          row.moveAbove(fFillerComposite);
        }
 else {
          fColorSettings.add(fColorSettings.indexOf(fSelectedRow.getColorSetting()),colorSetting);
          row.moveAbove(fSelectedRow);
        }
      }
      refresh();
      ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
    }
  }
}
Program: 92835
Project: 92835
Buggy source:
/** 
 * Returns the lifeline categories array set for the this frame
 * @return the lifeline categories array or null if not set
 */
public LifelineCategories[] getLifelineCategories(){
  return lifelineCategories;
}

Fixed version (ground truth):
/** 
 * Returns the lifeline categories array set for the this frame
 * @return the lifeline categories array or null if not set
 */
public LifelineCategories[] getLifelineCategories(){
  return Arrays.copyOf(lifelineCategories,lifelineCategories.length);
}
Program: 92836
Project: 92836
Buggy source:
/** 
 * Set the lifeline categories which will be use during the lifelines creation
 * @see Lifeline#setCategory(int)
 * @param categories the lifeline categories array
 */
public void setLifelineCategories(LifelineCategories[] categories){
  lifelineCategories=categories;
}

Fixed version (ground truth):
/** 
 * Set the lifeline categories which will be use during the lifelines creation
 * @see Lifeline#setCategory(int)
 * @param categories the lifeline categories array
 */
public void setLifelineCategories(LifelineCategories[] categories){
  lifelineCategories=Arrays.copyOf(categories,categories.length);
}
Program: 92837
Project: 92837
Buggy source:
public Image getResourceImage(String _name){
  try {
    URL url=new URL(BASIC_URL,"String_Node_Str" + _name);
    ImageDescriptor img=ImageDescriptor.createFromURL(url);
    return img.createImage();
  }
 catch (  Exception E) {
    System.err.println(E);
  }
  return null;
}

Fixed version (ground truth):
public Image getResourceImage(String _name){
  try {
    URL BASIC_URL=new URL("String_Node_Str","String_Node_Str","String_Node_Str");
    URL url=new URL(BASIC_URL,"String_Node_Str" + _name);
    ImageDescriptor img=ImageDescriptor.createFromURL(url);
    return img.createImage();
  }
 catch (  MalformedURLException E) {
    System.err.println(E);
  }
  return null;
}
Program: 92838
Project: 92838
Buggy source:
@Override public void handleData(TmfEvent event){
  super.handleData(event);
  if ((fMonitor != null) && fMonitor.isCanceled()) {
    cancel();
    return;
  }
  ITmfSyncSequenceDiagramEvent sdEvent=getSequnceDiagramEvent(event);
  if (sdEvent != null) {
    if (fCriteria.isLifeLineSelected()) {
      if (fCriteria.matches(sdEvent.getSender())) {
        fFoundTime=event.getTimestamp().clone();
        fIsFound=true;
        super.cancel();
      }
      if (fCriteria.matches(sdEvent.getReceiver())) {
        fFoundTime=event.getTimestamp().clone();
        fIsFound=true;
        super.cancel();
      }
    }
    if (fCriteria.isSyncMessageSelected()) {
      if (fCriteria.matches(sdEvent.getName())) {
        fFoundTime=event.getTimestamp().clone();
        fIsFound=true;
        super.cancel();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void handleData(TmfEvent event){
  super.handleData(event);
  if ((fMonitor != null) && fMonitor.isCanceled()) {
    super.cancel();
    return;
  }
  ITmfSyncSequenceDiagramEvent sdEvent=getSequnceDiagramEvent(event);
  if (sdEvent != null) {
    if (fCriteria.isLifeLineSelected()) {
      if (fCriteria.matches(sdEvent.getSender())) {
        fFoundTime=event.getTimestamp().clone();
        fIsFound=true;
        super.cancel();
      }
      if (fCriteria.matches(sdEvent.getReceiver())) {
        fFoundTime=event.getTimestamp().clone();
        fIsFound=true;
        super.cancel();
      }
    }
    if (fCriteria.isSyncMessageSelected()) {
      if (fCriteria.matches(sdEvent.getName())) {
        fFoundTime=event.getTimestamp().clone();
        fIsFound=true;
        super.cancel();
      }
    }
  }
}
Program: 92843
Project: 92843
Buggy source:
/** 
 * Open an existing trace.<p> The tracepath should have been set already,
 * @exception JniOpenTraceFailedException  Thrown if the open failed
 */
public void openTrace() throws JniException {
  if (tracepath == "String_Node_Str") {
    throw new JniTraceException("String_Node_Str");
  }
  if (thisTracePtr.getPointer() != NULL) {
    closeTrace();
  }
  int newLibraryId=initializeLibrary();
  if (newLibraryId != -1) {
    long newPtr;
    if (isLiveTraceSupported()) {
      newPtr=ltt_openTraceLive(newLibraryId,tracepath,printLttDebug);
    }
 else {
      newPtr=ltt_openTrace(newLibraryId,tracepath,printLttDebug);
    }
    if (newPtr == NULL) {
      thisTracePtr=new Jni_C_Pointer_And_Library_Id();
      throw new JniOpenTraceFailedException("String_Node_Str");
    }
    thisTracePtr=new Jni_C_Pointer_And_Library_Id(newLibraryId,newPtr);
    populateTraceInformation();
  }
 else {
    thisTracePtr=new Jni_C_Pointer_And_Library_Id();
    throw new JniTraceException("String_Node_Str" + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Open an existing trace.<p> The tracepath should have been set already,
 * @exception JniOpenTraceFailedException  Thrown if the open failed
 */
public void openTrace() throws JniException {
  if (tracepath == "String_Node_Str") {
    throw new JniTraceException("String_Node_Str");
  }
  if (thisTracePtr.getPointer() != NULL) {
    closeTrace();
  }
  int newLibraryId=initializeLibrary();
  if (newLibraryId != -1) {
    long newPtr;
    if (isLiveTraceSupported()) {
      try {
        newPtr=ltt_openTraceLive(newLibraryId,tracepath,printLttDebug);
      }
 catch (      UnsatisfiedLinkError e) {
        setLiveTraceSupported(false);
        newPtr=ltt_openTrace(newLibraryId,tracepath,printLttDebug);
      }
    }
 else {
      newPtr=ltt_openTrace(newLibraryId,tracepath,printLttDebug);
    }
    if (newPtr == NULL) {
      thisTracePtr=new Jni_C_Pointer_And_Library_Id();
      throw new JniOpenTraceFailedException("String_Node_Str");
    }
    thisTracePtr=new Jni_C_Pointer_And_Library_Id(newLibraryId,newPtr);
    populateTraceInformation();
  }
 else {
    thisTracePtr=new Jni_C_Pointer_And_Library_Id();
    throw new JniTraceException("String_Node_Str" + "String_Node_Str");
  }
}
Program: 92844
Project: 92844
Buggy source:
/** 
 * Indicate whether a trace can be opened in live mode. Override if live mode is supported
 * @return true if the trace version supports live
 */
public boolean isLiveTraceSupported(){
  return false;
}

Fixed version (ground truth):
/** 
 * Indicate whether a trace can be opened in live mode.
 * @return true if the trace version supports live
 */
public boolean isLiveTraceSupported(){
  return isLiveTraceSupported;
}
Program: 92845
Project: 92845
Buggy source:
private String fileToString(IFile file){
  String ret=new String();
  try {
    InputStream in=file.getContents();
    int nbrOfByte=in.available();
    byte[] bytes=new byte[nbrOfByte];
    in.read(bytes);
    ret=new String(bytes);
    in.close();
  }
 catch (  CoreException e) {
    RpmlintLog.logError(e);
  }
catch (  IOException e) {
    RpmlintLog.logError(e);
  }
  return ret;
}

Fixed version (ground truth):
private String fileToString(IFile file){
  String ret="String_Node_Str";
  try {
    InputStream in=file.getContents();
    int nbrOfByte=in.available();
    byte[] bytes=new byte[nbrOfByte];
    in.read(bytes);
    ret=new String(bytes);
    in.close();
  }
 catch (  CoreException e) {
    RpmlintLog.logError(e);
  }
catch (  IOException e) {
    RpmlintLog.logError(e);
  }
  return ret;
}
Program: 92846
Project: 92846
Buggy source:
private void fillSoftIRQStateToColor(){
  softIrqStateToColor.put(SoftIRQMode.LTTV_SOFT_IRQ_UNKNOWN.getInName(),StateColor.BLACK);
  softIrqStateToColor.put(SoftIRQMode.LTTV_SOFT_IRQ_IDLE.getInName(),StateColor.BLACK);
  softIrqStateToColor.put(SoftIRQMode.LTTV_SOFT_IRQ_PENDING.getInName(),StateColor.PINK1);
  softIrqStateToColor.put(SoftIRQMode.LTTV_SOFT_IRQ_BUSY.getInName(),StateColor.PURPLE1);
}

Fixed version (ground truth):
private void fillSoftIRQStateToColor(){
  softIrqStateToColor.put(SoftIRQMode.LTTV_SOFT_IRQ_UNKNOWN.getInName(),StateColor.BLACK);
  softIrqStateToColor.put(SoftIRQMode.LTTV_SOFT_IRQ_IDLE.getInName(),StateColor.GRAY);
  softIrqStateToColor.put(SoftIRQMode.LTTV_SOFT_IRQ_PENDING.getInName(),StateColor.PINK1);
  softIrqStateToColor.put(SoftIRQMode.LTTV_SOFT_IRQ_BUSY.getInName(),StateColor.PURPLE1);
}
Program: 92847
Project: 92847
Buggy source:
private void fillBdevStateToColor(){
  softIrqStateToColor.put(BdevMode.LTTV_BDEV_UNKNOWN.getInName(),StateColor.BLACK);
  softIrqStateToColor.put(BdevMode.LTTV_BDEV_IDLE.getInName(),StateColor.BLACK);
  softIrqStateToColor.put(BdevMode.LTTV_BDEV_BUSY_READING.getInName(),StateColor.DARK_BLUE);
  softIrqStateToColor.put(BdevMode.LTTV_BDEV_BUSY_WRITING.getInName(),StateColor.RED);
}

Fixed version (ground truth):
private void fillBdevStateToColor(){
  softIrqStateToColor.put(BdevMode.LTTV_BDEV_UNKNOWN.getInName(),StateColor.BLACK);
  softIrqStateToColor.put(BdevMode.LTTV_BDEV_IDLE.getInName(),StateColor.GRAY);
  softIrqStateToColor.put(BdevMode.LTTV_BDEV_BUSY_READING.getInName(),StateColor.DARK_BLUE);
  softIrqStateToColor.put(BdevMode.LTTV_BDEV_BUSY_WRITING.getInName(),StateColor.RED);
}
Program: 92848
Project: 92848
Buggy source:
private void fillTrapStateToColor(){
  trapStateToColor.put(TrapMode.LTTV_TRAP_UNKNOWN.getInName(),StateColor.BLACK);
  trapStateToColor.put(TrapMode.LTTV_TRAP_IDLE.getInName(),StateColor.BLACK);
  trapStateToColor.put(TrapMode.LTTV_TRAP_BUSY.getInName(),StateColor.GOLD);
}

Fixed version (ground truth):
private void fillTrapStateToColor(){
  trapStateToColor.put(TrapMode.LTTV_TRAP_UNKNOWN.getInName(),StateColor.BLACK);
  trapStateToColor.put(TrapMode.LTTV_TRAP_IDLE.getInName(),StateColor.GRAY);
  trapStateToColor.put(TrapMode.LTTV_TRAP_BUSY.getInName(),StateColor.GOLD);
}
Program: 92849
Project: 92849
Buggy source:
private void fillContextMenu(IMenuManager manager){
  manager.add(new Separator());
  manager.add(resetScale);
  manager.add(nextEvent);
  manager.add(prevEvent);
  manager.add(nextTrace);
  manager.add(prevTrace);
  manager.add(zoomIn);
  manager.add(zoomOut);
  manager.add(zoomFilter);
  manager.add(new Separator());
  manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}

Fixed version (ground truth):
private void fillContextMenu(IMenuManager manager){
  manager.add(showLegend);
  manager.add(new Separator());
  manager.add(resetScale);
  manager.add(nextEvent);
  manager.add(prevEvent);
  manager.add(nextTrace);
  manager.add(prevTrace);
  manager.add(showLegend);
  manager.add(zoomIn);
  manager.add(zoomOut);
  manager.add(zoomFilter);
  manager.add(new Separator());
  manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
Program: 92850
Project: 92850
Buggy source:
private void fillLocalToolBar(IToolBarManager manager){
  manager.add(new Separator());
  manager.add(resetScale);
  manager.add(nextEvent);
  manager.add(prevEvent);
  manager.add(nextTrace);
  manager.add(prevTrace);
  manager.add(zoomIn);
  manager.add(zoomOut);
  manager.add(zoomFilter);
  manager.add(new Separator());
}

Fixed version (ground truth):
private void fillLocalToolBar(IToolBarManager manager){
  manager.add(showLegend);
  manager.add(new Separator());
  manager.add(resetScale);
  manager.add(nextEvent);
  manager.add(prevEvent);
  manager.add(nextTrace);
  manager.add(prevTrace);
  manager.add(zoomIn);
  manager.add(zoomOut);
  manager.add(zoomFilter);
  manager.add(new Separator());
}
Program: 92851
Project: 92851
Buggy source:
private void fillLocalPullDown(IMenuManager manager){
  manager.add(new Separator());
  manager.add(new Separator());
  manager.add(resetScale);
  manager.add(nextEvent);
  manager.add(prevEvent);
  manager.add(nextTrace);
  manager.add(prevTrace);
  manager.add(zoomIn);
  manager.add(zoomOut);
  manager.add(zoomFilter);
  manager.add(new Separator());
}

Fixed version (ground truth):
private void fillLocalPullDown(IMenuManager manager){
  manager.add(new Separator());
  manager.add(showLegend);
  manager.add(new Separator());
  manager.add(resetScale);
  manager.add(nextEvent);
  manager.add(prevEvent);
  manager.add(nextTrace);
  manager.add(prevTrace);
  manager.add(zoomIn);
  manager.add(zoomOut);
  manager.add(zoomFilter);
  manager.add(new Separator());
}
Program: 92853
Project: 92853
Buggy source:
private void fillLocalToolBar(IToolBarManager manager){
  manager.add(new Separator());
  manager.add(resetScale);
  manager.add(nextEvent);
  manager.add(prevEvent);
  manager.add(nextTrace);
  manager.add(prevTrace);
  manager.add(zoomIn);
  manager.add(zoomOut);
  manager.add(zoomFilter);
  manager.add(new Separator());
}

Fixed version (ground truth):
private void fillLocalToolBar(IToolBarManager manager){
  manager.add(showLegend);
  manager.add(new Separator());
  manager.add(resetScale);
  manager.add(nextEvent);
  manager.add(prevEvent);
  manager.add(nextTrace);
  manager.add(prevTrace);
  manager.add(zoomIn);
  manager.add(zoomOut);
  manager.add(zoomFilter);
  manager.add(new Separator());
}
Program: 92854
Project: 92854
Buggy source:
private void fillLocalPullDown(IMenuManager manager){
  manager.add(new Separator());
  manager.add(new Separator());
  manager.add(resetScale);
  manager.add(nextEvent);
  manager.add(prevEvent);
  manager.add(nextTrace);
  manager.add(prevTrace);
  manager.add(zoomIn);
  manager.add(zoomOut);
  manager.add(zoomFilter);
  manager.add(new Separator());
}

Fixed version (ground truth):
private void fillLocalPullDown(IMenuManager manager){
  manager.add(new Separator());
  manager.add(showLegend);
  manager.add(new Separator());
  manager.add(resetScale);
  manager.add(nextEvent);
  manager.add(prevEvent);
  manager.add(nextTrace);
  manager.add(prevTrace);
  manager.add(zoomIn);
  manager.add(zoomOut);
  manager.add(zoomFilter);
  manager.add(new Separator());
}
Program: 92855
Project: 92855
Buggy source:
private void fillContextMenu(IMenuManager manager){
  manager.add(new Separator());
  manager.add(resetScale);
  manager.add(nextEvent);
  manager.add(prevEvent);
  manager.add(nextTrace);
  manager.add(prevTrace);
  manager.add(zoomIn);
  manager.add(zoomOut);
  manager.add(zoomFilter);
  manager.add(new Separator());
  manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}

Fixed version (ground truth):
private void fillContextMenu(IMenuManager manager){
  manager.add(showLegend);
  manager.add(new Separator());
  manager.add(resetScale);
  manager.add(nextEvent);
  manager.add(prevEvent);
  manager.add(nextTrace);
  manager.add(prevTrace);
  manager.add(zoomIn);
  manager.add(zoomOut);
  manager.add(zoomFilter);
  manager.add(new Separator());
  manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
Program: 92856
Project: 92856
Buggy source:
/** 
 * This is a callback that will allow us to create the viewer and initialize it.
 */
@Override public void createPartControl(Composite parent){
  top=new Composite(parent,SWT.BORDER);
  top.setLayout(new FillLayout());
  tsfviewer=TmfViewerFactory.createViewer(top,new TimeRangeViewerProvider(getParamsUpdater()));
  tsfviewer.addWidgetSelectionListner(this);
  tsfviewer.addWidgetTimeScaleSelectionListner(this);
  tsfviewer.groupTraces(true);
  tsfviewer.setAcceptSelectionAPIcalls(true);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(tsfviewer.getControl(),"String_Node_Str");
  makeActions();
  hookContextMenu();
  contributeToActionBars();
  TmfExperiment<?> experiment=TmfExperiment.getCurrentExperiment();
  if (experiment != null) {
    TmfTimeRange experimentTRange=experiment.getTimeRange();
    if (experimentTRange != null) {
      long time0=experimentTRange.getStartTime().getValue();
      long time1=experimentTRange.getEndTime().getValue();
      ParamsUpdater paramUpdater=getParamsUpdater();
      paramUpdater.update(time0,time1);
    }
    TmfTimeRange adjustedTimeRange=initialExperimentDataRequest(this,experimentTRange);
    ModelUpdateInit(experimentTRange,adjustedTimeRange,this);
  }
 else {
    TraceDebug.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * This is a callback that will allow us to create the viewer and initialize it.
 */
@Override public void createPartControl(Composite parent){
  top=new Composite(parent,SWT.BORDER);
  top.setLayout(new FillLayout());
  tsfviewer=TmfViewerFactory.createViewer(top,new ResourcesTimeRangeViewerProvider(getParamsUpdater()));
  tsfviewer.addWidgetSelectionListner(this);
  tsfviewer.addWidgetTimeScaleSelectionListner(this);
  tsfviewer.groupTraces(true);
  tsfviewer.setAcceptSelectionAPIcalls(true);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(tsfviewer.getControl(),"String_Node_Str");
  makeActions();
  hookContextMenu();
  contributeToActionBars();
  TmfExperiment<?> experiment=TmfExperiment.getCurrentExperiment();
  if (experiment != null) {
    TmfTimeRange experimentTRange=experiment.getTimeRange();
    if (experimentTRange != null) {
      long time0=experimentTRange.getStartTime().getValue();
      long time1=experimentTRange.getEndTime().getValue();
      ParamsUpdater paramUpdater=getParamsUpdater();
      paramUpdater.update(time0,time1);
    }
    TmfTimeRange adjustedTimeRange=initialExperimentDataRequest(this,experimentTRange);
    ModelUpdateInit(experimentTRange,adjustedTimeRange,this);
  }
 else {
    TraceDebug.debug("String_Node_Str");
  }
}
Program: 92857
Project: 92857
Buggy source:
private void createThreadStatesGroup(Composite composite){
  Group gs=new Group(composite,SWT.NONE);
  gs.setText(Messages.TmfTimeLegend_TRACE_STATES);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  gs.setLayoutData(gd);
  GridLayout layout=new GridLayout();
  layout.numColumns=2;
  layout.marginWidth=20;
  layout.marginBottom=10;
  gs.setLayout(layout);
  for (int i=0; i < 7; i++) {
    Bar bar=new Bar(gs,i);
    gd=new GridData();
    gd.widthHint=40;
    gd.heightHint=20;
    gd.verticalIndent=8;
    bar.setLayoutData(gd);
    Label name=new Label(gs,SWT.NONE);
    StateColor stateColor=TraceColorScheme.getStateColors()[i];
    name.setText(ifUtil.getStateName(stateColor));
    gd=new GridData();
    gd.horizontalIndent=10;
    gd.verticalIndent=8;
    name.setLayoutData(gd);
  }
}

Fixed version (ground truth):
private void createThreadStatesGroup(Composite composite){
  Group gs=new Group(composite,SWT.NONE);
  gs.setText(Messages.TmfTimeLegend_TRACE_STATES);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  gs.setLayoutData(gd);
  GridLayout layout=new GridLayout();
  layout.numColumns=2;
  layout.marginWidth=20;
  layout.marginBottom=10;
  gs.setLayout(layout);
  for (int i=0; i < TraceColorScheme.getStateColors().length; i++) {
    StateColor stateColor=TraceColorScheme.getStateColors()[i];
    String stateName=ifUtil.getStateName(stateColor);
    if (stateName != "String_Node_Str") {
      Bar bar=new Bar(gs,i);
      gd=new GridData();
      gd.widthHint=40;
      gd.heightHint=20;
      gd.verticalIndent=8;
      bar.setLayoutData(gd);
      Label name=new Label(gs,SWT.NONE);
      name.setText(stateName);
      gd=new GridData();
      gd.horizontalIndent=10;
      gd.verticalIndent=8;
      name.setLayoutData(gd);
    }
  }
}
Program: 92858
Project: 92858
Buggy source:
/** 
 * @param trace
 * @param disposeOnClose true if the trace should be disposed when the table is disposed
 */
public void setTrace(ITmfTrace trace,boolean disposeOnClose){
  if (fTrace != null && fDisposeOnClose) {
    fTrace.dispose();
  }
  fTrace=trace;
  fPackDone=false;
  fHeaderState=HeaderState.SEARCH;
  fSelectedRank=0;
  fDisposeOnClose=disposeOnClose;
  fTable.getDisplay().syncExec(new Runnable(){
    @Override public void run(){
      fTable.removeAll();
      fTable.setData(Key.FILTER_OBJ,null);
      fTable.setData(Key.FILTER_TXT,null);
      fTable.setData(Key.SEARCH_OBJ,null);
      fTable.setData(Key.SEARCH_TXT,null);
      fCacheStartIndex=fCacheEndIndex=0;
      if (fTrace != null) {
        if (!fTable.isDisposed() && fTrace != null) {
          fTable.setItemCount((int)fTrace.getNbEvents() + 1);
        }
        fRawViewer.setTrace(fTrace);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param trace
 * @param disposeOnClose true if the trace should be disposed when the table is disposed
 */
public void setTrace(ITmfTrace trace,boolean disposeOnClose){
  if (fTrace != null && fDisposeOnClose) {
    fTrace.dispose();
  }
  fTrace=trace;
  fPackDone=false;
  fHeaderState=HeaderState.SEARCH;
  fSelectedRank=0;
  fDisposeOnClose=disposeOnClose;
  fTable.getDisplay().syncExec(new Runnable(){
    @Override public void run(){
      fTable.removeAll();
      fTable.setData(Key.FILTER_OBJ,null);
      fTable.setData(Key.FILTER_TXT,null);
      fTable.setData(Key.SEARCH_OBJ,null);
      fTable.setData(Key.SEARCH_TXT,null);
      for (      TableColumn column : fTable.getColumns()) {
        column.setData(Key.FILTER_OBJ,null);
        column.setData(Key.FILTER_TXT,null);
        column.setData(Key.SEARCH_OBJ,null);
        column.setData(Key.SEARCH_TXT,null);
      }
      fCacheStartIndex=fCacheEndIndex=0;
      if (fTrace != null) {
        if (!fTable.isDisposed() && fTrace != null) {
          fTable.setItemCount((int)fTrace.getNbEvents() + 1);
        }
        fRawViewer.setTrace(fTrace);
      }
    }
  }
);
}
Program: 92859
Project: 92859
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public Vector<TimeEvent> getTraceEvents(){
  return traceEvents;
}

Fixed version (ground truth):
@Override @Deprecated public Vector<ITimeEvent> getTraceEvents(){
  return traceEvents;
}
Program: 92860
Project: 92860
Buggy source:
private void create5000Events(TraceImpl trace){
  EventImpl event;
  Long eventTime;
  int numEvents=5000;
  long sTime=trace.getStartTime();
  long eTime=trace.getStopTime();
  long duration=(long)((eTime - sTime) / numEvents);
  for (int i=0; i < numEvents; i++) {
    eventTime=sTime + (i * duration);
    event=new EventImpl(eventTime,trace,getEventType(i % 16));
    event.setDuration(duration);
    trace.getTraceEvents().add(event);
  }
}

Fixed version (ground truth):
private void create5000Events(TraceImpl trace){
  EventImpl event;
  Long eventTime;
  int numEvents=5000;
  long sTime=trace.getStartTime();
  long eTime=trace.getStopTime();
  long duration=(long)((eTime - sTime) / numEvents);
  for (int i=0; i < numEvents; i++) {
    eventTime=sTime + (i * duration);
    event=new EventImpl(eventTime,trace,getEventType(i % 16));
    event.setDuration(duration);
    trace.addTraceEvent(event);
  }
}
Program: 92861
Project: 92861
Buggy source:
private void createEvents(TraceImpl trace){
  EventImpl event;
  Long eventTime;
  int numEvents=17;
  long duration=0;
  for (int i=0; i < numEvents; i++) {
    eventTime=timeRef + msTons * i + (5 * msTons * count) + (5 * i);
    duration=msTons + i * msTons + (long)((i % 4));
    event=new EventImpl(eventTime,trace,getEventType(i));
    event.setDuration(duration);
    trace.getTraceEvents().add(event);
  }
}

Fixed version (ground truth):
private void createEvents(TraceImpl trace){
  EventImpl event;
  Long eventTime;
  int numEvents=17;
  long duration=0;
  for (int i=0; i < numEvents; i++) {
    eventTime=timeRef + msTons * i + (5 * msTons * count) + (5 * i);
    duration=msTons + i * msTons + (long)((i % 4));
    event=new EventImpl(eventTime,trace,getEventType(i));
    event.setDuration(duration);
    trace.addTraceEvent(event);
  }
}
Program: 92863
Project: 92863
Buggy source:
@Override public Iterator<TimeRangeComponent> getTraceEventsIterator(long startTime,long stopTime,long visibleDuration){
  return ChildEventLeafs.iterator();
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public Iterator<TimeRangeComponent> getTraceEventsIterator(long startTime,long stopTime,long visibleDuration){
  return ChildEventLeafs.iterator();
}
Program: 92864
Project: 92864
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public TmfContext seekLocation(ITmfLocation<?> location){
  TmfContext context=null;
  try {
synchronized (fTrace) {
      fTrace.seek((location != null) ? ((TmfLocation<Long>)location).getLocation() : 0);
      context=new TmfContext(getCurrentLocation(),0);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return context;
}

Fixed version (ground truth):
@Override public TmfContext seekLocation(double ratio){
  return null;
}
Program: 92865
Project: 92865
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public Vector<TimeRangeComponent> getTraceEvents(){
  return ChildEventLeafs;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") @Deprecated public Vector<TimeRangeComponent> getTraceEvents(){
  return ChildEventLeafs;
}
Program: 92866
Project: 92866
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public TmfContext seekLocation(ITmfLocation<?> location){
  if (location == null) {
    location=new TmfLocation<Long>(0L);
  }
  if (!((TmfLocation<Long>)location).getLocation().equals(nbCharRead)) {
    skipToPosition((TmfLocation<Long>)location);
  }
  TmfContext tmpTraceContext=new TmfContext(location,0L);
  return tmpTraceContext;
}

Fixed version (ground truth):
@Override public TmfContext seekLocation(double ratio){
  return null;
}
Program: 92867
Project: 92867
Buggy source:
/** 
 * Position the trace to the event at the given location. <p> NOTE : Seeking by location is very fast compare to seeking by position but is still slower than "ReadNext", avoid using it for small interval.
 * @param location Location of the event in the trace. If no event available at this exact location, we will position ourself to the next one.
 * @return The TmfContext that point to this event
 * @see org.eclipse.linuxtools.lttng.event.LttngLocation
 * @see org.eclipse.linuxtools.tmf.trace.TmfContext
 */
@Override public synchronized TmfContext seekLocation(ITmfLocation<?> location){
  if (PrintDebug) {
    System.out.println("String_Node_Str" + location);
  }
  LttngLocation curLocation=null;
  if (location == null) {
    curLocation=new LttngLocation();
    TmfContext context=seekEvent(curLocation.getOperationTime());
    context.setRank(ITmfContext.INITIAL_RANK);
    return context;
  }
 else {
    curLocation=(LttngLocation)location;
  }
  TmfContext context=seekEvent(curLocation.getOperationTime());
  return context;
}

Fixed version (ground truth):
@Override public TmfContext seekLocation(double ratio){
  return null;
}
Program: 92868
Project: 92868
Buggy source:
/** 
 * @param path
 * @param cacheSize
 * @param indexTrace
 * @throws FileNotFoundException
 */
protected TmfTrace(String name,Class<T> type,String path,int cacheSize,boolean indexTrace) throws FileNotFoundException {
  super(name,type);
  int sep=path.lastIndexOf(File.separator);
  String simpleName=(sep >= 0) ? path.substring(sep + 1) : path;
  setName(simpleName);
  fPath=path;
  fIndexPageSize=(cacheSize > 0) ? cacheSize : DEFAULT_INDEX_PAGE_SIZE;
}

Fixed version (ground truth):
/** 
 * @param path
 * @param cacheSize
 * @param indexTrace
 * @throws FileNotFoundException
 */
protected TmfTrace(String name,Class<T> type,String path,int cacheSize,boolean indexTrace) throws FileNotFoundException {
  super(name,type);
  int sep=path.lastIndexOf(File.separator);
  String simpleName=(sep >= 0) ? path.substring(sep + 1) : path;
  setName(simpleName);
  fPath=path;
  fIndexPageSize=(cacheSize > 0) ? cacheSize : DEFAULT_INDEX_PAGE_SIZE;
  if (indexTrace) {
    indexTrace(false);
  }
}
Program: 92869
Project: 92869
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public TmfContext seekLocation(ITmfLocation<?> location){
  try {
synchronized (fTrace) {
      long loc=0;
      long rank=0;
      if (location != null) {
        loc=((TmfLocation<Long>)location).getLocation();
        rank=ITmfContext.UNKNOWN_RANK;
      }
      if (loc != fTrace.getFilePointer()) {
        fTrace.seek(loc);
      }
      TmfContext context=new TmfContext(getCurrentLocation(),rank);
      return context;
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@Override public TmfContext seekLocation(double ratio){
  try {
    ITmfLocation<?> location=new TmfLocation<Long>(new Long((long)(ratio * fTrace.length())));
    TmfContext context=seekLocation(location);
    context.setRank(ITmfContext.UNKNOWN_RANK);
    return context;
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 92870
Project: 92870
Buggy source:
@Override public TmfContext seekLocation(ITmfLocation<?> location){
  CustomTxtTraceContext context=new CustomTxtTraceContext(NULL_LOCATION,ITmfContext.INITIAL_RANK);
  if (NULL_LOCATION.equals(location) || !new File(getPath()).isFile()) {
    return context;
  }
  try {
    BufferedRandomAccessFile raFile=new BufferedRandomAccessFile(getPath(),"String_Node_Str");
    if (location != null && location.getLocation() instanceof Long) {
      raFile.seek((Long)location.getLocation());
    }
    String line;
    long rawPos=raFile.getFilePointer();
    while ((line=raFile.getNextLine()) != null) {
      for (      InputLine input : getFirstLines()) {
        Matcher matcher=input.getPattern().matcher(line);
        if (matcher.find()) {
          context.setLocation(new TmfLocation<Long>(rawPos));
          context.raFile=raFile;
          context.firstLineMatcher=matcher;
          context.firstLine=line;
          context.nextLineLocation=raFile.getFilePointer();
          context.inputLine=input;
          return context;
        }
      }
      rawPos=raFile.getFilePointer();
    }
    return context;
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    return context;
  }
catch (  IOException e) {
    e.printStackTrace();
    return context;
  }
}

Fixed version (ground truth):
@Override public TmfContext seekLocation(double ratio){
  try {
    BufferedRandomAccessFile raFile=new BufferedRandomAccessFile(getPath(),"String_Node_Str");
    ITmfLocation<?> location=new TmfLocation<Long>(new Long((long)(ratio * raFile.length())));
    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: 92871
Project: 92871
Buggy source:
@Override public TmfContext seekLocation(ITmfLocation<?> location){
  CustomXmlTraceContext context=new CustomXmlTraceContext(NULL_LOCATION,ITmfContext.INITIAL_RANK);
  if (NULL_LOCATION.equals(location) || !new File(getPath()).isFile()) {
    return context;
  }
  try {
    context.raFile=new BufferedRandomAccessFile(getPath(),"String_Node_Str");
    if (location != null && location.getLocation() instanceof Long) {
      context.raFile.seek((Long)location.getLocation());
    }
    String line;
    String recordElementStart="String_Node_Str" + fRecordInputElement.elementName;
    long rawPos=context.raFile.getFilePointer();
    while ((line=context.raFile.getNextLine()) != null) {
      int idx=line.indexOf(recordElementStart);
      if (idx != -1) {
        context.setLocation(new TmfLocation<Long>(rawPos + idx));
        return context;
      }
      rawPos=context.raFile.getFilePointer();
    }
    return context;
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    return context;
  }
catch (  IOException e) {
    e.printStackTrace();
    return context;
  }
}

Fixed version (ground truth):
@Override public TmfContext seekLocation(double ratio){
  try {
    RandomAccessFile raFile=new RandomAccessFile(getPath(),"String_Node_Str");
    ITmfLocation<?> location=new TmfLocation<Long>(new Long((long)(ratio * raFile.length())));
    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: 92872
Project: 92872
Buggy source:
@Override public TmfEventContent clone(){
  TmfEventContent clone=null;
  try {
    clone=(TmfEventContent)super.clone();
    clone.fParentEvent=fParentEvent;
    clone.fRawContent=null;
    clone.fFields=null;
  }
 catch (  CloneNotSupportedException e) {
    e.printStackTrace();
  }
  return clone;
}

Fixed version (ground truth):
@Override public TmfEventContent clone(){
  TmfEventContent clone=null;
  try {
    clone=(TmfEventContent)super.clone();
    clone.fParentEvent=fParentEvent;
    clone.fRawContent=fRawContent;
    clone.fFields=fFields;
  }
 catch (  CloneNotSupportedException e) {
    e.printStackTrace();
  }
  return clone;
}
Program: 92873
Project: 92873
Buggy source:
@Override public TmfEventReference clone(){
  TmfEventReference clone=null;
  try {
    clone=(TmfEventReference)super.clone();
    clone.fReference=null;
  }
 catch (  CloneNotSupportedException e) {
    e.printStackTrace();
  }
  return clone;
}

Fixed version (ground truth):
@Override public TmfEventReference clone(){
  TmfEventReference clone=null;
  try {
    clone=(TmfEventReference)super.clone();
    clone.fReference=fReference;
  }
 catch (  CloneNotSupportedException e) {
    e.printStackTrace();
  }
  return clone;
}
Program: 92874
Project: 92874
Buggy source:
@Override public TmfEventSource clone(){
  TmfEventSource clone=null;
  try {
    clone=(TmfEventSource)super.clone();
    clone.fSourceId=null;
  }
 catch (  CloneNotSupportedException e) {
    e.printStackTrace();
  }
  return clone;
}

Fixed version (ground truth):
@Override public TmfEventSource clone(){
  TmfEventSource clone=null;
  try {
    clone=(TmfEventSource)super.clone();
    clone.fSourceId=fSourceId;
  }
 catch (  CloneNotSupportedException e) {
    e.printStackTrace();
  }
  return clone;
}