nus-yam/ex-repair huggingface dataset:
Program: 92947
Project: 92947
Buggy source:
@SuppressWarnings("String_Node_Str") private void getSyntheticData(final TmfTimeRange range,final int nbEvents,final int blockSize){
  final Vector<TmfSyntheticEventStub> requestedEvents=new Vector<TmfSyntheticEventStub>();
  ITmfDataProvider<TmfSyntheticEventStub>[] eventProviders=(ITmfDataProvider<TmfSyntheticEventStub>[])TmfProviderManager.getProviders(TmfSyntheticEventStub.class);
  ITmfDataProvider<TmfSyntheticEventStub> provider=eventProviders[0];
  final TmfEventRequest<TmfSyntheticEventStub> request=new TmfEventRequest<TmfSyntheticEventStub>(TmfSyntheticEventStub.class,range,nbEvents,blockSize){
    @Override public void handleData(){
      TmfSyntheticEventStub[] events=getData();
      for (      TmfSyntheticEventStub e : events) {
        requestedEvents.add(e);
      }
    }
  }
;
  provider.sendRequest(request);
  request.waitForCompletion();
  if (nbEvents != -1)   assertEquals("String_Node_Str",nbEvents,requestedEvents.size());
  assertTrue("String_Node_Str",request.isCompleted());
  assertFalse("String_Node_Str",request.isCancelled());
  for (int i=0; i < (nbEvents / 2); i++) {
    assertEquals("String_Node_Str",i + 1,requestedEvents.get(2 * i + 0).getTimestamp().getValue());
    assertEquals("String_Node_Str",i + 1,requestedEvents.get(2 * i + 1).getTimestamp().getValue());
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void getSyntheticData(final TmfTimeRange range,final int nbEvents,final int blockSize) throws InterruptedException {
  final Vector<TmfSyntheticEventStub> requestedEvents=new Vector<TmfSyntheticEventStub>();
  ITmfDataProvider<TmfSyntheticEventStub>[] eventProviders=(ITmfDataProvider<TmfSyntheticEventStub>[])TmfProviderManager.getProviders(TmfSyntheticEventStub.class);
  ITmfDataProvider<TmfSyntheticEventStub> provider=eventProviders[0];
  final TmfEventRequest<TmfSyntheticEventStub> request=new TmfEventRequest<TmfSyntheticEventStub>(TmfSyntheticEventStub.class,range,nbEvents,blockSize){
    @Override public void handleData(){
      TmfSyntheticEventStub[] events=getData();
      for (      TmfSyntheticEventStub e : events) {
        requestedEvents.add(e);
      }
    }
  }
;
  provider.sendRequest(request);
  request.waitForCompletion();
  if (nbEvents != -1)   assertEquals("String_Node_Str",nbEvents,requestedEvents.size());
  assertTrue("String_Node_Str",request.isCompleted());
  assertFalse("String_Node_Str",request.isCancelled());
  for (int i=0; i < (nbEvents / 2); i++) {
    assertEquals("String_Node_Str",i + 1,requestedEvents.get(2 * i + 0).getTimestamp().getValue());
    assertEquals("String_Node_Str",i + 1,requestedEvents.get(2 * i + 1).getTimestamp().getValue());
  }
}
Program: 92948
Project: 92948
Buggy source:
@Override protected void tearDown() throws Exception {
  super.tearDown();
  fEventProvider.deregister();
  fSyntheticEventProvider.deregister();
}

Fixed version (ground truth):
@Override protected void tearDown() throws Exception {
  super.tearDown();
  fEventProvider.dispose();
  fSyntheticEventProvider.dispose();
}
Program: 92949
Project: 92949
Buggy source:
public void testGetSyntheticEvents_SmallerBlock(){
  TmfTimeRange range=new TmfTimeRange(TmfTimestamp.BigBang,TmfTimestamp.BigCrunch);
  getSyntheticData(range,1000,TmfSyntheticEventProviderStub.BLOCK_SIZE / 2);
}

Fixed version (ground truth):
public void testGetSyntheticEvents_SmallerBlock() throws InterruptedException {
  TmfTimeRange range=new TmfTimeRange(TmfTimestamp.BigBang,TmfTimestamp.BigCrunch);
  getSyntheticData(range,1000,TmfSyntheticEventProviderStub.BLOCK_SIZE / 2);
}
Program: 92950
Project: 92950
Buggy source:
@Override public ITmfContext armRequest(TmfDataRequest<TmfEvent3> request){
  return null;
}

Fixed version (ground truth):
@Override public ITmfContext armRequest(ITmfDataRequest<TmfEvent3> request){
  return null;
}
Program: 92953
Project: 92953
Buggy source:
@SuppressWarnings("String_Node_Str") public void testRegister_Unregister_1(){
  TestProvider1 testProvider1=new TestProvider1(TmfEvent.class);
  TmfDataProvider<TmfEvent>[] providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class);
  assertTrue(providers.length == 1);
  assertTrue(providers[0] == testProvider1);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider1.class);
  assertTrue(providers.length == 1);
  assertTrue(providers[0] == testProvider1);
  testProvider1.deregister();
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class);
  assertTrue(providers.length == 0);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider1.class);
  assertTrue(providers.length == 0);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void testRegister_Unregister_1(){
  TestProvider1 testProvider1=new TestProvider1(TmfEvent.class);
  TmfDataProvider<TmfEvent>[] providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class);
  assertTrue(providers.length == 1);
  assertTrue(providers[0] == testProvider1);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider1.class);
  assertTrue(providers.length == 1);
  assertTrue(providers[0] == testProvider1);
  testProvider1.dispose();
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class);
  assertTrue(providers.length == 0);
  providers=(TmfDataProvider<TmfEvent>[])TmfProviderManager.getProviders(TmfEvent.class,TestProvider1.class);
  assertTrue(providers.length == 0);
}
Program: 92954
Project: 92954
Buggy source:
@Override public boolean isCompleted(TmfDataRequest<TmfEvent3> request,TmfEvent3 data,int nbRead){
  return false;
}

Fixed version (ground truth):
@Override public boolean isCompleted(ITmfDataRequest<TmfEvent3> request,TmfEvent3 data,int nbRead){
  return false;
}
Program: 92955
Project: 92955
Buggy source:
@Override public void focusGained(FocusEvent event){
}

Fixed version (ground truth):
public void focusGained(FocusEvent event){
}
Program: 92956
Project: 92956
Buggy source:
@Override public void keyPressed(KeyEvent event){
switch (event.keyCode) {
case SWT.CR:
    handleNewStringValue();
  break;
default :
break;
}
}

Fixed version (ground truth):
public void keyPressed(KeyEvent event){
switch (event.keyCode) {
case SWT.CR:
    handleNewStringValue();
  break;
default :
break;
}
}
Program: 92957
Project: 92957
Buggy source:
@Override public void focusLost(FocusEvent event){
  handleNewStringValue();
}

Fixed version (ground truth):
public void focusLost(FocusEvent event){
  handleNewStringValue();
}
Program: 92958
Project: 92958
Buggy source:
@Override public void keyReleased(KeyEvent e){
}

Fixed version (ground truth):
public void keyReleased(KeyEvent e){
}
Program: 92959
Project: 92959
Buggy source:
public TimeTextGroup(HistogramView newParentView,Composite parent,int textStyle,int groupStyle,String groupValue,String textValue){
  Font font=parent.getFont();
  FontData tmpFontData=font.getFontData()[0];
  Font smallFont=new Font(font.getDevice(),tmpFontData.getName(),tmpFontData.getHeight(),tmpFontData.getStyle());
  parentView=newParentView;
  grpName=new Group(parent,groupStyle);
  grpName.setText(groupValue);
  grpName.setFont(smallFont);
  grpName.setLayout(new GridLayout(2,false));
  int textBoxSize=HistogramConstant.getTextSizeInControl(parent,LONGEST_STRING_VALUE);
  txtNanosec=new Text(grpName,textStyle);
  txtNanosec.setTextLimit(MAX_CHAR_IN_TEXTBOX);
  txtNanosec.setText(textValue);
  txtNanosec.setOrientation(SWT.RIGHT_TO_LEFT);
  GridData gridDataTextBox=new GridData(SWT.FILL,SWT.CENTER,true,false);
  gridDataTextBox.widthHint=textBoxSize;
  gridDataTextBox.minimumWidth=textBoxSize;
  txtNanosec.setFont(smallFont);
  txtNanosec.setLayoutData(gridDataTextBox);
  lblNanosec=new Label(grpName,SWT.LEFT);
  lblNanosec.setText(NANOSEC_LABEL);
  lblNanosec.setFont(smallFont);
  lblNanosec.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,false,false));
  addNeededListeners();
}

Fixed version (ground truth):
public TimeTextGroup(HistogramView newParentView,Composite parent,int textStyle,int groupStyle,String groupValue,String textValue){
  Font font=parent.getFont();
  FontData tmpFontData=font.getFontData()[0];
  Font smallFont=new Font(font.getDevice(),tmpFontData.getName(),tmpFontData.getHeight() - SMALL_FONT_MODIFIER,tmpFontData.getStyle());
  parentView=newParentView;
  GridLayout gridLayoutgroup=new GridLayout(2,false);
  gridLayoutgroup.horizontalSpacing=0;
  gridLayoutgroup.verticalSpacing=0;
  grpName=new Group(parent,groupStyle);
  grpName.setText(groupValue);
  grpName.setFont(smallFont);
  grpName.setLayout(gridLayoutgroup);
  int textBoxSize=HistogramConstant.getTextSizeInControl(parent,LONGEST_STRING_VALUE);
  txtNanosec=new Text(grpName,textStyle);
  txtNanosec.setTextLimit(MAX_CHAR_IN_TEXTBOX);
  txtNanosec.setText(textValue);
  txtNanosec.setFont(smallFont);
  GridData gridDataTextBox=new GridData(SWT.LEFT,SWT.CENTER,true,false);
  gridDataTextBox.horizontalIndent=10;
  gridDataTextBox.verticalIndent=0;
  gridDataTextBox.widthHint=textBoxSize;
  gridDataTextBox.minimumWidth=textBoxSize;
  txtNanosec.setLayoutData(gridDataTextBox);
  int labelSize=HistogramConstant.getTextSizeInControl(parent,NANOSEC_LABEL);
  lblNanosec=new Label(grpName,SWT.LEFT);
  lblNanosec.setText(NANOSEC_LABEL);
  lblNanosec.setFont(smallFont);
  GridData gridDataLabel=new GridData(SWT.LEFT,SWT.CENTER,false,false);
  gridDataLabel.widthHint=labelSize;
  gridDataLabel.minimumWidth=labelSize;
  gridDataLabel.horizontalIndent=10;
  gridDataLabel.verticalIndent=0;
  lblNanosec.setLayoutData(gridDataLabel);
  addNeededListeners();
}
Program: 92961
Project: 92961
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite(AllTmfCoreTests.class.getName());
  suite.addTestSuite(TmfEventProviderTest.class);
  suite.addTestSuite(TmfProviderManagerTest.class);
  suite.addTestSuite(TmfEventFieldTest.class);
  suite.addTestSuite(TmfEventContentTest.class);
  suite.addTestSuite(TmfEventTypeTest.class);
  suite.addTestSuite(TmfEventSourceTest.class);
  suite.addTestSuite(TmfTraceEventTest.class);
  suite.addTestSuite(TmfEventReferenceTest.class);
  suite.addTestSuite(TmfTimestampTest.class);
  suite.addTestSuite(TmfTimeRangeTest.class);
  suite.addTestSuite(TmfEventTest.class);
  suite.addTestSuite(TmfDataRequestTest.class);
  suite.addTestSuite(TmfEventRequestTest.class);
  suite.addTestSuite(TmfCoalescedDataRequestTest.class);
  suite.addTestSuite(TmfTraceTest.class);
  suite.addTestSuite(TmfExperimentTest.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite(AllTmfCoreTests.class.getName());
  suite.addTestSuite(TmfEventProviderTest.class);
  suite.addTestSuite(TmfProviderManagerTest.class);
  suite.addTestSuite(TmfEventFieldTest.class);
  suite.addTestSuite(TmfEventContentTest.class);
  suite.addTestSuite(TmfEventTypeTest.class);
  suite.addTestSuite(TmfEventSourceTest.class);
  suite.addTestSuite(TmfTraceEventTest.class);
  suite.addTestSuite(TmfEventReferenceTest.class);
  suite.addTestSuite(TmfTimestampTest.class);
  suite.addTestSuite(TmfTimeRangeTest.class);
  suite.addTestSuite(TmfEventTest.class);
  suite.addTestSuite(TmfDataRequestTest.class);
  suite.addTestSuite(TmfEventRequestTest.class);
  suite.addTestSuite(TmfCoalescedDataRequestTest.class);
  suite.addTestSuite(TmfCoalescedEventRequestTest.class);
  suite.addTestSuite(TmfTraceTest.class);
  suite.addTestSuite(TmfExperimentTest.class);
  suite.addTestSuite(TmfMultiTraceExperimentTest.class);
  return suite;
}
Program: 92962
Project: 92962
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str" + TmfCorePlugin.PLUGIN_ID + "String_Node_Str");
  suite.addTestSuite(TmfDataRequestTest.class);
  suite.addTestSuite(TmfEventRequestTest.class);
  suite.addTestSuite(TmfCoalescedDataRequestTest.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str" + TmfCorePlugin.PLUGIN_ID + "String_Node_Str");
  suite.addTestSuite(TmfDataRequestTest.class);
  suite.addTestSuite(TmfEventRequestTest.class);
  suite.addTestSuite(TmfCoalescedDataRequestTest.class);
  suite.addTestSuite(TmfCoalescedEventRequestTest.class);
  return suite;
}
Program: 92963
Project: 92963
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str" + TmfCorePlugin.PLUGIN_ID + "String_Node_Str");
  suite.addTestSuite(TmfTraceTest.class);
  suite.addTestSuite(TmfExperimentTest.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str" + TmfCorePlugin.PLUGIN_ID + "String_Node_Str");
  suite.addTestSuite(TmfTraceTest.class);
  suite.addTestSuite(TmfExperimentTest.class);
  suite.addTestSuite(TmfMultiTraceExperimentTest.class);
  return suite;
}
Program: 92964
Project: 92964
Buggy source:
private void setupExperiment(){
  if (fExperiment == null) {
    fExperiment=new TmfExperiment<TmfEvent>(TmfEvent.class,EXPERIMENT,new ITmfTrace[]{fTrace});
    fExperiment.indexExperiment(true);
  }
}

Fixed version (ground truth):
private void setupExperiment(){
  if (fExperiment == null) {
    fExperiment=new TmfExperiment<TmfEvent>(TmfEvent.class,EXPERIMENT,fTrace);
    fExperiment.indexExperiment(true);
  }
}
Program: 92965
Project: 92965
Buggy source:
private ITmfTrace setupTrace(String path){
  if (fTrace == null) {
    try {
      URL location=FileLocator.find(TmfCoreTestPlugin.getPlugin().getBundle(),new Path(path),null);
      File test=new File(FileLocator.toFileURL(location).toURI());
      TmfTraceStub trace=new TmfTraceStub(test.getPath(),true);
      fTrace=trace;
    }
 catch (    URISyntaxException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
  }
  return fTrace;
}

Fixed version (ground truth):
private ITmfTrace[] setupTrace(String path){
  if (fTrace == null) {
    fTrace=new ITmfTrace[1];
    try {
      URL location=FileLocator.find(TmfCoreTestPlugin.getPlugin().getBundle(),new Path(path),null);
      File test=new File(FileLocator.toFileURL(location).toURI());
      TmfTraceStub trace=new TmfTraceStub(test.getPath(),true);
      fTrace[0]=trace;
    }
 catch (    URISyntaxException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
  }
  return fTrace;
}
Program: 92966
Project: 92966
Buggy source:
/** 
 * Method to convert a JniEvent into a LttngEvent
 * @param jniEvent        The JniEvent to convert into LttngEvent
 * @param isParsingNeeded A boolean value telling if the event should be parsed or not.
 * @return  The converted LttngEvent
 * @see org.eclipse.linuxtools.org.eclipse.linuxtools.lttng.jni.JniEvent
 * @see org.eclipse.linuxtools.lttng.event.LttngEvent
 */
public LttngEvent convertJniEventToTmf(JniEvent jniEvent,boolean isParsingNeeded){
  eventTimestamp.setValue(jniEvent.getEventTime().getTime());
  eventSource.setSourceId(jniEvent.requestEventSource());
  eventType=traceTypes.get(EventTypeKey.getEventTypeKey(jniEvent));
  eventReference.setValue(jniEvent.getParentTracefile().getTracefilePath());
  eventReference.setTracepath(this.getName());
  eventContent.emptyContent();
  currentLttngEvent.setType(eventType);
  currentLttngEvent.updateJniEventReference(jniEvent);
  if (isParsingNeeded == true) {
    eventContent.getFields();
  }
  return currentLttngEvent;
}

Fixed version (ground truth):
/** 
 * Method to convert a JniEvent into a LttngEvent
 * @param jniEvent        The JniEvent to convert into LttngEvent
 * @param isParsingNeeded A boolean value telling if the event should be parsed or not.
 * @return  The converted LttngEvent
 * @see org.eclipse.linuxtools.org.eclipse.linuxtools.lttng.jni.JniEvent
 * @see org.eclipse.linuxtools.lttng.event.LttngEvent
 */
public LttngEvent convertJniEventToTmf(JniEvent jniEvent,boolean isParsingNeeded){
  if (uniqueEvent == true) {
    eventTimestamp.setValue(jniEvent.getEventTime().getTime());
    eventSource.setSourceId(jniEvent.requestEventSource());
    eventType=traceTypes.get(EventTypeKey.getEventTypeKey(jniEvent));
    eventReference.setValue(jniEvent.getParentTracefile().getTracefilePath());
    eventReference.setTracepath(this.getName());
    eventContent.emptyContent();
    currentLttngEvent.setType(eventType);
    currentLttngEvent.updateJniEventReference(jniEvent);
    if (isParsingNeeded == true) {
      eventContent.getFields();
    }
    return currentLttngEvent;
  }
 else {
    return convertJniEventToTmfMultipleEventEvilFix(jniEvent);
  }
}
Program: 92967
Project: 92967
Buggy source:
/** 
 * @return
 */
public LTTngTraceNode[] getTraces(){
  return (LTTngTraceNode[])fChildren.toArray();
}

Fixed version (ground truth):
/** 
 * @return
 */
public LTTngTraceNode[] getTraces(){
  LTTngTraceNode[] result=(LTTngTraceNode[])Array.newInstance(LTTngTraceNode.class,fChildren.size());
  return fChildren.toArray(result);
}
Program: 92968
Project: 92968
Buggy source:
public boolean isEnabled(){
  IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  if (window == null)   return false;
  ISelection selection=window.getActivePage().getSelection(ProjectView.ID);
  if (selection instanceof StructuredSelection) {
    Object element=((StructuredSelection)selection).getFirstElement();
    if (element instanceof ILTTngProjectTreeNode) {
      ILTTngProjectTreeNode node=(ILTTngProjectTreeNode)element;
      while (node != null && !(node instanceof LTTngProjectRoot)) {
        node=node.getParent();
      }
      fProjectRoot=(node instanceof LTTngProjectRoot) ? (LTTngProjectRoot)node : null;
    }
  }
  return (fProjectRoot != null);
}

Fixed version (ground truth):
public boolean isEnabled(){
  IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  if (window == null)   return false;
  IWorkbenchPart part=window.getActivePage().getActivePart();
  if (!(part instanceof ProjectView))   return false;
  fProjectRoot=((ProjectView)part).getRoot();
  return (fProjectRoot != null);
}
Program: 92971
Project: 92971
Buggy source:
public void testGetter(){
  LTTngTextTrace tmpStream=initializeEventStream();
  LttngEventField testField=(LttngEventField)tmpStream.getNextEvent(new TmfTraceContext(0,new LttngTimestamp(0L),0)).getContent().getField(0);
  assertNotSame("String_Node_Str",null,testField);
  assertTrue("String_Node_Str",firstEventName.equals(testField.getId().toString()));
  assertTrue("String_Node_Str",firstEventValue.equals(testField.getValue().toString()));
}

Fixed version (ground truth):
public void testGetter(){
  LTTngTextTrace tmpStream=initializeEventStream();
  LttngEventField testField=(LttngEventField)tmpStream.getNextEvent(new TmfTraceContext(0,new LttngTimestamp(0L),0)).getContent().getField(0);
  assertNotSame("String_Node_Str",null,testField);
  assertNotSame("String_Node_Str",null,testField.getId());
  assertTrue("String_Node_Str",firstEventValue.equals(testField.getValue().toString()));
}
Program: 92972
Project: 92972
Buggy source:
public void testGetter(){
  LttngEvent testEvent=prepareToTest();
  assertEquals("String_Node_Str",eventTimestamp,testEvent.getTimestamp().getValue());
  assertEquals("String_Node_Str",eventSource,testEvent.getSource().getSourceId());
  assertEquals("String_Node_Str",eventReference,((String)testEvent.getReference().toString()));
  assertEquals("String_Node_Str",eventType,testEvent.getType().getTypeId());
  assertEquals("String_Node_Str",eventChannel,testEvent.getChannelName());
  assertEquals("String_Node_Str",eventCpu,testEvent.getCpuId());
  assertEquals("String_Node_Str",eventMarker,testEvent.getMarkerName());
  assertEquals("String_Node_Str",eventContent,testEvent.getContent().toString());
}

Fixed version (ground truth):
public void testGetter(){
  LttngEvent testEvent=prepareToTest();
  assertEquals("String_Node_Str",eventTimestamp,testEvent.getTimestamp().getValue());
  assertEquals("String_Node_Str",eventSource,testEvent.getSource().getSourceId());
  assertEquals("String_Node_Str",eventReference,((String)testEvent.getReference().toString()));
  assertEquals("String_Node_Str",eventType,testEvent.getType().getTypeId());
  assertEquals("String_Node_Str",eventChannel,testEvent.getChannelName());
  assertEquals("String_Node_Str",eventCpu,testEvent.getCpuId());
  assertEquals("String_Node_Str",eventMarker,testEvent.getMarkerName());
  assertNotSame("String_Node_Str",null,testEvent.getContent());
}
Program: 92973
Project: 92973
Buggy source:
public void testConstructors(){
  LttngEvent testEvent=null;
  LttngEventContent testContent=null;
  LttngEventContent testContent2=null;
  LttngEventField[] testFields=new LttngEventField[1];
  testFields[0]=new LttngEventField(testContent2,"String_Node_Str");
  try {
    testContent=new LttngEventContent();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
  try {
    testContent=new LttngEventContent(testEvent);
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
  try {
    testContent=new LttngEventContent(testEvent);
    testContent2=new LttngEventContent(testContent);
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
public void testConstructors(){
  LttngEvent testEvent=null;
  LttngEventContent testContent=null;
  LttngEventContent testContent2=null;
  LttngEventField[] testFields=new LttngEventField[1];
  testFields[0]=new LttngEventField(testContent2,"String_Node_Str");
  try {
    testContent=new LttngEventContent();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
  try {
    testContent=new LttngEventContent(testEvent);
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
  try {
    HashMap<String,LttngEventField> parsedContent=new HashMap<String,LttngEventField>();
    testContent=new LttngEventContent(testEvent,parsedContent);
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
  try {
    testContent=new LttngEventContent(testEvent);
    testContent2=new LttngEventContent(testContent);
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
}
Program: 92974
Project: 92974
Buggy source:
private LTTngTextTrace initializeEventStream(){
  if (testStream == null) {
    try {
      URL location=FileLocator.find(LTTngCoreTestPlugin.getPlugin().getBundle(),new Path(tracepath1),null);
      File testfile=new File(FileLocator.toFileURL(location).toURI());
      LTTngTextTrace tmpStream=new LTTngTextTrace(testfile.getPath(),skipIndexing);
      testStream=tmpStream;
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str" + tracepath1);
      testStream=null;
    }
  }
  return testStream;
}

Fixed version (ground truth):
private LTTngTextTrace initializeEventStream(){
  if (testStream == null) {
    try {
      URL location=FileLocator.find(LTTngCoreTestPlugin.getPlugin().getBundle(),new Path(tracepath1),null);
      File testfile=new File(FileLocator.toFileURL(location).toURI());
      LTTngTextTrace tmpStream=new LTTngTextTrace(testfile.getPath());
      testStream=tmpStream;
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str" + tracepath1);
      testStream=null;
    }
  }
  return testStream;
}
Program: 92975
Project: 92975
Buggy source:
private LttngEventContent prepareToTest(){
  LttngEventContent tmpEventContent=null;
  try {
    LTTngTextTrace tmpStream=initializeEventStream();
    tmpEventContent=(LttngEventContent)tmpStream.getNextEvent(new TmfTraceContext(0L,new LttngTimestamp(0L),0)).getContent();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
  return tmpEventContent;
}

Fixed version (ground truth):
private LttngEventContent prepareToTest(){
  LttngEventContent tmpEventContent=null;
  try {
    testStream=null;
    LTTngTextTrace tmpStream=initializeEventStream();
    tmpEventContent=(LttngEventContent)tmpStream.getNextEvent(new TmfTraceContext(0L,new LttngTimestamp(0L),0)).getContent();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
  return tmpEventContent;
}
Program: 92976
Project: 92976
Buggy source:
public void testConstructors(){
  LttngEventReference testRef=null;
  @SuppressWarnings("String_Node_Str") LttngEventReference testRef2=null;
  try {
    testRef=new LttngEventReference("String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
  try {
    testRef=new LttngEventReference("String_Node_Str","String_Node_Str");
    testRef2=new LttngEventReference(testRef);
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
public void testConstructors(){
  LttngEventReference testRef=null;
  @SuppressWarnings("String_Node_Str") LttngEventReference testRef2=null;
  try {
    testRef=new LttngEventReference("String_Node_Str");
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
  try {
    testRef=new LttngEventReference("String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
  try {
    testRef=new LttngEventReference("String_Node_Str","String_Node_Str");
    testRef2=new LttngEventReference(testRef);
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
}
Program: 92977
Project: 92977
Buggy source:
@Override public TmfTraceContext seekLocation(Object location){
  if (location == null) {
    location=0L;
  }
  TmfTraceContext tmpTraceContext=new TmfTraceContext(nbCharRead,(LttngTimestamp)currentLttngEvent.getTimestamp(),0L);
  Long previousCharRead=nbCharRead;
  Long previousTimestamp=currentLttngEvent.getTimestamp().getValue();
  Long tmploc=(Long)location;
  if (showDebug == true) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + (LttngTimestamp)currentLttngEvent.getTimestamp());
    System.out.println("String_Node_Str" + nbCharRead);
    System.out.println("String_Node_Str" + location);
    System.out.println();
  }
  if (tmploc < nbCharRead) {
    skipToPosition(tmploc);
  }
  if (tmploc > nbCharRead) {
    while (tmploc > nbCharRead) {
      previousCharRead=nbCharRead;
      previousTimestamp=currentLttngEvent.getTimestamp().getValue();
      getNextEvent(tmpTraceContext);
    }
  }
  tmpTraceContext.setTimestamp(new LttngTimestamp(previousTimestamp));
  tmpTraceContext.setLocation(previousCharRead);
  return tmpTraceContext;
}

Fixed version (ground truth):
public TmfTraceContext seekLocation(Object location){
  if (location == null) {
    location=0L;
  }
  TmfTraceContext tmpTraceContext=new TmfTraceContext(nbCharRead,(LttngTimestamp)currentLttngEvent.getTimestamp(),0L);
  Long previousCharRead=nbCharRead;
  Long previousTimestamp=currentLttngEvent.getTimestamp().getValue();
  Long tmploc=(Long)location;
  if (showDebug == true) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + (LttngTimestamp)currentLttngEvent.getTimestamp());
    System.out.println("String_Node_Str" + nbCharRead);
    System.out.println("String_Node_Str" + location);
    System.out.println();
  }
  if (tmploc < nbCharRead) {
    skipToPosition(tmploc);
  }
  if (tmploc > nbCharRead) {
    while (tmploc > nbCharRead) {
      previousCharRead=nbCharRead;
      previousTimestamp=currentLttngEvent.getTimestamp().getValue();
      getNextEvent(tmpTraceContext);
    }
  }
  tmpTraceContext.setTimestamp(new LttngTimestamp(previousTimestamp));
  tmpTraceContext.setLocation(previousCharRead);
  return tmpTraceContext;
}
Program: 92978
Project: 92978
Buggy source:
public TmfTraceContext seekLocation(Object location){
  if (location == null) {
    location=0L;
  }
  TmfTraceContext tmpTraceContext=new TmfTraceContext(nbCharRead,(LttngTimestamp)currentLttngEvent.getTimestamp(),0L);
  Long previousCharRead=nbCharRead;
  Long previousTimestamp=currentLttngEvent.getTimestamp().getValue();
  Long tmploc=(Long)location;
  if (showDebug == true) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + (LttngTimestamp)currentLttngEvent.getTimestamp());
    System.out.println("String_Node_Str" + nbCharRead);
    System.out.println("String_Node_Str" + location);
    System.out.println();
  }
  if (tmploc < nbCharRead) {
    skipToPosition(tmploc);
  }
  if (tmploc > nbCharRead) {
    while (tmploc > nbCharRead) {
      previousCharRead=nbCharRead;
      previousTimestamp=currentLttngEvent.getTimestamp().getValue();
      getNextEvent(tmpTraceContext);
    }
  }
  tmpTraceContext.setTimestamp(new LttngTimestamp(previousTimestamp));
  tmpTraceContext.setLocation(previousCharRead);
  return tmpTraceContext;
}

Fixed version (ground truth):
@Override public TmfTraceContext seekLocation(Object location){
  if (location == null) {
    location=0L;
  }
  TmfTraceContext tmpTraceContext=new TmfTraceContext(nbCharRead,(LttngTimestamp)currentLttngEvent.getTimestamp(),0L);
  Long previousCharRead=nbCharRead;
  Long previousTimestamp=currentLttngEvent.getTimestamp().getValue();
  Long tmploc=(Long)location;
  if (showDebug == true) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + (LttngTimestamp)currentLttngEvent.getTimestamp());
    System.out.println("String_Node_Str" + nbCharRead);
    System.out.println("String_Node_Str" + location);
    System.out.println();
  }
  if (tmploc < nbCharRead) {
    skipToPosition(tmploc);
  }
  if (tmploc > nbCharRead) {
    while (tmploc > nbCharRead) {
      previousCharRead=nbCharRead;
      previousTimestamp=currentLttngEvent.getTimestamp().getValue();
      getNextEvent(tmpTraceContext);
    }
  }
  tmpTraceContext.setTimestamp(new LttngTimestamp(previousTimestamp));
  tmpTraceContext.setLocation(previousCharRead);
  return tmpTraceContext;
}
Program: 92980
Project: 92980
Buggy source:
public TmfEvent peekEvent(TmfTraceContext context){
  TmfTraceContext ctx=new TmfTraceContext(context);
  return getNextEvent(ctx);
}

Fixed version (ground truth):
public TmfEvent peekEvent(TmfTraceContext context){
  TmfTraceContext ctx=new TmfTraceContext(context);
  TmfEvent event=getNextEvent(ctx);
  seekLocation(context.location);
  return event;
}
Program: 92981
Project: 92981
Buggy source:
static public synchronized void dispatchSignal(Object signal){
  Class<?> signalClass=signal.getClass();
  Map<Object,List<Method>> listeners=new HashMap<Object,List<Method>>();
  listeners.clear();
  for (  Map.Entry<Object,Method[]> entry : fListeners.entrySet()) {
    List<Method> matchingMethods=new ArrayList<Method>();
    for (    Method method : entry.getValue()) {
      if (method.getParameterTypes()[0].isAssignableFrom(signalClass)) {
        matchingMethods.add(method);
      }
    }
    if (!matchingMethods.isEmpty()) {
      listeners.put(entry.getKey(),matchingMethods);
    }
  }
  for (  Map.Entry<Object,List<Method>> entry : listeners.entrySet()) {
    for (    Method method : entry.getValue()) {
      getInstance().dispatch(method,entry.getKey(),signal);
    }
  }
}

Fixed version (ground truth):
/** 
 * Invokes the handling methods that expect this signal. The list of handlers is built on-the-fly to allow for the dynamic creation/deletion of signal handlers. Since the number of signal handlers shouldn't be too high, this is not a big performance issue to pay for the flexibility.
 * @param signal
 */
static public synchronized void dispatchSignal(Object signal){
  Class<?> signalClass=signal.getClass();
  Map<Object,List<Method>> listeners=new HashMap<Object,List<Method>>();
  listeners.clear();
  for (  Map.Entry<Object,Method[]> entry : fListeners.entrySet()) {
    List<Method> matchingMethods=new ArrayList<Method>();
    for (    Method method : entry.getValue()) {
      if (method.getParameterTypes()[0].isAssignableFrom(signalClass)) {
        matchingMethods.add(method);
      }
    }
    if (!matchingMethods.isEmpty()) {
      listeners.put(entry.getKey(),matchingMethods);
    }
  }
  for (  Map.Entry<Object,List<Method>> entry : listeners.entrySet()) {
    for (    Method method : entry.getValue()) {
      try {
        method.invoke(entry.getKey(),new Object[]{signal});
      }
 catch (      IllegalArgumentException e) {
        e.printStackTrace();
      }
catch (      IllegalAccessException e) {
        e.printStackTrace();
      }
catch (      InvocationTargetException e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 92982
Project: 92982
Buggy source:
private synchronized void notifyListeners(){
  TmfSignalManager.dispatchSignal(new TmfStreamUpdatedSignal(this,this));
}

Fixed version (ground truth):
private void notifyListeners(){
  TmfSignalManager.dispatchSignal(new TmfStreamUpdatedSignal(this,this));
}
Program: 92983
Project: 92983
Buggy source:
public void removeWidgetTimeScaleSelectionListner(ITmfTimeScaleSelectionListener listener);

Fixed version (ground truth):
public void removeWidgetTimeScaleSelectionListner(ITmfTimeTimeScaleSelectionListener listener);
Program: 92984
Project: 92984
Buggy source:
public void addWidgetTimeScaleSelectionListner(ITmfTimeScaleSelectionListener listener);

Fixed version (ground truth):
public void addWidgetTimeScaleSelectionListner(ITmfTimeTimeScaleSelectionListener listener);
Program: 92985
Project: 92985
Buggy source:
/** 
 * Provides the image icon for a given Event or Trace e.g. customize to use different icons according to specific event /state combination
 * @param obj
 * @return
 */
public Image getItemImage(Object obj){
  return null;
}

Fixed version (ground truth):
/** 
 * Provides the image icon for a given Event or Trace e.g. customize to use different icons according to specific event /state combination
 * @param obj
 * @return
 */
public Image getItemImage(Object obj){
  if (obj instanceof ITmfTimeAnalysisEntry) {
    List<TimeEvent> list=((ITmfTimeAnalysisEntry)obj).getTraceEvents();
    if (null != list && list.size() > 0)     obj=list.get(list.size() - 1);
 else     if (((ITmfTimeAnalysisEntry)obj).getStopTime() > 0)     return getImage(IMG_THREAD_STOPPED);
 else     return getImage(IMG_THREAD_RUNNING);
  }
  if (obj instanceof TimeEvent) {
    return getImage(IMG_THREAD_RUNNING);
  }
  return null;
}
Program: 92986
Project: 92986
Buggy source:
public static Test suite(){
  TestSuite ats=new TestSuite("String_Node_Str");
  File[] testDirs=STJunitUtils.getTestDirs("String_Node_Str","String_Node_Str" + GMON_DIRECTORY_SUFFIX);
  for (  File testDir : testDirs) {
    final File logFile=new File(testDir,GMON_OUTPUT_FILE);
    final File binaryFile=new File(testDir,GMON_BINARY_FILE);
    final File parserRefFile=new File(testDir,"String_Node_Str");
    final File parserDumpFile=new File(testDir,"String_Node_Str");
    ats.addTest(new TestCase(testDir.getName() + "String_Node_Str"){
      public void runTest() throws Throwable {
        testProcessGmonFile(logFile,binaryFile,parserRefFile,parserRefFile);
      }
    }
);
  }
  return ats;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite ats=new TestSuite("String_Node_Str");
  File[] testDirs=STJunitUtils.getTestDirs("String_Node_Str","String_Node_Str" + GMON_DIRECTORY_SUFFIX);
  for (  File testDir : testDirs) {
    final File logFile=new File(testDir,GMON_OUTPUT_FILE);
    final File binaryFile=new File(testDir,GMON_BINARY_FILE);
    final File parserRefFile=new File(testDir,"String_Node_Str");
    final File parserDumpFile=new File(testDir,"String_Node_Str");
    ats.addTest(new TestCase(testDir.getName() + "String_Node_Str"){
      public void runTest() throws Throwable {
        testProcessGmonFile(logFile,binaryFile,parserRefFile,parserDumpFile);
      }
    }
);
  }
  return ats;
}
Program: 92987
Project: 92987
Buggy source:
public static void testProcessGmonFile(File gmonFile,File binaryFile,File parserRefFile,File parserDumpFile) throws Exception {
  IBinaryObject binary=STSymbolManager.sharedInstance.getBinaryObject(binaryFile.getAbsolutePath());
  final GmonDecoder gmondecoder=new GmonDecoder(binary,new PrintStream(parserRefFile));
  gmondecoder.setShouldDump(true);
  gmondecoder.read(gmonFile.getAbsolutePath());
  STJunitUtils.compareIgnoreEOL(parserDumpFile.getAbsolutePath(),parserRefFile.getAbsolutePath(),true);
}

Fixed version (ground truth):
public static void testProcessGmonFile(File gmonFile,File binaryFile,File parserRefFile,File parserDumpFile) throws Exception {
  IBinaryObject binary=STSymbolManager.sharedInstance.getBinaryObject(binaryFile.getAbsolutePath());
  final GmonDecoder gmondecoder=new GmonDecoder(binary,new PrintStream(parserDumpFile));
  gmondecoder.setShouldDump(true);
  gmondecoder.read(gmonFile.getAbsolutePath());
  STJunitUtils.compareIgnoreEOL(parserDumpFile.getAbsolutePath(),parserRefFile.getAbsolutePath(),true);
}
Program: 92988
Project: 92988
Buggy source:
public void runTest() throws Throwable {
  testProcessGmonFile(logFile,binaryFile,parserRefFile,parserRefFile);
}

Fixed version (ground truth):
public void runTest() throws Throwable {
  testProcessGmonFile(logFile,binaryFile,parserRefFile,parserDumpFile);
}
Program: 92989
Project: 92989
Buggy source:
/** 
 * Kick off creating the UI model from the data model. Meant to  be called from UI code. The refreshModel() method is called for  the child elements from their constructor.
 */
public void refreshModel(){
  OpModelEvent dataModelEvents[]=getModelDataEvents();
  if (dataModelEvents == null || dataModelEvents.length == 0) {
    _rootError=UiModelError.NO_SAMPLES_ERROR;
  }
 else {
    _events=new UiModelEvent[dataModelEvents.length];
    for (int i=0; i < dataModelEvents.length; i++) {
      _events[i]=new UiModelEvent(dataModelEvents[i]);
    }
  }
}

Fixed version (ground truth):
/** 
 * Kick off creating the UI model from the data model. Meant to  be called from UI code. The refreshModel() method is called for  the child elements from their constructor.
 */
public void refreshModel(){
  OpModelEvent dataModelEvents[]=getModelDataEvents();
  if (dataModelEvents == null || dataModelEvents.length == 0) {
    _rootError=UiModelError.NO_SAMPLES_ERROR;
    _events=null;
  }
 else {
    _rootError=null;
    _events=new UiModelEvent[dataModelEvents.length];
    for (int i=0; i < dataModelEvents.length; i++) {
      _events[i]=new UiModelEvent(dataModelEvents[i]);
    }
  }
}
Program: 92990
Project: 92990
Buggy source:
@Override public void run(){
  boolean defaultSessionExists=false;
  UiModelRoot modelRoot=UiModelRoot.getDefault();
  if (modelRoot.hasChildren()) {
    IUiModelElement[] events=modelRoot.getChildren();
    for (    IUiModelElement e : events) {
      IUiModelElement[] sessions=e.getChildren();
      for (      IUiModelElement s : sessions) {
        if (((UiModelSession)s).isDefaultSession()) {
          defaultSessionExists=true;
          break;
        }
      }
      if (defaultSessionExists)       break;
    }
  }
  if (defaultSessionExists) {
    InputDialog dialog=new InputDialog(OprofileUiPlugin.getActiveWorkbenchShell(),OprofileUiMessages.getString("String_Node_Str"),OprofileUiMessages.getString("String_Node_Str"),OprofileUiMessages.getString("String_Node_Str"),new SaveSessionValidator());
    int result=dialog.open();
    if (result == Window.OK) {
      try {
        OprofileCorePlugin.getDefault().getOpcontrolProvider().saveSession(dialog.getValue());
        OprofileUiPlugin.getDefault().getOprofileView().refreshView();
      }
 catch (      OpcontrolException oe) {
        OprofileCorePlugin.showErrorDialog("String_Node_Str",oe);
      }
    }
  }
 else {
    MessageDialog.openError(OprofileUiPlugin.getActiveWorkbenchShell(),OprofileUiMessages.getString("String_Node_Str"),OprofileUiMessages.getString("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void run(){
  boolean defaultSessionExists=false;
  UiModelRoot modelRoot=UiModelRoot.getDefault();
  if (modelRoot.hasChildren()) {
    IUiModelElement[] events=modelRoot.getChildren();
    for (    IUiModelElement e : events) {
      if (e instanceof UiModelError)       break;
      IUiModelElement[] sessions=e.getChildren();
      for (      IUiModelElement s : sessions) {
        if (((UiModelSession)s).isDefaultSession()) {
          defaultSessionExists=true;
          break;
        }
      }
      if (defaultSessionExists)       break;
    }
  }
  if (defaultSessionExists) {
    InputDialog dialog=new InputDialog(OprofileUiPlugin.getActiveWorkbenchShell(),OprofileUiMessages.getString("String_Node_Str"),OprofileUiMessages.getString("String_Node_Str"),OprofileUiMessages.getString("String_Node_Str"),new SaveSessionValidator());
    int result=dialog.open();
    if (result == Window.OK) {
      try {
        OprofileCorePlugin.getDefault().getOpcontrolProvider().saveSession(dialog.getValue());
        OprofileUiPlugin.getDefault().getOprofileView().refreshView();
      }
 catch (      OpcontrolException oe) {
        OprofileCorePlugin.showErrorDialog("String_Node_Str",oe);
      }
    }
  }
 else {
    MessageDialog.openError(OprofileUiPlugin.getActiveWorkbenchShell(),OprofileUiMessages.getString("String_Node_Str"),OprofileUiMessages.getString("String_Node_Str"));
  }
}
Program: 92991
Project: 92991
Buggy source:
private static void _initializeOprofileCore(){
  _info=OpInfo.getInfo();
}

Fixed version (ground truth):
private static void _initializeOprofileCore(){
  _info=OpInfo.getInfo();
  if (_info == null) {
    throw new ExceptionInInitializerError(OprofileProperties.getString("String_Node_Str"));
  }
}
Program: 92992
Project: 92992
Buggy source:
/** 
 * Return all of Oprofile's generic information.
 * @return a class containing the information
 */
public static OpInfo getInfo(){
  OpInfo info=new OpInfo();
  try {
    IRunnableWithProgress opxml=OprofileCorePlugin.getDefault().getOpxmlProvider().info(info);
    opxml.run(null);
  }
 catch (  InvocationTargetException e) {
  }
catch (  InterruptedException e) {
  }
catch (  OpxmlException e) {
    OprofileCorePlugin.showErrorDialog("String_Node_Str",e);
  }
  return info;
}

Fixed version (ground truth):
/** 
 * Return all of Oprofile's generic information.
 * @return a class containing the information
 */
public static OpInfo getInfo(){
  OpInfo info=new OpInfo();
  try {
    OpInfoRunner opxml=(OpInfoRunner)OprofileCorePlugin.getDefault().getOpxmlProvider().info(info);
    boolean ret=opxml.run0(null);
    if (ret == false)     info=null;
  }
 catch (  InvocationTargetException e) {
  }
catch (  InterruptedException e) {
  }
catch (  OpxmlException e) {
    OprofileCorePlugin.showErrorDialog("String_Node_Str",e);
  }
  return info;
}
Program: 92993
Project: 92993
Buggy source:
public IRunnableWithProgress info(final OpInfo info){
  IRunnableWithProgress runnable=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      OpxmlRunner runner=new OpxmlRunner(_pathToOpxml);
      String[] args=new String[]{OpxmlConstants.OPXML_INFO};
      runner.run(args,info);
    }
  }
;
  return runnable;
}

Fixed version (ground truth):
public IRunnableWithProgress info(final OpInfo info){
  return new OpInfoRunner(info);
}
Program: 92994
Project: 92994
Buggy source:
/** 
 * Runs opxml with the given arguments.
 * @param args the arguments to pass to opxml
 * @param callData any callData to pass to the processor
 * @return boolean indicating the success/failure of opxml
 * @throws OpxmlException 
 */
public boolean run(String[] args,Object callData){
  XMLReader reader=null;
  _handler=OprofileSAXHandler.getInstance(callData);
  SAXParserFactory factory=SAXParserFactory.newInstance();
  try {
    reader=factory.newSAXParser().getXMLReader();
  }
 catch (  Exception e) {
    e.printStackTrace();
    return false;
  }
  reader.setContentHandler(_handler);
  reader.setErrorHandler(_handler);
  String[] cmdArray=new String[args.length + 1];
  cmdArray[0]=_pathToOpxml;
  System.arraycopy(args,0,cmdArray,1,args.length);
  try {
    Process p=Runtime.getRuntime().exec(cmdArray);
    BufferedReader bi=new BufferedReader(new InputStreamReader(p.getInputStream()));
    reader.parse(new InputSource(bi));
    if (p.waitFor() != 0) {
      return false;
    }
    return true;
  }
 catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
    OprofileCorePlugin.showErrorDialog("String_Node_Str",null);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Runs opxml with the given arguments.
 * @param args the arguments to pass to opxml
 * @param callData any callData to pass to the processor
 * @return boolean indicating the success/failure of opxml
 * @throws OpxmlException 
 */
public boolean run(String[] args,Object callData){
  XMLReader reader=null;
  _handler=OprofileSAXHandler.getInstance(callData);
  SAXParserFactory factory=SAXParserFactory.newInstance();
  try {
    reader=factory.newSAXParser().getXMLReader();
  }
 catch (  Exception e) {
    e.printStackTrace();
    return false;
  }
  reader.setContentHandler(_handler);
  reader.setErrorHandler(_handler);
  String[] cmdArray=new String[args.length + 1];
  cmdArray[0]=_pathToOpxml;
  System.arraycopy(args,0,cmdArray,1,args.length);
  try {
    Process p=Runtime.getRuntime().exec(cmdArray);
    BufferedReader bi=new BufferedReader(new InputStreamReader(p.getInputStream()));
    reader.parse(new InputSource(bi));
    int ret=p.waitFor();
    if (ret != 0) {
      return false;
    }
    return true;
  }
 catch (  SAXException e) {
    OprofileCorePlugin.showErrorDialog("String_Node_Str",null);
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
    OprofileCorePlugin.showErrorDialog("String_Node_Str",null);
  }
  return false;
}
Program: 92996
Project: 92996
Buggy source:
public void endElement(String name,Object callData){
  if (name.equals(IMAGE_TAG)) {
  }
 else   if (name.equals(SYMBOLS_TAG)) {
    _image._setSymbols(_symbolsProcessor.getSymbols());
  }
 else   if (name.equals(DEPENDENT_TAG)) {
    _image._setDependents(_dependentProcessor.getImages());
  }
 else {
    super.endElement(name,callData);
  }
}

Fixed version (ground truth):
public void endElement(String name,Object callData){
  if (name.equals(IMAGE_TAG)) {
    if (img_seen > 1) {
      _image._setCount(OpModelImage.IMAGE_PARSE_ERROR);
      _image._setDepCount(0);
      _image._setDependents(null);
      _image._setSymbols(null);
      _image._setName("String_Node_Str");
    }
  }
 else   if (name.equals(SYMBOLS_TAG)) {
    _image._setSymbols(_symbolsProcessor.getSymbols());
  }
 else   if (name.equals(DEPENDENT_TAG)) {
    _image._setDependents(_dependentProcessor.getImages());
  }
 else {
    super.endElement(name,callData);
  }
}
Program: 92997
Project: 92997
Buggy source:
public void startElement(String name,Attributes attrs,Object callData){
  if (name.equals(IMAGE_TAG)) {
    if (!parsing_image) {
      _image._setName(attrs.getValue(ATTR_IMAGENAME));
      _image._setCount(Integer.parseInt(attrs.getValue(ATTR_COUNT)));
      parsing_image=true;
    }
 else {
      _image._setCount(OpModelImage.IMAGE_PARSE_ERROR);
      _image._setDepCount(0);
      _image._setDependents(null);
      _image._setSymbols(null);
      _image._setName("String_Node_Str");
    }
  }
 else   if (name.equals(SYMBOLS_TAG)) {
    OprofileSAXHandler.getInstance(callData).push(_symbolsProcessor);
  }
 else   if (name.equals(DEPENDENT_TAG)) {
    _image._setDepCount(Integer.parseInt(attrs.getValue(ATTR_DEPCOUNT)));
    OprofileSAXHandler.getInstance(callData).push(_dependentProcessor);
  }
 else {
    super.startElement(name,attrs,callData);
  }
}

Fixed version (ground truth):
public void startElement(String name,Attributes attrs,Object callData){
  if (name.equals(IMAGE_TAG)) {
    if (img_seen == 0) {
      _image._setName(attrs.getValue(ATTR_IMAGENAME));
      _image._setCount(Integer.parseInt(attrs.getValue(ATTR_COUNT)));
    }
    img_seen++;
  }
 else   if (name.equals(SYMBOLS_TAG)) {
    OprofileSAXHandler.getInstance(callData).push(_symbolsProcessor);
  }
 else   if (name.equals(DEPENDENT_TAG)) {
    _image._setDepCount(Integer.parseInt(attrs.getValue(ATTR_DEPCOUNT)));
    OprofileSAXHandler.getInstance(callData).push(_dependentProcessor);
  }
 else {
    super.startElement(name,attrs,callData);
  }
}
Program: 92998
Project: 92998
Buggy source:
public void reset(Object callData){
  _image=((CallData)callData).image;
  parsing_image=false;
}

Fixed version (ground truth):
public void reset(Object callData){
  _image=((CallData)callData).image;
  img_seen=0;
}