Program: 136076
Project: 136076
Buggy source:
public void validatePage(boolean switchToErrorPage){
  if (getManagedForm() == null) {
    return;
  }
  countXX++;
  System.out.println("String_Node_Str" + countXX);
  if (countXX == 60000) {
    countXX++;
    ModelEditor ourFavoriteEditor=(ModelEditor)this.getEditor();
    ourFavoriteEditor.removePage(0);
    System.out.println("String_Node_Str");
    MainModelPage newPage=new MainModelPage(ourFavoriteEditor);
    try {
      ourFavoriteEditor.addPage(0,newPage);
      ourFavoriteEditor.setUpPage(newPage,0);
    }
 catch (    PartInitException e) {
      TLCUIActivator.logError("String_Node_Str",e);
      e.printStackTrace();
    }
    ourFavoriteEditor.setActivePage(newPage.getId());
    newPage.setFocus();
    System.out.println("String_Node_Str");
  }
  DataBindingManager dm=getDataBindingManager();
  IMessageManager mm=getManagedForm().getMessageManager();
  resetAllMessages(false);
  ModuleNode rootModuleNode=SemanticHelper.getRootModuleNode();
  getLookupHelper().resetModelNames(this);
  List constants=(List)constantTable.getInput();
  if (rootModuleNode != null) {
    List toDelete=ModelHelper.mergeConstantLists(constants,ModelHelper.createConstantsList(rootModuleNode));
    if (!toDelete.isEmpty()) {
      SectionPart constantSection=dm.getSection(dm.getSectionForAttribute(MODEL_PARAMETER_CONSTANTS));
      if (constantSection != null) {
        constantSection.markDirty();
      }
    }
    constantTable.setInput(constants);
  }
  boolean symmetryUsed=false;
  for (int i=0; i < constants.size(); i++) {
    Assignment constant=(Assignment)constants.get(i);
    List values=Arrays.asList(constant.getParams());
    validateId(MODEL_PARAMETER_CONSTANTS,values,"String_Node_Str","String_Node_Str");
    if (constant.getRight() == null || EMPTY_STRING.equals(constant.getRight())) {
      mm.addMessage(constant.getLabel(),"String_Node_Str" + constant.getLabel(),constant,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
      setComplete(false);
      expandSection(dm.getSectionForAttribute(MODEL_PARAMETER_CONSTANTS));
    }
 else {
      if (constant.isSetOfModelValues()) {
        if (symmetryUsed && constant.isSymmetricalSet()) {
          mm.addMessage(constant.getLabel(),"String_Node_Str",constant,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
          setComplete(false);
          expandSection(dm.getSectionForAttribute(MODEL_PARAMETER_CONSTANTS));
        }
 else {
          if (constant.isSymmetricalSet()) {
            symmetryUsed=true;
          }
        }
        TypedSet modelValuesSet=TypedSet.parseSet(constant.getRight());
        if (modelValuesSet.getValueCount() > 0) {
          List mvList=modelValuesSet.getValuesAsList();
          validateUsage(MODEL_PARAMETER_CONSTANTS,mvList,"String_Node_Str","String_Node_Str","String_Node_Str",true);
          validateId(MODEL_PARAMETER_CONSTANTS,mvList,"String_Node_Str","String_Node_Str");
          Control widget=UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS));
          for (int j=0; j < mvList.size(); j++) {
            String value=(String)mvList.get(j);
            if (SemanticHelper.isConfigFileKeyword(value)) {
              mm.addMessage(value,"String_Node_Str" + value + "String_Node_Str",constant,IMessageProvider.ERROR,widget);
            }
          }
        }
      }
    }
    if (SemanticHelper.isConfigFileKeyword(constant.getLabel())) {
      mm.addMessage(constant.getLabel(),"String_Node_Str" + constant.getLabel() + "String_Node_Str",constant,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
    }
  }
  for (int i=0; i < constants.size(); i++) {
    Assignment constant=(Assignment)constants.get(i);
    List values=Arrays.asList(constant.getParams());
    validateUsage(MODEL_PARAMETER_CONSTANTS,values,"String_Node_Str","String_Node_Str","String_Node_Str",false);
  }
  String numberOfworkers=workers.getText();
  try {
    int number=Integer.parseInt(numberOfworkers);
    if (number <= 0) {
      mm.addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_NUMBER_OF_WORKERS)));
      setComplete(false);
      expandSection(SEC_HOW_TO_RUN);
    }
 else {
      if (number > Runtime.getRuntime().availableProcessors()) {
        mm.addMessage("String_Node_Str","String_Node_Str" + number + "String_Node_Str"+ Runtime.getRuntime().availableProcessors()+ "String_Node_Str",null,IMessageProvider.WARNING,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_NUMBER_OF_WORKERS)));
        expandSection(SEC_HOW_TO_RUN);
      }
    }
  }
 catch (  NumberFormatException e) {
    mm.addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_NUMBER_OF_WORKERS)));
    setComplete(false);
    expandSection(SEC_HOW_TO_RUN);
  }
  updateCheckpoints();
  if (checkpointButton.getSelection()) {
    if (EMPTY_STRING.equals(checkpointIdText.getText())) {
      mm.addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_RECOVER)));
      setComplete(false);
      expandSection(SEC_HOW_TO_RUN);
    }
  }
  if (rootModuleNode != null) {
    if (rootModuleNode.getVariableDecls().length == 0) {
      setHasVariables(false);
      setSpecSelection(MODEL_BEHAVIOR_TYPE_NO_SPEC);
    }
 else {
      setHasVariables(true);
      if (noSpecRadio.getSelection()) {
        setSpecSelection(MODEL_BEHAVIOR_TYPE_DEFAULT);
      }
    }
  }
  if (closedFormulaRadio.getSelection() && specSource.getDocument().get().trim().equals("String_Node_Str")) {
    mm.addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_BEHAVIOR_CLOSED_SPECIFICATION)));
    setComplete(false);
    expandSection(dm.getSectionForAttribute(MODEL_BEHAVIOR_CLOSED_SPECIFICATION));
  }
 else   if (initNextFairnessRadio.getSelection()) {
    String init=initFormulaSource.getDocument().get().trim();
    String next=nextFormulaSource.getDocument().get().trim();
    if (init.equals("String_Node_Str")) {
      mm.addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_INIT)));
      setComplete(false);
      expandSection(dm.getSectionForAttribute(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_INIT));
    }
    if (next.equals("String_Node_Str")) {
      mm.addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_NEXT)));
      setComplete(false);
      expandSection(dm.getSectionForAttribute(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_NEXT));
    }
  }
  mm.setAutoUpdate(true);
  super.validatePage(switchToErrorPage);
}

Fixed version (ground truth):
public void validatePage(boolean switchToErrorPage){
  if (getManagedForm() == null) {
    return;
  }
  DataBindingManager dm=getDataBindingManager();
  IMessageManager mm=getManagedForm().getMessageManager();
  resetAllMessages(false);
  ModuleNode rootModuleNode=SemanticHelper.getRootModuleNode();
  getLookupHelper().resetModelNames(this);
  List constants=(List)constantTable.getInput();
  if (rootModuleNode != null) {
    List toDelete=ModelHelper.mergeConstantLists(constants,ModelHelper.createConstantsList(rootModuleNode));
    if (!toDelete.isEmpty()) {
      SectionPart constantSection=dm.getSection(dm.getSectionForAttribute(MODEL_PARAMETER_CONSTANTS));
      if (constantSection != null) {
        constantSection.markDirty();
      }
    }
    constantTable.setInput(constants);
  }
  boolean symmetryUsed=false;
  for (int i=0; i < constants.size(); i++) {
    Assignment constant=(Assignment)constants.get(i);
    List values=Arrays.asList(constant.getParams());
    validateId(MODEL_PARAMETER_CONSTANTS,values,"String_Node_Str","String_Node_Str");
    if (constant.getRight() == null || EMPTY_STRING.equals(constant.getRight())) {
      mm.addMessage(constant.getLabel(),"String_Node_Str" + constant.getLabel(),constant,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
      setComplete(false);
      expandSection(dm.getSectionForAttribute(MODEL_PARAMETER_CONSTANTS));
    }
 else {
      if (constant.isSetOfModelValues()) {
        if (symmetryUsed && constant.isSymmetricalSet()) {
          mm.addMessage(constant.getLabel(),"String_Node_Str",constant,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
          setComplete(false);
          expandSection(dm.getSectionForAttribute(MODEL_PARAMETER_CONSTANTS));
        }
 else {
          if (constant.isSymmetricalSet()) {
            symmetryUsed=true;
          }
        }
        TypedSet modelValuesSet=TypedSet.parseSet(constant.getRight());
        if (modelValuesSet.getValueCount() > 0) {
          List mvList=modelValuesSet.getValuesAsList();
          validateUsage(MODEL_PARAMETER_CONSTANTS,mvList,"String_Node_Str","String_Node_Str","String_Node_Str",true);
          validateId(MODEL_PARAMETER_CONSTANTS,mvList,"String_Node_Str","String_Node_Str");
          Control widget=UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS));
          for (int j=0; j < mvList.size(); j++) {
            String value=(String)mvList.get(j);
            if (SemanticHelper.isConfigFileKeyword(value)) {
              mm.addMessage(value,"String_Node_Str" + value + "String_Node_Str",constant,IMessageProvider.ERROR,widget);
            }
          }
        }
      }
    }
    if (SemanticHelper.isConfigFileKeyword(constant.getLabel())) {
      mm.addMessage(constant.getLabel(),"String_Node_Str" + constant.getLabel() + "String_Node_Str",constant,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
    }
  }
  for (int i=0; i < constants.size(); i++) {
    Assignment constant=(Assignment)constants.get(i);
    List values=Arrays.asList(constant.getParams());
    validateUsage(MODEL_PARAMETER_CONSTANTS,values,"String_Node_Str","String_Node_Str","String_Node_Str",false);
  }
  String numberOfworkers=workers.getText();
  try {
    int number=Integer.parseInt(numberOfworkers);
    if (number <= 0) {
      mm.addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_NUMBER_OF_WORKERS)));
      setComplete(false);
      expandSection(SEC_HOW_TO_RUN);
    }
 else {
      if (number > Runtime.getRuntime().availableProcessors()) {
        mm.addMessage("String_Node_Str","String_Node_Str" + number + "String_Node_Str"+ Runtime.getRuntime().availableProcessors()+ "String_Node_Str",null,IMessageProvider.WARNING,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_NUMBER_OF_WORKERS)));
        expandSection(SEC_HOW_TO_RUN);
      }
    }
  }
 catch (  NumberFormatException e) {
    mm.addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_NUMBER_OF_WORKERS)));
    setComplete(false);
    expandSection(SEC_HOW_TO_RUN);
  }
  updateCheckpoints();
  if (checkpointButton.getSelection()) {
    if (EMPTY_STRING.equals(checkpointIdText.getText())) {
      mm.addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_RECOVER)));
      setComplete(false);
      expandSection(SEC_HOW_TO_RUN);
    }
  }
  if (rootModuleNode != null) {
    if (rootModuleNode.getVariableDecls().length == 0) {
      setHasVariables(false);
      setSpecSelection(MODEL_BEHAVIOR_TYPE_NO_SPEC);
    }
 else {
      setHasVariables(true);
      if (noSpecRadio.getSelection()) {
        setSpecSelection(MODEL_BEHAVIOR_TYPE_DEFAULT);
      }
    }
  }
  if (closedFormulaRadio.getSelection() && specSource.getDocument().get().trim().equals("String_Node_Str")) {
    mm.addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_BEHAVIOR_CLOSED_SPECIFICATION)));
    setComplete(false);
    expandSection(dm.getSectionForAttribute(MODEL_BEHAVIOR_CLOSED_SPECIFICATION));
  }
 else   if (initNextFairnessRadio.getSelection()) {
    String init=initFormulaSource.getDocument().get().trim();
    String next=nextFormulaSource.getDocument().get().trim();
    if (init.equals("String_Node_Str")) {
      mm.addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_INIT)));
      setComplete(false);
      expandSection(dm.getSectionForAttribute(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_INIT));
    }
    if (next.equals("String_Node_Str")) {
      mm.addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_NEXT)));
      setComplete(false);
      expandSection(dm.getSectionForAttribute(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_NEXT));
    }
  }
  mm.setAutoUpdate(true);
  super.validatePage(switchToErrorPage);
}