Program: 75956
Project: 75956
Buggy source:
/** 
 * Evaluate the current expression to a token. If this variable was last set directly with a token, then do nothing. In other words, the expression is evaluated only if the value of the token was most recently given by an expression.  The expression is also evaluated if any of the variables it refers to have changed since the last evaluation.  If the value of this variable changes due to this evaluation, then notify all value dependents and notify the container (if there is one) by calling its attributeChanged() and attributeTypeChanged() methods, as appropriate. An exception is thrown if the expression is illegal, for example if a parse error occurs or if there is a dependency loop. <p> If evaluation results in a token that is not of the same type as the current type of the variable, then the type of the variable is changed, unless the new type is incompatible with statically specified types (setTypeEquals() and setTypeAtMost()). If the type is changed, the attributeTypeChanged() method of the container is called.  The container can reject the change by throwing an exception. <p> Part of this method is read-synchronized on the workspace.
 * @exception IllegalActionException If the expression cannotbe parsed or cannot be evaluated.
 */
protected void _evaluate() throws IllegalActionException {
  if (!_needsEvaluation)   return;
  if (_currentExpression == null || _currentExpression.equals("String_Node_Str")) {
    _setToken(null);
    return;
  }
  if (_dependencyLoop) {
    _dependencyLoop=false;
    throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + getFullName() + "String_Node_Str"+ _currentExpression);
  }
  _dependencyLoop=true;
  try {
    workspace().getReadAccess();
    _buildParseTree();
    Token result=_parseTree.evaluateParseTree();
    _dependencyLoop=false;
    _setTokenAndNotify(result);
  }
 catch (  IllegalActionException ex) {
    _needsEvaluation=true;
    throw ex;
  }
 finally {
    _dependencyLoop=false;
    workspace().doneReading();
  }
}

Fixed version (ground truth):
/** 
 * Evaluate the current expression to a token. If this variable was last set directly with a token, then do nothing. In other words, the expression is evaluated only if the value of the token was most recently given by an expression.  The expression is also evaluated if any of the variables it refers to have changed since the last evaluation.  If the value of this variable changes due to this evaluation, then notify all value dependents and notify the container (if there is one) by calling its attributeChanged() and attributeTypeChanged() methods, as appropriate. An exception is thrown if the expression is illegal, for example if a parse error occurs or if there is a dependency loop. <p> If evaluation results in a token that is not of the same type as the current type of the variable, then the type of the variable is changed, unless the new type is incompatible with statically specified types (setTypeEquals() and setTypeAtMost()). If the type is changed, the attributeTypeChanged() method of the container is called.  The container can reject the change by throwing an exception. <p> Part of this method is read-synchronized on the workspace.
 * @exception IllegalActionException If the expression cannotbe parsed or cannot be evaluated.
 */
private void _evaluate() throws IllegalActionException {
  if (_currentExpression == null || _currentExpression.equals("String_Node_Str")) {
    _setToken(null);
    return;
  }
  if (_dependencyLoop) {
    _dependencyLoop=false;
    throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + getFullName() + "String_Node_Str"+ _currentExpression);
  }
  _dependencyLoop=true;
  try {
    workspace().getReadAccess();
    _buildParseTree();
    Token result=_parseTree.evaluateParseTree();
    _dependencyLoop=false;
    _setTokenAndNotify(result);
  }
 catch (  IllegalActionException ex) {
    _needsEvaluation=true;
    throw ex;
  }
 finally {
    _dependencyLoop=false;
    workspace().doneReading();
  }
}