Program: 136032
Project: 136032
Buggy source:
/** 
 * Fill data into the view This includes loading expressions into the trace explorer table.
 * @param modelName name of the model displayed in the view title section
 * @param problems a list of  {@link TLCError} objects representing the errors.
 * @param isTraceExplorerData true if the new error data is from a run of the trace explorer
 */
protected void fill(String modelName,List problems,boolean isTraceExplorerData){
  try {
    traceExplorerComposite.getTableViewer().setInput(new Vector());
    FormHelper.setSerializedInput(traceExplorerComposite.getTableViewer(),configFileHandle.getAttribute(IModelConfigurationConstants.TRACE_EXPLORE_EXPRESSIONS,new Vector()));
  }
 catch (  CoreException e) {
    TLCUIActivator.logError("String_Node_Str",e);
  }
  if (problems != null && !problems.isEmpty()) {
    List states=null;
    StringBuffer buffer=new StringBuffer();
    for (int i=0; i < problems.size(); i++) {
      TLCError error=(TLCError)problems.get(i);
      if (!isTraceExplorerData) {
        appendError(buffer,error);
      }
 else       if (error.getErrorCode() != EC.TLC_INVARIANT_VIOLATED_BEHAVIOR && error.getErrorCode() != EC.TLC_TEMPORAL_PROPERTY_VIOLATED) {
        buffer.append("String_Node_Str");
        appendError(buffer,error);
      }
      if (error.hasTrace()) {
        Assert.isTrue(states == null,"String_Node_Str");
        states=error.getStates();
      }
    }
    if (states == null) {
      states=EMPTY_LIST();
    }
    List oldStates=(List)variableViewer.getInput();
    boolean isNewTrace=states != null && oldStates != null && !(states == oldStates);
    if (isNewTrace) {
      setDiffInfo(states);
    }
    if (!isTraceExplorerData || !(buffer.length() == 0)) {
      IDocument document=errorViewer.getDocument();
      try {
        document.replace(0,document.getLength(),buffer.toString());
      }
 catch (      BadLocationException e) {
        TLCUIActivator.logError("String_Node_Str" + buffer.toString(),e);
      }
    }
    if (isNewTrace) {
      this.variableViewer.setInput(states);
      traceExplorerComposite.changeExploreEnablement(true);
    }
    if (states != null && !states.isEmpty()) {
      variableViewer.expandToLevel(2);
    }
    this.form.setText(modelName);
  }
 else {
    clear();
  }
}

Fixed version (ground truth):
/** 
 * Fill data into the view This includes loading expressions into the trace explorer table.
 * @param modelName name of the model displayed in the view title section
 * @param problems a list of  {@link TLCError} objects representing the errors.
 * @param isTraceExplorerData true if the new error data is from a run of the trace explorer
 */
protected void fill(String modelName,List problems,boolean isTraceExplorerData){
  try {
    traceExplorerComposite.getTableViewer().setInput(new Vector());
    FormHelper.setSerializedInput(traceExplorerComposite.getTableViewer(),configFileHandle.getAttribute(IModelConfigurationConstants.TRACE_EXPLORE_EXPRESSIONS,new Vector()));
  }
 catch (  CoreException e) {
    TLCUIActivator.logError("String_Node_Str",e);
  }
  if (problems != null && !problems.isEmpty()) {
    List states=null;
    StringBuffer buffer=new StringBuffer();
    for (int i=0; i < problems.size(); i++) {
      TLCError error=(TLCError)problems.get(i);
      if (!isTraceExplorerData) {
        appendError(buffer,error);
      }
 else       if (error.getErrorCode() != EC.TLC_INVARIANT_VIOLATED_BEHAVIOR && error.getErrorCode() != EC.TLC_TEMPORAL_PROPERTY_VIOLATED) {
        appendError(buffer,error);
      }
      if (error.hasTrace()) {
        Assert.isTrue(states == null,"String_Node_Str");
        states=error.getStates();
      }
    }
    if (states == null) {
      states=EMPTY_LIST();
    }
    List oldStates=(List)variableViewer.getInput();
    boolean isNewTrace=states != null && oldStates != null && !(states == oldStates);
    if (isNewTrace) {
      setDiffInfo(states);
    }
    if (!isTraceExplorerData || buffer.length() > 0) {
      IDocument document=errorViewer.getDocument();
      try {
        if (isTraceExplorerData) {
          buffer.append("String_Node_Str");
        }
        document.replace(0,document.getLength(),buffer.toString());
      }
 catch (      BadLocationException e) {
        TLCUIActivator.logError("String_Node_Str" + buffer.toString(),e);
      }
    }
    if (isNewTrace) {
      this.variableViewer.setInput(states);
      traceExplorerComposite.changeExploreEnablement(true);
    }
    if (states != null && !states.isEmpty()) {
      variableViewer.expandToLevel(2);
    }
    this.form.setText(modelName);
  }
 else {
    clear();
  }
}