Program: 135859
Project: 135859
Buggy source:
/** 
 */
public void validatePage(boolean switchToErrorPage){
  if (getManagedForm() == null) {
    return;
  }
  IMessageManager mm=getManagedForm().getMessageManager();
  mm.setAutoUpdate(false);
  ModelEditor modelEditor=(ModelEditor)getEditor();
  setComplete(true);
  getLookupHelper().resetModelNames(this);
  try {
    int dfidDepth=Integer.parseInt(dfidDepthText.getText());
    if (dfidDepth <= 0) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,dfidDepthText);
      setComplete(false);
      expandSection(SEC_LAUNCHING_SETUP);
    }
  }
 catch (  NumberFormatException e) {
    modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,dfidDepthText);
    setComplete(false);
    expandSection(SEC_LAUNCHING_SETUP);
  }
  try {
    int simuDepth=Integer.parseInt(simuDepthText.getText());
    if (simuDepth <= 0) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,simuDepthText);
      setComplete(false);
      expandSection(SEC_LAUNCHING_SETUP);
    }
  }
 catch (  NumberFormatException e) {
    modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,simuDepthText);
    setComplete(false);
    expandSection(SEC_LAUNCHING_SETUP);
  }
  if (!EMPTY_STRING.equals(simuArilText.getText())) {
    try {
      long simuAril=Long.parseLong(simuArilText.getText());
      if (simuAril <= 0) {
        modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,simuArilText);
        setComplete(false);
      }
    }
 catch (    NumberFormatException e) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,simuArilText);
      setComplete(false);
      expandSection(SEC_LAUNCHING_SETUP);
    }
  }
  if (!EMPTY_STRING.equals(simuSeedText.getText())) {
    try {
      Long.parseLong(simuSeedText.getText());
    }
 catch (    NumberFormatException e) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,simuSeedText);
      expandSection(SEC_LAUNCHING_SETUP);
      setComplete(false);
    }
  }
  DataBindingManager dm=getDataBindingManager();
  TypedSet modelValuesSet=TypedSet.parseSet(FormHelper.trimTrailingSpaces(modelValuesSource.getDocument().get()));
  if (modelValuesSet.getValueCount() > 0) {
    List values=modelValuesSet.getValuesAsList();
    validateUsage(MODEL_PARAMETER_MODEL_VALUES,values,"String_Node_Str","String_Node_Str","String_Node_Str",true);
    validateId(MODEL_PARAMETER_MODEL_VALUES,values,"String_Node_Str","String_Node_Str");
    Control widget=UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_MODEL_VALUES));
    for (int j=0; j < values.size(); j++) {
      String value=(String)values.get(j);
      if (SemanticHelper.isConfigFileKeyword(value)) {
        modelEditor.addErrorMessage(value,"String_Node_Str" + value + "String_Node_Str",this.getId(),IMessageProvider.ERROR,widget);
        setComplete(false);
      }
    }
  }
  SpecObj specObj=ToolboxHandle.getCurrentSpec().getValidRootModule();
  OpDefNode[] opDefNodes=null;
  if (specObj != null) {
    opDefNodes=specObj.getExternalModuleTable().getRootModule().getOpDefs();
  }
  Hashtable nodeTable=new Hashtable();
  if (opDefNodes != null) {
    for (int j=0; j < opDefNodes.length; j++) {
      String key=opDefNodes[j].getName().toString();
      nodeTable.put(key,opDefNodes[j]);
    }
  }
  Control widget=UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_DEFINITIONS));
  List definitions=(List)definitionsTable.getInput();
  for (int i=0; i < definitions.size(); i++) {
    Assignment definition=(Assignment)definitions.get(i);
    List values=Arrays.asList(definition.getParams());
    validateUsage(MODEL_PARAMETER_DEFINITIONS,values,"String_Node_Str","String_Node_Str","String_Node_Str",false);
    validateId(MODEL_PARAMETER_DEFINITIONS,values,"String_Node_Str","String_Node_Str");
    if (opDefNodes != null) {
      if (!nodeTable.containsKey(definition.getLabel())) {
        modelEditor.addErrorMessage(definition.getLabel(),"String_Node_Str" + definition.getLabel().substring(definition.getLabel().lastIndexOf("String_Node_Str") + 1) + "String_Node_Str"+ "String_Node_Str",this.getId(),IMessageProvider.ERROR,widget);
        setComplete(false);
      }
 else {
        OpDefNode opDefNode=(OpDefNode)nodeTable.get(definition.getLabel());
        if (opDefNode.getSource().getNumberOfArgs() != definition.getParams().length) {
          modelEditor.addErrorMessage(definition.getLabel(),"String_Node_Str" + opDefNode.getSource().getName() + "String_Node_Str",this.getId(),IMessageProvider.ERROR,widget);
          setComplete(false);
        }
      }
    }
  }
  for (int j=0; j < definitions.size(); j++) {
    Assignment definition=(Assignment)definitions.get(j);
    String label=definition.getLabel();
    if (SemanticHelper.isConfigFileKeyword(label)) {
      modelEditor.addErrorMessage(label,"String_Node_Str" + label + "String_Node_Str",this.getId(),IMessageProvider.ERROR,widget);
      setComplete(false);
    }
  }
  Control viewWidget=UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_VIEW));
  String viewString=FormHelper.trimTrailingSpaces(viewSource.getDocument().get());
  if (SemanticHelper.containsConfigFileKeyword(viewString)) {
    modelEditor.addErrorMessage(viewString,"String_Node_Str" + viewString + "String_Node_Str",this.getId(),IMessageProvider.ERROR,viewWidget);
    setComplete(false);
  }
  mm.setAutoUpdate(true);
  if (!FPSet.isValid(fpBits.getSelection())) {
    modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_FPBITS)));
    setComplete(false);
    expandSection(SEC_HOW_TO_RUN);
  }
  if (!TLCGlobals.isValidSetSize(maxSetSize.getSelection())) {
    modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_MAXSETSIZE)));
    setComplete(false);
    expandSection(SEC_HOW_TO_RUN);
  }
  super.validatePage(switchToErrorPage);
}

Fixed version (ground truth):
/** 
 */
public void validatePage(boolean switchToErrorPage){
  if (getManagedForm() == null) {
    return;
  }
  IMessageManager mm=getManagedForm().getMessageManager();
  mm.setAutoUpdate(false);
  ModelEditor modelEditor=(ModelEditor)getEditor();
  setComplete(true);
  getLookupHelper().resetModelNames(this);
  try {
    int dfidDepth=Integer.parseInt(dfidDepthText.getText());
    if (dfidDepth <= 0) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,dfidDepthText);
      setComplete(false);
      expandSection(SEC_LAUNCHING_SETUP);
    }
 else {
      modelEditor.removeErrorMessage("String_Node_Str",dfidDepthText);
    }
    modelEditor.removeErrorMessage("String_Node_Str",dfidDepthText);
  }
 catch (  NumberFormatException e) {
    modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,dfidDepthText);
    setComplete(false);
    expandSection(SEC_LAUNCHING_SETUP);
  }
  try {
    int simuDepth=Integer.parseInt(simuDepthText.getText());
    if (simuDepth <= 0) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,simuDepthText);
      setComplete(false);
      expandSection(SEC_LAUNCHING_SETUP);
    }
 else {
      modelEditor.removeErrorMessage("String_Node_Str",simuDepthText);
    }
    modelEditor.removeErrorMessage("String_Node_Str",simuDepthText);
  }
 catch (  NumberFormatException e) {
    modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,simuDepthText);
    setComplete(false);
    expandSection(SEC_LAUNCHING_SETUP);
  }
  if (!EMPTY_STRING.equals(simuArilText.getText())) {
    try {
      long simuAril=Long.parseLong(simuArilText.getText());
      if (simuAril <= 0) {
        modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,simuArilText);
        setComplete(false);
      }
 else {
        modelEditor.removeErrorMessage("String_Node_Str",simuArilText);
      }
      modelEditor.removeErrorMessage("String_Node_Str",simuArilText);
    }
 catch (    NumberFormatException e) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,simuArilText);
      setComplete(false);
      expandSection(SEC_LAUNCHING_SETUP);
    }
  }
  if (!EMPTY_STRING.equals(simuSeedText.getText())) {
    try {
      Long.parseLong(simuSeedText.getText());
      modelEditor.removeErrorMessage("String_Node_Str",simuSeedText);
    }
 catch (    NumberFormatException e) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,simuSeedText);
      expandSection(SEC_LAUNCHING_SETUP);
      setComplete(false);
    }
  }
  DataBindingManager dm=getDataBindingManager();
  TypedSet modelValuesSet=TypedSet.parseSet(FormHelper.trimTrailingSpaces(modelValuesSource.getDocument().get()));
  if (modelValuesSet.getValueCount() > 0) {
    List values=modelValuesSet.getValuesAsList();
    validateUsage(MODEL_PARAMETER_MODEL_VALUES,values,"String_Node_Str","String_Node_Str","String_Node_Str",true);
    validateId(MODEL_PARAMETER_MODEL_VALUES,values,"String_Node_Str","String_Node_Str");
    Control widget=UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_MODEL_VALUES));
    for (int j=0; j < values.size(); j++) {
      String value=(String)values.get(j);
      if (SemanticHelper.isConfigFileKeyword(value)) {
        modelEditor.addErrorMessage(value,"String_Node_Str" + value + "String_Node_Str",this.getId(),IMessageProvider.ERROR,widget);
        setComplete(false);
      }
    }
  }
  SpecObj specObj=ToolboxHandle.getCurrentSpec().getValidRootModule();
  OpDefNode[] opDefNodes=null;
  if (specObj != null) {
    opDefNodes=specObj.getExternalModuleTable().getRootModule().getOpDefs();
  }
  Hashtable nodeTable=new Hashtable();
  if (opDefNodes != null) {
    for (int j=0; j < opDefNodes.length; j++) {
      String key=opDefNodes[j].getName().toString();
      nodeTable.put(key,opDefNodes[j]);
    }
  }
  Control widget=UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_DEFINITIONS));
  List definitions=(List)definitionsTable.getInput();
  for (int i=0; i < definitions.size(); i++) {
    Assignment definition=(Assignment)definitions.get(i);
    List values=Arrays.asList(definition.getParams());
    validateUsage(MODEL_PARAMETER_DEFINITIONS,values,"String_Node_Str","String_Node_Str","String_Node_Str",false);
    validateId(MODEL_PARAMETER_DEFINITIONS,values,"String_Node_Str","String_Node_Str");
    if (opDefNodes != null) {
      if (!nodeTable.containsKey(definition.getLabel())) {
        modelEditor.addErrorMessage(definition.getLabel(),"String_Node_Str" + definition.getLabel().substring(definition.getLabel().lastIndexOf("String_Node_Str") + 1) + "String_Node_Str"+ "String_Node_Str",this.getId(),IMessageProvider.ERROR,widget);
        setComplete(false);
      }
 else {
        OpDefNode opDefNode=(OpDefNode)nodeTable.get(definition.getLabel());
        if (opDefNode.getSource().getNumberOfArgs() != definition.getParams().length) {
          modelEditor.addErrorMessage(definition.getLabel(),"String_Node_Str" + opDefNode.getSource().getName() + "String_Node_Str",this.getId(),IMessageProvider.ERROR,widget);
          setComplete(false);
        }
      }
    }
  }
  for (int j=0; j < definitions.size(); j++) {
    Assignment definition=(Assignment)definitions.get(j);
    String label=definition.getLabel();
    if (SemanticHelper.isConfigFileKeyword(label)) {
      modelEditor.addErrorMessage(label,"String_Node_Str" + label + "String_Node_Str",this.getId(),IMessageProvider.ERROR,widget);
      setComplete(false);
    }
  }
  Control viewWidget=UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_VIEW));
  String viewString=FormHelper.trimTrailingSpaces(viewSource.getDocument().get());
  if (SemanticHelper.containsConfigFileKeyword(viewString)) {
    modelEditor.addErrorMessage(viewString,"String_Node_Str" + viewString + "String_Node_Str",this.getId(),IMessageProvider.ERROR,viewWidget);
    setComplete(false);
  }
  mm.setAutoUpdate(true);
  if (!FPSet.isValid(fpBits.getSelection())) {
    modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_FPBITS)));
    setComplete(false);
    expandSection(SEC_HOW_TO_RUN);
  }
  if (!TLCGlobals.isValidSetSize(maxSetSize.getSelection())) {
    modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_MAXSETSIZE)));
    setComplete(false);
    expandSection(SEC_HOW_TO_RUN);
  }
  super.validatePage(switchToErrorPage);
}