Program: 74814
Project: 74814
Buggy source:
/** 
 * Assign all non-Ptalon pararamters of the specified non-Ptalon actor their corresponding value.
 * @param actor The actor that contains these parameters.
 * @exception PtalonRuntimeException If thrown trying to access the parameter,or if unable to set the token for the corresponding paramter.
 */
public void assignNonPtalonParameters(ComponentEntity actor) throws PtalonRuntimeException {
  try {
    PtParser parser=new PtParser();
    ParseTreeEvaluator _parseTreeEvaluator=new ParseTreeEvaluator();
    for (    String boolParam : _parameters.keySet()) {
      String expression=_parameters.get(boolParam);
      if (expression == null) {
        throw new PtalonRuntimeException("String_Node_Str" + boolParam);
      }
      try {
        Parameter parameter=(Parameter)actor.getAttribute(boolParam);
        if (parameter == null) {
          String uniqueName=actor.uniqueName(boolParam);
          parameter=new Parameter(actor,uniqueName);
        }
        ASTPtRootNode _parseTree=parser.generateParseTree(expression);
        Token result=_parseTreeEvaluator.evaluateParseTree(_parseTree,_scope);
        parameter.setToken(result);
      }
 catch (      ClassCastException e) {
        AbstractSettableAttribute parameter=(AbstractSettableAttribute)actor.getAttribute(boolParam);
        parameter.setExpression(expression);
      }
    }
  }
 catch (  Exception e) {
    throw new PtalonRuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Assign all non-Ptalon pararamters of the specified non-Ptalon actor their corresponding value.
 * @param actor The actor that contains these parameters.
 * @exception PtalonRuntimeException If thrown trying to access the parameter,or if unable to set the token for the corresponding paramter.
 */
public void assignNonPtalonParameters(ComponentEntity actor) throws PtalonRuntimeException {
  try {
    PtParser parser=new PtParser();
    ParseTreeEvaluator _parseTreeEvaluator=new ParseTreeEvaluator();
    for (    String boolParam : _parameters.keySet()) {
      String expression=_parameters.get(boolParam);
      if (expression == null) {
        throw new PtalonRuntimeException("String_Node_Str" + boolParam);
      }
      ASTPtRootNode parseTree=parser.generateParseTree(expression);
      try {
        Parameter parameter=(Parameter)actor.getAttribute(boolParam);
        if (parameter == null) {
          String uniqueName=actor.uniqueName(boolParam);
          parameter=new Parameter(actor,uniqueName);
        }
        Token result=_parseTreeEvaluator.evaluateParseTree(parseTree,_scope);
        parameter.setToken(result);
      }
 catch (      ClassCastException e) {
        AbstractSettableAttribute parameter=(AbstractSettableAttribute)actor.getAttribute(boolParam);
        ParseTreeFreeVariableCollector collector=new ParseTreeFreeVariableCollector();
        Set expressionVariables=collector.collectFreeVariables(parseTree);
        Set scopeVariables=_scope.identifierSet();
        List excludedVariables=new LinkedList();
        for (        Object variable : expressionVariables) {
          if (variable instanceof String) {
            if (!scopeVariables.contains(variable)) {
              excludedVariables.add(variable);
            }
          }
        }
        ParseTreeSpecializer specializer=new ParseTreeSpecializer();
        parseTree=specializer.specialize(parseTree,excludedVariables,_scope);
        ParseTreeWriter writer=new ParseTreeWriter();
        String outputExpression=writer.printParseTree(parseTree);
        parameter.setExpression(outputExpression);
      }
    }
  }
 catch (  Exception e) {
    throw new PtalonRuntimeException("String_Node_Str",e);
  }
}