Program: 74384
Project: 74384
Buggy source:
/** 
 * Multiply the children of the specified node.
 * @param node The specified node.
 * @exception IllegalActionException If an parse error occurs.
 */
public void visitProductNode(ASTPtProductNode node) throws IllegalActionException {
  if (node.isConstant() && node.isEvaluated()) {
    _evaluatedChildToken=node.getToken();
    _childCode=_evaluatedChildToken.toString();
    return;
  }
  List lexicalTokenList=node.getLexicalTokenList();
  int numChildren=node.jjtGetNumChildren();
  _assert(numChildren > 0,node,"String_Node_Str");
  _assert(numChildren == (lexicalTokenList.size() + 1),node,"String_Node_Str" + "String_Node_Str");
  String result="String_Node_Str";
  ptolemy.data.Token childToken=_evaluateChild(node,0);
  result+=_childCode;
  for (int i=1; i < numChildren; i++) {
    Token operator=(Token)lexicalTokenList.get(i - 1);
    _evaluateChild(node,i);
    Type type1=((ASTPtRootNode)node.jjtGetChild(i - 1)).getType();
    Type type2=((ASTPtRootNode)node.jjtGetChild(i)).getType();
    if (operator.kind == PtParserConstants.MULTIPLY) {
      if (type1 != null && type2 != null) {
        result="String_Node_Str" + CodeGeneratorHelper.codeGenType(type1) + "String_Node_Str"+ CodeGeneratorHelper.codeGenType(type2)+ "String_Node_Str"+ result+ "String_Node_Str"+ _childCode+ "String_Node_Str";
      }
 else {
        result+="String_Node_Str" + _childCode;
      }
    }
 else     if (operator.kind == PtParserConstants.DIVIDE) {
      if (type1 != null && type2 != null) {
        result="String_Node_Str" + CodeGeneratorHelper.codeGenType(type1) + "String_Node_Str"+ CodeGeneratorHelper.codeGenType(type2)+ "String_Node_Str"+ result+ "String_Node_Str"+ _childCode+ "String_Node_Str";
      }
 else {
        result+="String_Node_Str" + _childCode;
      }
    }
 else     if (operator.kind == PtParserConstants.MODULO) {
      result+="String_Node_Str" + _childCode;
    }
    if (operator.kind == PtParserConstants.MULTIPLY) {
    }
 else     if (operator.kind == PtParserConstants.DIVIDE) {
    }
 else     if (operator.kind == PtParserConstants.MODULO) {
    }
 else {
      _assert(false,node,"String_Node_Str");
    }
  }
  _childCode="String_Node_Str" + result + "String_Node_Str";
  _evaluatedChildToken=(childToken);
}

Fixed version (ground truth):
/** 
 * Multiply the children of the specified node.
 * @param node The specified node.
 * @exception IllegalActionException If an parse error occurs.
 */
public void visitProductNode(ASTPtProductNode node) throws IllegalActionException {
  if (node.isConstant() && node.isEvaluated()) {
    _evaluatedChildToken=node.getToken();
    _childCode=_evaluatedChildToken.toString();
    return;
  }
  List lexicalTokenList=node.getLexicalTokenList();
  int numChildren=node.jjtGetNumChildren();
  _assert(numChildren > 0,node,"String_Node_Str");
  _assert(numChildren == (lexicalTokenList.size() + 1),node,"String_Node_Str" + "String_Node_Str");
  String result="String_Node_Str";
  ptolemy.data.Token childToken=_evaluateChild(node,0);
  result+=_childCode;
  Type resultType=((ASTPtRootNode)node.jjtGetChild(0)).getType();
  for (int i=1; i < numChildren; i++) {
    Token operator=(Token)lexicalTokenList.get(i - 1);
    _evaluateChild(node,i);
    Type type=((ASTPtRootNode)node.jjtGetChild(i)).getType();
    if (operator.kind == PtParserConstants.MULTIPLY) {
      if (type != null) {
        result="String_Node_Str" + CodeGeneratorHelper.codeGenType(resultType) + "String_Node_Str"+ CodeGeneratorHelper.codeGenType(type)+ "String_Node_Str"+ result+ "String_Node_Str"+ _childCode+ "String_Node_Str";
        resultType=resultType.multiply(type);
      }
 else {
        result+="String_Node_Str" + _childCode;
      }
    }
 else     if (operator.kind == PtParserConstants.DIVIDE) {
      if (type != null) {
        result="String_Node_Str" + CodeGeneratorHelper.codeGenType(resultType) + "String_Node_Str"+ CodeGeneratorHelper.codeGenType(type)+ "String_Node_Str"+ result+ "String_Node_Str"+ _childCode+ "String_Node_Str";
        resultType=resultType.divide(type);
      }
 else {
        result+="String_Node_Str" + _childCode;
      }
    }
 else     if (operator.kind == PtParserConstants.MODULO) {
      result+="String_Node_Str" + _childCode;
    }
    if (operator.kind == PtParserConstants.MULTIPLY) {
    }
 else     if (operator.kind == PtParserConstants.DIVIDE) {
    }
 else     if (operator.kind == PtParserConstants.MODULO) {
    }
 else {
      _assert(false,node,"String_Node_Str");
    }
  }
  _childCode="String_Node_Str" + result + "String_Node_Str";
  _evaluatedChildToken=(childToken);
}