Program: 180435
Project: 180435
Buggy source:
public void execute(int action){
  boolean hit=false;
switch (action) {
case ATTENDING:
    break;
case INDEPENDENT:
  if (!waiting) {
    collector.addResponse(item,gui.getAttending().isSelected(),RespType.INDEPENDANT);
    hit=true;
  }
break;
case VERBAL:
if (!waiting) {
collector.addResponse(item,gui.getAttending().isSelected(),RespType.VERBAL);
hit=true;
}
break;
case MODELING:
if (!waiting) {
collector.addResponse(item,gui.getAttending().isSelected(),RespType.MODEL);
hit=true;
}
break;
case NO_ANSWER:
if (!waiting) {
collector.addResponse(item,gui.getAttending().isSelected(),RespType.NONE);
hit=true;
}
break;
case QUIT:
System.exit(0);
break;
case TIMER:
timer();
break;
case BETWEEN_TIMER:
hit=true;
waiting=false;
justWaited=true;
break;
case SHOW_LOGGING_FRAME:
gui.showLoggingFrame();
break;
case OPEN:
gui.openSession();
break;
case OPEN_HTTP:
gui.openHttpSession();
break;
}
if (hit) {
gui.getTimer().stop();
stopSound();
playPrompt=true;
if (gui.getItemQueue().size() == 0) {
gui.populateSessionName();
gui.populateSessionDataFile();
collector.setSessionName(gui.getSession().getSessionName());
File csvFile=null;
try {
csvFile=gui.getSession().getSessionDataFile();
boolean writeHeader=!csvFile.exists();
CSVWriter csvWriter=new CSVWriter(new FileWriter(csvFile,true));
SessionData data=collector.getData();
if (writeHeader) {
data.writeSummaryHeader(csvWriter);
}
data.writeSummary(csvWriter);
csvWriter.close();
String sessionCsvName=data.getOverall().getName() + "String_Node_Str" + data.getSessionName()+ "String_Node_Str";
File session=new File(csvFile.getParentFile(),sessionCsvName);
CSVWriter writer=new CSVWriter(new FileWriter(session));
data.writeSessionFile(writer);
writer.close();
System.out.println("String_Node_Str" + csvFile);
}
 catch (IOException e) {
log.error(String.format("String_Node_Str",csvFile.getAbsolutePath()),e);
e.printStackTrace();
}
gui.backToStartScreen();
gui.getTimer().stop();
}
 else {
if (justWaited) {
item=gui.getItemQueue().remove();
log.info(String.format("String_Node_Str",item.getImgFile(),item.getItemNumber()));
gui.switchImage(item.getImg());
gui.getTimer().start();
justWaited=false;
}
 else {
gui.clearImage();
gui.getBetweenTimer().start();
waiting=true;
}
}
}
}

Fixed version (ground truth):
public void execute(int action){
  boolean hit=false;
switch (action) {
case ATTENDING:
    break;
case INDEPENDENT:
  if (!waiting) {
    collector.addResponse(item,gui.getAttending().isSelected(),RespType.INDEPENDENT);
    hit=true;
  }
break;
case VERBAL:
if (!waiting) {
collector.addResponse(item,gui.getAttending().isSelected(),RespType.VERBAL);
hit=true;
}
break;
case MODELING:
if (!waiting) {
collector.addResponse(item,gui.getAttending().isSelected(),RespType.MODEL);
hit=true;
}
break;
case NO_ANSWER:
if (!waiting) {
collector.addResponse(item,gui.getAttending().isSelected(),RespType.NONE);
hit=true;
}
break;
case QUIT:
System.exit(0);
break;
case TIMER:
timer();
break;
case BETWEEN_TIMER:
hit=true;
waiting=false;
justWaited=true;
break;
case SHOW_LOGGING_FRAME:
gui.showLoggingFrame();
break;
case OPEN:
gui.openSession();
break;
case OPEN_HTTP:
gui.openHttpSession();
break;
}
if (hit) {
gui.getTimer().stop();
stopSound();
playPrompt=true;
if (gui.getItemQueue().size() == 0) {
gui.populateSessionName();
gui.populateSessionDataFile();
collector.setSessionName(gui.getSession().getSessionName());
File csvFile=null;
try {
csvFile=gui.getSession().getSessionDataFile();
boolean writeHeader=!csvFile.exists();
CSVWriter csvWriter=new CSVWriter(new FileWriter(csvFile,true));
SessionData data=collector.getData();
if (writeHeader) {
data.writeSummaryHeader(csvWriter);
}
data.writeSummary(csvWriter);
csvWriter.close();
String sessionCsvName=data.getOverall().getName() + "String_Node_Str" + data.getSessionName()+ "String_Node_Str";
File session=new File(csvFile.getParentFile(),sessionCsvName);
CSVWriter writer=new CSVWriter(new FileWriter(session));
data.writeSessionFile(writer);
writer.close();
System.out.println("String_Node_Str" + csvFile);
}
 catch (IOException e) {
log.error(String.format("String_Node_Str",csvFile.getAbsolutePath()),e);
e.printStackTrace();
}
gui.backToStartScreen();
gui.getTimer().stop();
}
 else {
if (justWaited) {
item=gui.getItemQueue().remove();
log.info(String.format("String_Node_Str",item.getImgFile(),item.getItemNumber()));
gui.switchImage(item.getImg());
gui.getTimer().start();
justWaited=false;
}
 else {
gui.clearImage();
gui.getBetweenTimer().start();
waiting=true;
}
}
}
}