Program: 135857
Project: 135857
Buggy source:
public void validatePage(boolean switchToErrorPage){
  if (getManagedForm() == null) {
    return;
  }
  DataBindingManager dm=getDataBindingManager();
  IMessageManager mm=getManagedForm().getMessageManager();
  ModelEditor modelEditor=(ModelEditor)getEditor();
  resetAllMessages(false);
  ModuleNode rootModuleNode=SemanticHelper.getRootModuleNode();
  getLookupHelper().resetModelNames(this);
  List<Assignment> constants=(List<Assignment>)constantTable.getInput();
  if (rootModuleNode != null) {
    List<Assignment> 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);
  }
  String symmetryType=null;
  for (int i=0; i < constants.size(); i++) {
    Assignment constant=(Assignment)constants.get(i);
    List<String> 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())) {
      modelEditor.addErrorMessage(constant.getLabel(),"String_Node_Str" + constant.getLabel(),this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
      setComplete(false);
      expandSection(dm.getSectionForAttribute(MODEL_PARAMETER_CONSTANTS));
    }
 else {
      if (constant.isSetOfModelValues()) {
        TypedSet modelValuesSet=TypedSet.parseSet(constant.getRight());
        if (constant.isSymmetricalSet()) {
          boolean hasTwoTypes=false;
          String typeString=null;
          if (modelValuesSet.hasType()) {
            typeString=modelValuesSet.getType();
          }
 else {
            for (int j=0; j < modelValuesSet.getValues().length; j++) {
              String thisTypeString=TypedSet.getTypeOfId(modelValuesSet.getValues()[j]);
              if (thisTypeString != null) {
                if (typeString != null && !typeString.equals(thisTypeString)) {
                  hasTwoTypes=true;
                }
 else {
                  typeString=thisTypeString;
                }
              }
            }
          }
          if (hasTwoTypes || (symmetryType != null && typeString != null && !typeString.equals(symmetryType))) {
            modelEditor.addErrorMessage(constant.getLabel(),"String_Node_Str",this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
            setComplete(false);
            expandSection(dm.getSectionForAttribute(MODEL_PARAMETER_CONSTANTS));
          }
 else {
            if (typeString != null) {
              symmetryType=typeString;
            }
          }
        }
        if (modelValuesSet.getValueCount() > 0) {
          List<String> 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)) {
              modelEditor.addErrorMessage(value,"String_Node_Str" + value + "String_Node_Str",this.getId(),IMessageProvider.ERROR,widget);
              setComplete(false);
            }
          }
        }
 else {
          modelEditor.addErrorMessage(constant.getLabel(),"String_Node_Str",this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
          setComplete(false);
        }
      }
    }
    if (SemanticHelper.isConfigFileKeyword(constant.getLabel())) {
      modelEditor.addErrorMessage(constant.getLabel(),"String_Node_Str" + constant.getLabel() + "String_Node_Str",this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
      setComplete(false);
    }
  }
  for (int i=0; i < constants.size(); i++) {
    Assignment constant=(Assignment)constants.get(i);
    List<String> values=Arrays.asList(constant.getParams());
    validateUsage(MODEL_PARAMETER_CONSTANTS,values,"String_Node_Str","String_Node_Str","String_Node_Str",false);
  }
  int number=workers.getSelection();
  if (number > Runtime.getRuntime().availableProcessors()) {
    modelEditor.addErrorMessage("String_Node_Str","String_Node_Str" + number + "String_Node_Str"+ Runtime.getRuntime().availableProcessors()+ "String_Node_Str",this.getId(),IMessageProvider.WARNING,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_NUMBER_OF_WORKERS)));
    expandSection(SEC_HOW_TO_RUN);
  }
  try {
    final int defaultMaxHeapSize=TLCUIActivator.getDefault().getPreferenceStore().getInt(ITLCPreferenceConstants.I_TLC_MAXIMUM_HEAP_SIZE_DEFAULT);
    final int legacyValue=getConfig().getAttribute(LAUNCH_MAX_HEAP_SIZE,defaultMaxHeapSize);
    if (legacyValue == 500) {
      getConfig().setAttribute(LAUNCH_MAX_HEAP_SIZE,TLCPreferenceInitializer.MAX_HEAP_SIZE_DEFAULT);
      maxHeapSize.setSelection(TLCPreferenceInitializer.MAX_HEAP_SIZE_DEFAULT);
    }
 else     if (legacyValue >= 100) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str" + legacyValue + "String_Node_Str",this.getId(),IMessageProvider.WARNING,maxHeapSize);
      setComplete(false);
      expandSection(SEC_HOW_TO_RUN);
    }
  }
 catch (  CoreException e) {
    TLCUIActivator.getDefault().logWarning("String_Node_Str",e);
  }
  int maxHeapSizeValue=maxHeapSize.getSelection();
  double x=maxHeapSizeValue / 100d;
  float y=(float)linearInterpolator.interpolate(x);
  maxHeapSize.setBackground(new Color(Display.getDefault(),new RGB(120 * y,1 - y,1f)));
  updateCheckpoints();
  if (checkpointButton.getSelection()) {
    if (EMPTY_STRING.equals(checkpointIdText.getText())) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),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);
      if (!noSpecRadio.getSelection()) {
        setSpecSelection(MODEL_BEHAVIOR_TYPE_NO_SPEC);
        dm.getSection(dm.getSectionForAttribute(MODEL_BEHAVIOR_NO_SPEC)).markDirty();
      }
    }
 else {
      setHasVariables(true);
    }
  }
  Section whatToCheckSection=dm.getSection(SEC_WHAT_TO_CHECK).getSection();
  if (noSpecRadio.getSelection()) {
    whatToCheckSection.setExpanded(false);
    whatToCheckSection.setEnabled(false);
  }
 else {
    whatToCheckSection.setExpanded(true);
    whatToCheckSection.setEnabled(true);
  }
  if (closedFormulaRadio.getSelection() && specSource.getDocument().get().trim().equals("String_Node_Str")) {
    modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),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")) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),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")) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_NEXT)));
      setComplete(false);
      expandSection(dm.getSectionForAttribute(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_NEXT));
    }
  }
  boolean distributed=this.distributedButton.getSelection();
  this.distributedScriptText.setEnabled(distributed);
  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();
  ModelEditor modelEditor=(ModelEditor)getEditor();
  ModuleNode rootModuleNode=SemanticHelper.getRootModuleNode();
  getLookupHelper().resetModelNames(this);
  List<Assignment> constants=(List<Assignment>)constantTable.getInput();
  if (rootModuleNode != null) {
    List<Assignment> 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);
  }
  String symmetryType=null;
  for (int i=0; i < constants.size(); i++) {
    Assignment constant=(Assignment)constants.get(i);
    List<String> 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())) {
      modelEditor.addErrorMessage(constant.getLabel(),"String_Node_Str" + constant.getLabel(),this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
      setComplete(false);
      expandSection(dm.getSectionForAttribute(MODEL_PARAMETER_CONSTANTS));
    }
 else {
      modelEditor.removeErrorMessage(constant.getLabel(),UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
      if (constant.isSetOfModelValues()) {
        TypedSet modelValuesSet=TypedSet.parseSet(constant.getRight());
        if (constant.isSymmetricalSet()) {
          boolean hasTwoTypes=false;
          String typeString=null;
          if (modelValuesSet.hasType()) {
            typeString=modelValuesSet.getType();
          }
 else {
            for (int j=0; j < modelValuesSet.getValues().length; j++) {
              String thisTypeString=TypedSet.getTypeOfId(modelValuesSet.getValues()[j]);
              if (thisTypeString != null) {
                if (typeString != null && !typeString.equals(thisTypeString)) {
                  hasTwoTypes=true;
                }
 else {
                  typeString=thisTypeString;
                }
              }
            }
          }
          if (hasTwoTypes || (symmetryType != null && typeString != null && !typeString.equals(symmetryType))) {
            modelEditor.addErrorMessage(constant.getLabel(),"String_Node_Str",this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
            setComplete(false);
            expandSection(dm.getSectionForAttribute(MODEL_PARAMETER_CONSTANTS));
          }
 else {
            if (typeString != null) {
              symmetryType=typeString;
            }
          }
        }
        if (modelValuesSet.getValueCount() > 0) {
          List<String> 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)) {
              modelEditor.addErrorMessage(value,"String_Node_Str" + value + "String_Node_Str",this.getId(),IMessageProvider.ERROR,widget);
              setComplete(false);
            }
          }
        }
 else {
          modelEditor.addErrorMessage(constant.getLabel(),"String_Node_Str",this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
          setComplete(false);
        }
      }
    }
    if (SemanticHelper.isConfigFileKeyword(constant.getLabel())) {
      modelEditor.addErrorMessage(constant.getLabel(),"String_Node_Str" + constant.getLabel() + "String_Node_Str",this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_PARAMETER_CONSTANTS)));
      setComplete(false);
    }
  }
  for (int i=0; i < constants.size(); i++) {
    Assignment constant=(Assignment)constants.get(i);
    List<String> values=Arrays.asList(constant.getParams());
    validateUsage(MODEL_PARAMETER_CONSTANTS,values,"String_Node_Str","String_Node_Str","String_Node_Str",false);
  }
  int number=workers.getSelection();
  if (number > Runtime.getRuntime().availableProcessors()) {
    modelEditor.addErrorMessage("String_Node_Str","String_Node_Str" + number + "String_Node_Str"+ Runtime.getRuntime().availableProcessors()+ "String_Node_Str",this.getId(),IMessageProvider.WARNING,UIHelper.getWidget(dm.getAttributeControl(LAUNCH_NUMBER_OF_WORKERS)));
    expandSection(SEC_HOW_TO_RUN);
  }
  try {
    final int defaultMaxHeapSize=TLCUIActivator.getDefault().getPreferenceStore().getInt(ITLCPreferenceConstants.I_TLC_MAXIMUM_HEAP_SIZE_DEFAULT);
    final int legacyValue=getConfig().getAttribute(LAUNCH_MAX_HEAP_SIZE,defaultMaxHeapSize);
    if (legacyValue == 500) {
      getConfig().setAttribute(LAUNCH_MAX_HEAP_SIZE,TLCPreferenceInitializer.MAX_HEAP_SIZE_DEFAULT);
      maxHeapSize.setSelection(TLCPreferenceInitializer.MAX_HEAP_SIZE_DEFAULT);
    }
 else     if (legacyValue >= 100) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str" + legacyValue + "String_Node_Str",this.getId(),IMessageProvider.WARNING,maxHeapSize);
      setComplete(false);
      expandSection(SEC_HOW_TO_RUN);
    }
  }
 catch (  CoreException e) {
    TLCUIActivator.getDefault().logWarning("String_Node_Str",e);
  }
  int maxHeapSizeValue=maxHeapSize.getSelection();
  double x=maxHeapSizeValue / 100d;
  float y=(float)linearInterpolator.interpolate(x);
  maxHeapSize.setBackground(new Color(Display.getDefault(),new RGB(120 * y,1 - y,1f)));
  updateCheckpoints();
  if (checkpointButton.getSelection()) {
    if (EMPTY_STRING.equals(checkpointIdText.getText())) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),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);
      if (!noSpecRadio.getSelection()) {
        setSpecSelection(MODEL_BEHAVIOR_TYPE_NO_SPEC);
        dm.getSection(dm.getSectionForAttribute(MODEL_BEHAVIOR_NO_SPEC)).markDirty();
      }
    }
 else {
      setHasVariables(true);
    }
  }
  Section whatToCheckSection=dm.getSection(SEC_WHAT_TO_CHECK).getSection();
  if (noSpecRadio.getSelection()) {
    whatToCheckSection.setExpanded(false);
    whatToCheckSection.setEnabled(false);
  }
 else {
    whatToCheckSection.setExpanded(true);
    whatToCheckSection.setEnabled(true);
  }
  if (closedFormulaRadio.getSelection() && specSource.getDocument().get().trim().equals("String_Node_Str")) {
    modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),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")) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),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")) {
      modelEditor.addErrorMessage("String_Node_Str","String_Node_Str",this.getId(),IMessageProvider.ERROR,UIHelper.getWidget(dm.getAttributeControl(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_NEXT)));
      setComplete(false);
      expandSection(dm.getSectionForAttribute(MODEL_BEHAVIOR_SEPARATE_SPECIFICATION_NEXT));
    }
  }
  boolean distributed=this.distributedButton.getSelection();
  this.distributedScriptText.setEnabled(distributed);
  mm.setAutoUpdate(true);
  super.validatePage(switchToErrorPage);
}