Program: 74075
Project: 74075
Buggy source:
/** 
 * Return the value or an expression in the target language for the specified parameter of the associated actor.  If the parameter is specified by an expression, then the expression will be parsed. If any parameter referenced in that expression is specified by another expression, the parsing continues recursively until either a parameter is directly specified by a constant or a parameter can be directly modified during execution in which case a reference to the parameter is generated.
 * @param name The name of the parameter.
 * @param container The container to search upwards from.
 * @return The value or expression as a string.
 * @exception IllegalActionException If the parameter does not exist ordoes not have a value.
 */
final public String getParameterValue(String name,NamedObj container) throws IllegalActionException {
  if (name.contains("String_Node_Str")) {
    name=processCode(name);
  }
  StringTokenizer tokenizer=new StringTokenizer(name,"String_Node_Str");
  String attributeName=tokenizer.nextToken().trim();
  String offset=null;
  String castType=null;
  if (tokenizer.hasMoreTokens()) {
    offset=tokenizer.nextToken().trim();
    if (tokenizer.hasMoreTokens()) {
      throw new IllegalActionException(getComponent(),name + "String_Node_Str" + "String_Node_Str");
    }
  }
  StringTokenizer tokenizer2=new StringTokenizer(attributeName,"String_Node_Str",false);
  if (tokenizer2.countTokens() != 1 && tokenizer2.countTokens() != 2) {
    throw new IllegalActionException(getComponent(),"String_Node_Str" + attributeName);
  }
  if (tokenizer2.countTokens() == 2) {
    castType=tokenizer2.nextToken().trim();
    attributeName=tokenizer2.nextToken().trim();
  }
  Attribute attribute=ModelScope.getScopedVariable(null,container,attributeName);
  if (attribute == null) {
    attribute=container.getAttribute(attributeName);
    if (attribute == null) {
      throw new IllegalActionException(container,"String_Node_Str" + name);
    }
  }
  if (offset == null) {
    if (attribute instanceof Variable) {
      Variable variable=(Variable)attribute;
      ParseTreeCodeGenerator parseTreeCodeGenerator=getParseTreeCodeGenerator();
      if (variable.isStringMode()) {
        return _generateTypeConvertMethod("String_Node_Str" + parseTreeCodeGenerator.escapeForTargetLanguage(variable.getExpression()) + "String_Node_Str",castType,"String_Node_Str");
      }
      PtParser parser=new PtParser();
      ASTPtRootNode parseTree=null;
      try {
        parseTree=parser.generateParseTree(variable.getExpression());
      }
 catch (      Throwable throwable) {
        throw new IllegalActionException(variable,throwable,"String_Node_Str" + name + "String_Node_Str"+ container+ "String_Node_Str");
      }
      try {
        parseTreeCodeGenerator.evaluateParseTree(parseTree,new VariableScope(variable));
      }
 catch (      Exception ex) {
        StringBuffer results=new StringBuffer();
        Iterator<?> allScopedVariableNames=ModelScope.getAllScopedVariableNames(variable,container).iterator();
        while (allScopedVariableNames.hasNext()) {
          results.append(allScopedVariableNames.next().toString() + "String_Node_Str");
        }
        throw new IllegalActionException(getComponent(),ex,"String_Node_Str" + variable.getFullName() + "String_Node_Str"+ results.toString());
      }
      String fireCode=processCode(parseTreeCodeGenerator.generateFireCode());
      return _generateTypeConvertMethod(fireCode,castType,codeGenType(variable.getType()));
    }
 else {
      return ((Settable)attribute).getExpression();
    }
  }
 else {
    if (attribute instanceof Parameter) {
      Token token=((Parameter)attribute).getToken();
      if (token instanceof ArrayToken) {
        Token element=((ArrayToken)token).getElement(Integer.valueOf(offset).intValue());
        ParseTreeCodeGenerator parseTreeCodeGenerator=getParseTreeCodeGenerator();
        PtParser parser=new PtParser();
        ASTPtRootNode parseTree=null;
        try {
          parseTree=parser.generateParseTree(element.toString());
        }
 catch (        Throwable throwable) {
          throw new IllegalActionException(attribute,throwable,"String_Node_Str" + name + "String_Node_Str"+ container+ "String_Node_Str");
        }
        parseTreeCodeGenerator.evaluateParseTree(parseTree,new VariableScope((Parameter)attribute));
        String elementCode=processCode(parseTreeCodeGenerator.generateFireCode());
        return _generateTypeConvertMethod(elementCode,castType,codeGenType(element.getType()));
      }
      throw new IllegalActionException(getComponent(),attributeName + "String_Node_Str");
    }
    throw new IllegalActionException(getComponent(),attributeName + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Return the value or an expression in the target language for the specified parameter of the associated actor.  If the parameter is specified by an expression, then the expression will be parsed. If any parameter referenced in that expression is specified by another expression, the parsing continues recursively until either a parameter is directly specified by a constant or a parameter can be directly modified during execution in which case a reference to the parameter is generated.
 * @param name The name of the parameter.
 * @param container The container to search upwards from.
 * @return The value or expression as a string.
 * @exception IllegalActionException If the parameter does not exist ordoes not have a value.
 */
final public String getParameterValue(String name,NamedObj container) throws IllegalActionException {
  if (name.contains("String_Node_Str")) {
    name=processCode(name);
  }
  StringTokenizer tokenizer=new StringTokenizer(name,"String_Node_Str");
  String attributeName=tokenizer.nextToken().trim();
  String offset=null;
  String castType=null;
  if (tokenizer.hasMoreTokens()) {
    offset=tokenizer.nextToken().trim();
    if (tokenizer.hasMoreTokens()) {
      throw new IllegalActionException(getComponent(),name + "String_Node_Str" + "String_Node_Str");
    }
  }
  StringTokenizer tokenizer2=new StringTokenizer(attributeName,"String_Node_Str",false);
  if (tokenizer2.countTokens() != 1 && tokenizer2.countTokens() != 2) {
    throw new IllegalActionException(getComponent(),"String_Node_Str" + attributeName);
  }
  if (tokenizer2.countTokens() == 2) {
    castType=tokenizer2.nextToken().trim();
    attributeName=tokenizer2.nextToken().trim();
  }
  Attribute attribute=ModelScope.getScopedVariable(null,container,attributeName);
  if (attribute == null) {
    attribute=container.getAttribute(attributeName);
    if (attribute == null) {
      throw new IllegalActionException(container,"String_Node_Str" + name);
    }
  }
  if (offset == null) {
    if (attribute instanceof Variable) {
      Variable variable=(Variable)attribute;
      ParseTreeCodeGenerator parseTreeCodeGenerator=getParseTreeCodeGenerator();
      if (variable.isStringMode()) {
        return generateTypeConvertMethod("String_Node_Str" + parseTreeCodeGenerator.escapeForTargetLanguage(variable.getExpression()) + "String_Node_Str",castType,"String_Node_Str");
      }
      PtParser parser=new PtParser();
      ASTPtRootNode parseTree=null;
      try {
        parseTree=parser.generateParseTree(variable.getExpression());
      }
 catch (      Throwable throwable) {
        throw new IllegalActionException(variable,throwable,"String_Node_Str" + name + "String_Node_Str"+ container+ "String_Node_Str");
      }
      try {
        parseTreeCodeGenerator.evaluateParseTree(parseTree,new VariableScope(variable));
      }
 catch (      Exception ex) {
        StringBuffer results=new StringBuffer();
        Iterator<?> allScopedVariableNames=ModelScope.getAllScopedVariableNames(variable,container).iterator();
        while (allScopedVariableNames.hasNext()) {
          results.append(allScopedVariableNames.next().toString() + "String_Node_Str");
        }
        throw new IllegalActionException(getComponent(),ex,"String_Node_Str" + variable.getFullName() + "String_Node_Str"+ results.toString());
      }
      String fireCode=processCode(parseTreeCodeGenerator.generateFireCode());
      return generateTypeConvertMethod(fireCode,castType,codeGenType(variable.getType()));
    }
 else {
      return ((Settable)attribute).getExpression();
    }
  }
 else {
    if (attribute instanceof Parameter) {
      Token token=((Parameter)attribute).getToken();
      if (token instanceof ArrayToken) {
        Token element=((ArrayToken)token).getElement(Integer.valueOf(offset).intValue());
        ParseTreeCodeGenerator parseTreeCodeGenerator=getParseTreeCodeGenerator();
        PtParser parser=new PtParser();
        ASTPtRootNode parseTree=null;
        try {
          parseTree=parser.generateParseTree(element.toString());
        }
 catch (        Throwable throwable) {
          throw new IllegalActionException(attribute,throwable,"String_Node_Str" + name + "String_Node_Str"+ container+ "String_Node_Str");
        }
        parseTreeCodeGenerator.evaluateParseTree(parseTree,new VariableScope((Parameter)attribute));
        String elementCode=processCode(parseTreeCodeGenerator.generateFireCode());
        return generateTypeConvertMethod(elementCode,castType,codeGenType(element.getType()));
      }
      throw new IllegalActionException(getComponent(),attributeName + "String_Node_Str");
    }
    throw new IllegalActionException(getComponent(),attributeName + "String_Node_Str");
  }
}