Program: 74906
Project: 74906
Buggy source:
/** 
 * Evaluate the first child, and depending on its (boolean) result, evaluate either the second or the third child. The result of that evaluation becomes the result of the specified node.
 * @param node The specified node.
 * @exception IllegalActionException If an parse error occurs.
 */
public void visitFunctionalIfNode(ASTPtFunctionalIfNode node) throws IllegalActionException {
  if (node.isConstant() && node.isEvaluated()) {
    _evaluatedChildToken=node.getToken();
    _fireCode.append(_evaluatedChildToken.toString());
    return;
  }
  int numChildren=node.jjtGetNumChildren();
  if (numChildren != 3) {
    throw new InternalErrorException("String_Node_Str" + "String_Node_Str");
  }
  _evaluateChild(node,0);
  ptolemy.data.Token test=_evaluatedChildToken;
  if (!(test instanceof BooleanToken)) {
    throw new IllegalActionException("String_Node_Str" + test.toString() + "String_Node_Str"+ test.getClass().getName());
  }
  boolean value=((BooleanToken)test).booleanValue();
  if (_typeInference == null) {
    _typeInference=new ParseTreeTypeInference();
  }
  ASTPtRootNode tokenChild;
  ASTPtRootNode typeChild;
  if (value) {
    tokenChild=(ASTPtRootNode)node.jjtGetChild(1);
    typeChild=(ASTPtRootNode)node.jjtGetChild(2);
  }
 else {
    tokenChild=(ASTPtRootNode)node.jjtGetChild(2);
    typeChild=(ASTPtRootNode)node.jjtGetChild(1);
  }
  tokenChild.visit(this);
  ptolemy.data.Token token=_evaluatedChildToken;
  Type type=_typeInference.inferTypes(typeChild,_scope);
  Type conversionType=(Type)TypeLattice.lattice().leastUpperBound(type,token.getType());
  token=conversionType.convert(token);
  _evaluatedChildToken=(token);
  if (node.isConstant()) {
    node.setToken(_evaluatedChildToken);
  }
}

Fixed version (ground truth):
/** 
 * Evaluate the first child, and depending on its (boolean) result, evaluate either the second or the third child. The result of that evaluation becomes the result of the specified node.
 * @param node The specified node.
 * @exception IllegalActionException If an parse error occurs.
 */
public void visitFunctionalIfNode(ASTPtFunctionalIfNode node) throws IllegalActionException {
  if (node.isConstant() && node.isEvaluated()) {
    _evaluatedChildToken=node.getToken();
    _fireCode.append(_evaluatedChildToken.toString());
    return;
  }
  int numChildren=node.jjtGetNumChildren();
  if (numChildren != 3) {
    throw new InternalErrorException("String_Node_Str" + "String_Node_Str");
  }
  _evaluateChild(node,0);
  ptolemy.data.Token test=_evaluatedChildToken;
  if (!(test instanceof BooleanToken)) {
    throw new IllegalActionException("String_Node_Str" + (test == null ? "String_Node_Str" : "String_Node_Str" + test.toString() + "String_Node_Str"+ test.getClass().getName()));
  }
  boolean value=((BooleanToken)test).booleanValue();
  if (_typeInference == null) {
    _typeInference=new ParseTreeTypeInference();
  }
  ASTPtRootNode tokenChild;
  ASTPtRootNode typeChild;
  if (value) {
    tokenChild=(ASTPtRootNode)node.jjtGetChild(1);
    typeChild=(ASTPtRootNode)node.jjtGetChild(2);
  }
 else {
    tokenChild=(ASTPtRootNode)node.jjtGetChild(2);
    typeChild=(ASTPtRootNode)node.jjtGetChild(1);
  }
  tokenChild.visit(this);
  ptolemy.data.Token token=_evaluatedChildToken;
  Type type=_typeInference.inferTypes(typeChild,_scope);
  Type conversionType=(Type)TypeLattice.lattice().leastUpperBound(type,token.getType());
  token=conversionType.convert(token);
  _evaluatedChildToken=(token);
  if (node.isConstant()) {
    node.setToken(_evaluatedChildToken);
  }
}