Program: 24751
Project: 24751
Buggy source:
/** 
 * Navigation Buttons to browse other pages
 * @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 subGoalButton=new Button(messages.subGoalButton());
  Button summaryButton=new Button(messages.done());
  subGoalButton.setWidth("String_Node_Str");
  summaryButton.setWidth("String_Node_Str");
  navigatorLayout.setWidget(0,0,subGoalButton);
  navigatorLayout.setWidget(0,1,summaryButton);
  formatterNavigator.setHorizontalAlignment(0,0,HasHorizontalAlignment.ALIGN_LEFT);
  formatterNavigator.setHorizontalAlignment(0,1,HasHorizontalAlignment.ALIGN_RIGHT);
  subGoalButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      if (updating == true) {
        Window.alert("String_Node_Str");
        return;
      }
      if (commandClass != null) {
        if (commandClass.getupdatedParentBusinessGoal() != null) {
          businessGoal=commandClass.getupdatedParentBusinessGoal();
        }
      }
      savePriorities();
      checkAssetGoalTraceability();
      if (duplicatePriorities || traceabilityViolation) {
        return;
      }
      History.newItem(AssetsAndGoalsPilot.generateNavigationId(AssetsAndGoalsPilot.PageId.addSubGoalsAndAssets));
    }
  }
);
  summaryButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      if (commandClass != null) {
        if (commandClass.getupdatedParentBusinessGoal() != null) {
          businessGoal=commandClass.getupdatedParentBusinessGoal();
        }
      }
      savePriorities();
      checkAssetGoalTraceability();
      if (duplicatePriorities || traceabilityViolation) {
        return;
      }
      History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
    }
  }
);
  return navigatorLayout;
}

Fixed version (ground truth):
/** 
 * Navigation Buttons to browse other pages
 * @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 subGoalButton=new Button(messages.subGoalButton());
  Button summaryButton=new Button(messages.done());
  subGoalButton.setWidth("String_Node_Str");
  summaryButton.setWidth("String_Node_Str");
  navigatorLayout.setWidget(0,0,subGoalButton);
  navigatorLayout.setWidget(0,1,summaryButton);
  formatterNavigator.setHorizontalAlignment(0,0,HasHorizontalAlignment.ALIGN_LEFT);
  formatterNavigator.setHorizontalAlignment(0,1,HasHorizontalAlignment.ALIGN_RIGHT);
  subGoalButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      if (updating == true) {
        Window.alert("String_Node_Str");
        return;
      }
      if (commandClass != null) {
        if (commandClass.getupdatedParentBusinessGoal() != null) {
          businessGoal=commandClass.getupdatedParentBusinessGoal();
        }
      }
      savePriorities();
      checkAssetGoalTraceability();
      if (duplicatePriorities || traceabilityViolation) {
        return;
      }
      History.newItem(AssetsAndGoalsPilot.generateNavigationId(AssetsAndGoalsPilot.PageId.addSubGoalsAndAssets));
    }
  }
);
  final int caseid=this.getCurrentState().getCaseID();
  summaryButton.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      if (commandClass != null) {
        if (commandClass.getupdatedParentBusinessGoal() != null) {
          businessGoal=commandClass.getupdatedParentBusinessGoal();
        }
      }
      savePriorities();
      checkAssetGoalTraceability();
      if (duplicatePriorities || traceabilityViolation) {
        return;
      }
      if (caseid == 1)       History.newItem(ChooseStepPilot.generateNavigationId(ChooseStepPilot.PageId.home));
      if (caseid == 3)       History.newItem(ChooseStepCase3Pilot.generateNavigationId(ChooseStepCase3Pilot.PageId.home));
    }
  }
);
  return navigatorLayout;
}