Program: 24847
Project: 24847
Buggy source:
/** 
 * Navigation Buttons to browse other pages from the summary page
 * @param layout 
 * @return a table containing navigation buttons
 */
private FlexTable NavigationButtons(VerticalPanel layout){
  FlexTable navigatorLayout=new FlexTable();
  FlexCellFormatter formatterNavigator=navigatorLayout.getFlexCellFormatter();
  navigatorLayout.setWidth("String_Node_Str");
  Button assetAssociationButton=new Button(messages.assetAssociationButton());
  assetAssociationButton.addStyleName("String_Node_Str");
  if (businessGoal.getAssets().isEmpty()) {
    assetAssociationButton.setText(messages.reviewSubgoals());
  }
  Button summaryButton=new Button(messages.done());
  summaryButton.addStyleName("String_Node_Str");
  if (getCurrentState().getMode().toString().equalsIgnoreCase("String_Node_Str")) {
    navigatorLayout.setWidget(0,0,assetAssociationButton);
  }
  navigatorLayout.setWidget(0,1,summaryButton);
  formatterNavigator.setHorizontalAlignment(0,0,HasHorizontalAlignment.ALIGN_LEFT);
  formatterNavigator.setHorizontalAlignment(0,1,HasHorizontalAlignment.ALIGN_RIGHT);
  assetAssociationButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      if (businessGoal.getAssets().isEmpty()) {
        History.newItem(AssetsAndGoalsPilot.generateNavigationId(AssetsAndGoalsPilot.PageId.addSubGoalsAndAssets));
      }
 else {
        History.newItem(AssetsAndGoalsPilot.generateNavigationId(AssetsAndGoalsPilot.PageId.assetGoalAssociation));
      }
    }
  }
);
  summaryButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
    }
  }
);
  return navigatorLayout;
}

Fixed version (ground truth):
/** 
 * Navigation Buttons to browse other pages from the summary page
 * @param layout 
 * @return a table containing navigation buttons
 */
private FlexTable NavigationButtons(VerticalPanel layout){
  FlexTable navigatorLayout=new FlexTable();
  FlexCellFormatter formatterNavigator=navigatorLayout.getFlexCellFormatter();
  navigatorLayout.setWidth("String_Node_Str");
  Button assetAssociationButton=new Button(messages.assetAssociationButton());
  assetAssociationButton.addStyleName("String_Node_Str");
  if (businessGoal.getAssets().isEmpty()) {
    assetAssociationButton.setText(messages.reviewSubgoals());
  }
  Button summaryButton=new Button(messages.done());
  summaryButton.addStyleName("String_Node_Str");
  if (getCurrentState().getMode().toString().equalsIgnoreCase("String_Node_Str")) {
    navigatorLayout.setWidget(0,0,assetAssociationButton);
  }
  navigatorLayout.setWidget(0,1,summaryButton);
  formatterNavigator.setHorizontalAlignment(0,0,HasHorizontalAlignment.ALIGN_LEFT);
  formatterNavigator.setHorizontalAlignment(0,1,HasHorizontalAlignment.ALIGN_RIGHT);
  assetAssociationButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      if (businessGoal.getAssets().isEmpty()) {
        History.newItem(AssetsAndGoalsPilot.generateNavigationId(AssetsAndGoalsPilot.PageId.addSubGoalsAndAssets));
      }
 else {
        History.newItem(AssetsAndGoalsPilot.generateNavigationId(AssetsAndGoalsPilot.PageId.assetGoalAssociation));
      }
    }
  }
);
  final int caseid=this.getCurrentState().getCaseID();
  summaryButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      if (caseid == 1)       History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
      if (caseid == 3)       History.newItem(ChooseStepCase3Pilot.generateNavigationId(ChooseStepCase3Pilot.PageId.home));
    }
  }
);
  return navigatorLayout;
}