Program: 24669
Project: 24669
Buggy source:
private void CreateStepGrid(){
  FlexTable stepsTable=new FlexTable();
  stepsTable.setStyleName("String_Node_Str");
  stepsTable.setWidth("String_Node_Str");
  stepsTable.setCellPadding(3);
  stepsTable.setCellSpacing(0);
  FlexCellFormatter formatter=stepsTable.getFlexCellFormatter();
  formatter.setStyleName(0,0,"String_Node_Str");
  formatter.setStyleName(0,1,"String_Node_Str");
  formatter.setStyleName(0,2,"String_Node_Str");
  stepsTable.setWidget(0,0,new Label(messages.stepStatusLable()));
  stepsTable.setWidget(0,1,new Label(messages.stepDescription()));
  int rowCount=1;
  for (  final GwtStepVerficationResult stepResult : this.listOfSteps) {
    final ListBox statusList=new ListBox(false);
    statusList.setWidth("String_Node_Str");
    statusList.addItem(StepStatus.NotStarted.getLabel());
    statusList.addItem(StepStatus.InProgress.getLabel());
    statusList.addItem(StepStatus.Complete.getLabel());
    final GwtStep step=stepResult.getStep();
switch (step.getStatus()) {
case InProgress:
      statusList.setSelectedIndex(1);
    break;
case Complete:
  statusList.setSelectedIndex(2);
break;
default :
statusList.setSelectedIndex(0);
}
statusList.addChangeHandler(new ChangeHandler(){
@Override public void onChange(ChangeEvent event){
final String status=statusList.getItemText(statusList.getSelectedIndex());
if (step.getStatus() != StepStatus.NotStarted && StepStatus.convertLabel(status) == StepStatus.NotStarted) {
Window.alert(messages.cannotChangeToNotStarted());
if (step.getStatus() == StepStatus.InProgress) statusList.setSelectedIndex(1);
if (step.getStatus() == StepStatus.Complete) statusList.setSelectedIndex(2);
return;
}
if (step.getStatus() == StepStatus.Complete && StepStatus.convertLabel(status) == StepStatus.InProgress) {
int stepNo=Integer.valueOf(step.getDescription().charAt(5));
for (int i=0; i < listOfSteps.size(); i++) {
  int stepNumber=Integer.valueOf(listOfSteps.get(i).getStep().getDescription().charAt(5));
  if (stepNumber < stepNo) {
    updateStepStatus(projectId,listOfSteps.get(i).getStep().getId(),"String_Node_Str");
  }
}
}
updateStepStatus(projectId,step.getId(),status);
step.setStatus(StepStatus.convertLabel(status));
}
}
);
VerticalPanel analysisResults=new VerticalPanel();
analysisResults.setStyleName("String_Node_Str");
analysisResults.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
HTML warningLabel=new HTML();
Label resultLabel=new Label();
this.verifyStep(this.projectId,step.getId(),warningLabel,resultLabel,stepResult);
System.out.println("String_Node_Str" + step.getId() + "String_Node_Str"+ step.getDescription());
analysisResults.add(new Hyperlink(step.getDescription(),StepRouter.CreateStepLink(step)));
stepsTable.setWidget(rowCount,0,statusList);
stepsTable.setWidget(rowCount,1,analysisResults);
formatter.setVerticalAlignment(rowCount,0,HasVerticalAlignment.ALIGN_TOP);
formatter.setWidth(rowCount,0,"String_Node_Str");
rowCount++;
}
this.add(stepsTable);
}

Fixed version (ground truth):
private void CreateStepGrid(){
  FlexTable stepsTable=new FlexTable();
  stepsTable.setStyleName("String_Node_Str");
  stepsTable.setWidth("String_Node_Str");
  stepsTable.setCellPadding(3);
  stepsTable.setCellSpacing(0);
  FlexCellFormatter formatter=stepsTable.getFlexCellFormatter();
  formatter.setStyleName(0,0,"String_Node_Str");
  formatter.setStyleName(0,1,"String_Node_Str");
  formatter.setStyleName(0,2,"String_Node_Str");
  stepsTable.setWidget(0,0,new Label(messages.stepStatusLable()));
  stepsTable.setWidget(0,1,new Label(messages.stepDescription()));
  int rowCount=1;
  for (  final GwtStepVerficationResult stepResult : this.listOfSteps) {
    final ListBox statusList=new ListBox(false);
    statusList.setWidth("String_Node_Str");
    statusList.addItem(StepStatus.NotStarted.getLabel());
    statusList.addItem(StepStatus.InProgress.getLabel());
    statusList.addItem(StepStatus.Complete.getLabel());
    final GwtStep step=stepResult.getStep();
switch (step.getStatus()) {
case InProgress:
      statusList.setSelectedIndex(1);
    break;
case Complete:
  statusList.setSelectedIndex(2);
break;
default :
statusList.setSelectedIndex(0);
}
final VerticalPanel analysisResults=new VerticalPanel();
analysisResults.setStyleName("String_Node_Str");
analysisResults.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
HTML warningLabel=new HTML();
Label resultLabel=new Label();
this.verifyStep(this.projectId,step.getId(),warningLabel,resultLabel,stepResult);
System.out.println("String_Node_Str" + step.getId() + "String_Node_Str"+ step.getDescription());
if (step.getStatus() == StepStatus.NotStarted) analysisResults.add(new Label(step.getDescription()));
 else analysisResults.add(new Hyperlink(step.getDescription(),StepRouter.CreateStepLink(step)));
statusList.addChangeHandler(new ChangeHandler(){
@Override public void onChange(ChangeEvent event){
final String status=statusList.getItemText(statusList.getSelectedIndex());
if (step.getStatus() != StepStatus.NotStarted && StepStatus.convertLabel(status) == StepStatus.NotStarted) {
Window.alert(messages.cannotChangeToNotStarted());
if (step.getStatus() == StepStatus.InProgress) statusList.setSelectedIndex(1);
if (step.getStatus() == StepStatus.Complete) statusList.setSelectedIndex(2);
return;
}
if (step.getStatus() == StepStatus.Complete && StepStatus.convertLabel(status) == StepStatus.InProgress) {
int stepNo=Integer.valueOf(step.getDescription().charAt(5));
for (int i=0; i < listOfSteps.size(); i++) {
  int stepNumber=Integer.valueOf(listOfSteps.get(i).getStep().getDescription().charAt(5));
  if (stepNumber < stepNo) {
    updateStepStatus(projectId,listOfSteps.get(i).getStep().getId(),"String_Node_Str");
  }
}
}
if (step.getStatus() == StepStatus.NotStarted && (StepStatus.convertLabel(status) == StepStatus.InProgress || StepStatus.convertLabel(status) == StepStatus.Complete)) {
analysisResults.clear();
analysisResults.add(new Hyperlink(step.getDescription(),StepRouter.CreateStepLink(step)));
}
updateStepStatus(projectId,step.getId(),status);
step.setStatus(StepStatus.convertLabel(status));
}
}
);
stepsTable.setWidget(rowCount,0,statusList);
stepsTable.setWidget(rowCount,1,analysisResults);
formatter.setVerticalAlignment(rowCount,0,HasVerticalAlignment.ALIGN_TOP);
formatter.setWidth(rowCount,0,"String_Node_Str");
rowCount++;
}
this.add(stepsTable);
}