Program: 93021
Project: 93021
Buggy source:
public void testGraphLoading() throws InterruptedException {
  StapGraphParser parse=new StapGraphParser();
  parse.setFile(Activator.PLUGIN_LOCATION + "String_Node_Str");
  parse.testRun(new NullProgressMonitor());
  CallgraphView.forceDisplay();
  GraphUIJob j=new GraphUIJob("String_Node_Str",parse,CallGraphConstants.viewID);
  j.runInUIThread(new NullProgressMonitor());
  if (!manual) {
    ArrayList<String> tasks=new ArrayList<String>();
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    int taskNumber=0;
    for (    String task : tasks) {
      taskNumber++;
      System.out.println(task);
      Action act=null;
switch (taskNumber) {
case 1:
        break;
case 2:
      act=CallgraphView.getView_refresh();
    break;
case 3:
  act=CallgraphView.getView_treeview();
break;
case 4:
act=CallgraphView.getView_aggregateview();
break;
case 5:
act=CallgraphView.getView_boxview();
break;
case 6:
act=CallgraphView.getAnimation_fast();
break;
case 7:
case 8:
act=CallgraphView.getMode_collapsednodes();
break;
case 9:
act=CallgraphView.getView_radialview();
break;
case 10:
act=CallgraphView.getMode_collapsednodes();
break;
case 14:
String tempLocation=Activator.PLUGIN_LOCATION + "String_Node_Str";
File temp=new File(tempLocation);
temp.delete();
parse.saveData(tempLocation);
temp.delete();
break;
case 15:
StapGraphParser new_parser=new StapGraphParser();
new_parser.setFile(Activator.PLUGIN_LOCATION + "String_Node_Str");
new_parser.testRun(new NullProgressMonitor());
break;
case 16:
CallgraphView.maximizeIfUnmaximized();
break;
default :
break;
}
if (act != null) {
act.run();
}
}
return;
}
SystemTapUIErrorMessages testRadial=new SystemTapUIErrorMessages("String_Node_Str","String_Node_Str","String_Node_Str");
testRadial.schedule();
testRadial.cancel();
ArrayList<String> tasks=new ArrayList<String>();
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
final Shell sh=new Shell(SWT.SHELL_TRIM);
sh.setSize(450,tasks.size() * 38);
sh.setText("String_Node_Str");
sh.setLayout(new GridLayout(1,false));
sh.setAlpha(150);
ScrolledComposite testComp=new ScrolledComposite(sh,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
Composite buttons=new Composite(testComp,SWT.NONE);
testComp.setContent(buttons);
buttons.setLayout(new GridLayout(1,false));
testComp.setExpandHorizontal(true);
testComp.setExpandVertical(true);
int taskNumber=0;
for (String task : tasks) {
taskNumber++;
Button checkBox=new Button(buttons,SWT.CHECK);
list.add(checkBox);
checkBox.setText(task);
Action act=null;
switch (taskNumber) {
case 1:
break;
case 2:
act=CallgraphView.getView_refresh();
break;
case 3:
act=CallgraphView.getView_treeview();
break;
case 4:
act=CallgraphView.getView_aggregateview();
break;
case 5:
act=CallgraphView.getView_boxview();
break;
case 6:
act=CallgraphView.getAnimation_fast();
break;
case 7:
case 8:
act=CallgraphView.getMode_collapsednodes();
break;
case 9:
act=CallgraphView.getView_radialview();
break;
case 10:
act=CallgraphView.getMode_collapsednodes();
break;
case 14:
act=CallgraphView.getSave_callgraph();
break;
case 15:
act=CallgraphView.getOpen_callgraph();
break;
case 16:
act=CallgraphView.getHelp_version();
break;
default :
break;
}
if (act != null) {
ButtonSelectionListener bl=new ButtonSelectionListener(act);
checkBox.addSelectionListener(bl);
}
}
sh.open();
boolean doneTasks=MessageDialog.openConfirm(new Shell(SWT.ON_TOP),"String_Node_Str","String_Node_Str" + tasks.size() + "String_Node_Str"+ "String_Node_Str");
assertEquals(true,doneTasks);
for (Button b : list) {
if (!b.getSelection()) {
fail("String_Node_Str" + b.getText());
}
assertEquals(true,b.getSelection());
}
}

Fixed version (ground truth):
public void testGraphLoading() throws InterruptedException {
  StapGraphParser parse=new StapGraphParser();
  parse.setFile(Activator.PLUGIN_LOCATION + "String_Node_Str");
  parse.testRun(new NullProgressMonitor());
  GraphUIJob j=new GraphUIJob("String_Node_Str",parse,CallGraphConstants.viewID);
  j.runInUIThread(new NullProgressMonitor());
  CallgraphView.forceDisplay();
  if (!manual) {
    ArrayList<String> tasks=new ArrayList<String>();
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    tasks.add("String_Node_Str");
    int taskNumber=0;
    for (    String task : tasks) {
      taskNumber++;
      System.out.println(task);
      Action act=null;
switch (taskNumber) {
case 1:
        break;
case 2:
      act=CallgraphView.getView_refresh();
    break;
case 3:
  act=CallgraphView.getView_treeview();
break;
case 4:
act=CallgraphView.getView_aggregateview();
break;
case 5:
act=CallgraphView.getView_boxview();
break;
case 6:
act=CallgraphView.getAnimation_fast();
break;
case 7:
case 8:
act=CallgraphView.getMode_collapsednodes();
break;
case 9:
act=CallgraphView.getView_radialview();
break;
case 10:
act=CallgraphView.getMode_collapsednodes();
break;
case 14:
String tempLocation=Activator.PLUGIN_LOCATION + "String_Node_Str";
File temp=new File(tempLocation);
temp.delete();
parse.saveData(tempLocation);
temp.delete();
break;
case 15:
StapGraphParser new_parser=new StapGraphParser();
new_parser.setFile(Activator.PLUGIN_LOCATION + "String_Node_Str");
new_parser.testRun(new NullProgressMonitor());
break;
case 16:
CallgraphView.maximizeIfUnmaximized();
break;
default :
break;
}
if (act != null) {
act.run();
}
}
return;
}
SystemTapUIErrorMessages testRadial=new SystemTapUIErrorMessages("String_Node_Str","String_Node_Str","String_Node_Str");
testRadial.schedule();
testRadial.cancel();
ArrayList<String> tasks=new ArrayList<String>();
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
tasks.add("String_Node_Str");
final Shell sh=new Shell(SWT.SHELL_TRIM);
sh.setSize(450,tasks.size() * 38);
sh.setText("String_Node_Str");
sh.setLayout(new GridLayout(1,false));
sh.setAlpha(150);
ScrolledComposite testComp=new ScrolledComposite(sh,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
Composite buttons=new Composite(testComp,SWT.NONE);
testComp.setContent(buttons);
buttons.setLayout(new GridLayout(1,false));
testComp.setExpandHorizontal(true);
testComp.setExpandVertical(true);
int taskNumber=0;
for (String task : tasks) {
taskNumber++;
Button checkBox=new Button(buttons,SWT.CHECK);
list.add(checkBox);
checkBox.setText(task);
Action act=null;
switch (taskNumber) {
case 1:
break;
case 2:
act=CallgraphView.getView_refresh();
break;
case 3:
act=CallgraphView.getView_treeview();
break;
case 4:
act=CallgraphView.getView_aggregateview();
break;
case 5:
act=CallgraphView.getView_boxview();
break;
case 6:
act=CallgraphView.getAnimation_fast();
break;
case 7:
case 8:
act=CallgraphView.getMode_collapsednodes();
break;
case 9:
act=CallgraphView.getView_radialview();
break;
case 10:
act=CallgraphView.getMode_collapsednodes();
break;
case 14:
act=CallgraphView.getSave_callgraph();
break;
case 15:
act=CallgraphView.getOpen_callgraph();
break;
case 16:
act=CallgraphView.getHelp_version();
break;
default :
break;
}
if (act != null) {
ButtonSelectionListener bl=new ButtonSelectionListener(act);
checkBox.addSelectionListener(bl);
}
}
sh.open();
boolean doneTasks=MessageDialog.openConfirm(new Shell(SWT.ON_TOP),"String_Node_Str","String_Node_Str" + tasks.size() + "String_Node_Str"+ "String_Node_Str");
assertEquals(true,doneTasks);
for (Button b : list) {
if (!b.getSelection()) {
fail("String_Node_Str" + b.getText());
}
assertEquals(true,b.getSelection());
}
}