Program: 74680
Project: 74680
Buggy source:
/** 
 * Set the action and notify the container that the action has changed by calling attributeChanged(), and notify any listeners that have been registered using addValueListener().
 * @param expression The action.
 * @exception IllegalActionException If the change is not acceptableto the container, or if the action is syntactically incorrect.
 * @see #getExpression
 */
public void setExpression(String expression) throws IllegalActionException {
  super.setExpression(expression);
  if ((expression == null) || expression.trim().equals("String_Node_Str")) {
    return;
  }
  _destinationNames=new LinkedList();
  _numbers=new LinkedList();
  _parseTrees=new LinkedList();
  _destinationsListVersion=-1;
  PtParser parser=new PtParser();
  Map map=parser.generateAssignmentMap(expression);
  for (Iterator names=map.keySet().iterator(); names.hasNext(); ) {
    String name=(String)names.next();
    ASTPtAssignmentNode node=(ASTPtAssignmentNode)map.get(name);
    String completeDestinationSpec=node.getIdentifier();
    int openParen=completeDestinationSpec.indexOf("String_Node_Str");
    if (openParen > 0) {
      int closeParen=completeDestinationSpec.indexOf("String_Node_Str");
      if (closeParen < openParen) {
        throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + completeDestinationSpec);
      }
      _destinationNames.add(completeDestinationSpec.substring(0,openParen).trim());
      String channelSpec=completeDestinationSpec.substring(openParen + 1,closeParen);
      try {
        _numbers.add(Integer.valueOf(channelSpec));
      }
 catch (      NumberFormatException ex) {
        throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + completeDestinationSpec);
      }
    }
 else {
      _destinationNames.add(completeDestinationSpec);
      _numbers.add(null);
    }
    _parseTrees.add(node.getExpressionTree());
  }
}

Fixed version (ground truth):
/** 
 * Set the action and notify the container that the action has changed by calling attributeChanged(), and notify any listeners that have been registered using addValueListener().
 * @param expression The action.
 * @exception IllegalActionException If the change is not acceptableto the container, or if the action is syntactically incorrect.
 * @see #getExpression
 */
public void setExpression(String expression) throws IllegalActionException {
  super.setExpression(expression);
  _destinationNames=new LinkedList();
  _numbers=new LinkedList();
  _parseTrees=new LinkedList();
  _destinationsListVersion=-1;
  if ((expression == null) || expression.trim().equals("String_Node_Str")) {
    return;
  }
  PtParser parser=new PtParser();
  Map map=parser.generateAssignmentMap(expression);
  for (Iterator names=map.keySet().iterator(); names.hasNext(); ) {
    String name=(String)names.next();
    ASTPtAssignmentNode node=(ASTPtAssignmentNode)map.get(name);
    String completeDestinationSpec=node.getIdentifier();
    int openParen=completeDestinationSpec.indexOf("String_Node_Str");
    if (openParen > 0) {
      int closeParen=completeDestinationSpec.indexOf("String_Node_Str");
      if (closeParen < openParen) {
        throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + completeDestinationSpec);
      }
      _destinationNames.add(completeDestinationSpec.substring(0,openParen).trim());
      String channelSpec=completeDestinationSpec.substring(openParen + 1,closeParen);
      try {
        _numbers.add(Integer.valueOf(channelSpec));
      }
 catch (      NumberFormatException ex) {
        throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + completeDestinationSpec);
      }
    }
 else {
      _destinationNames.add(completeDestinationSpec);
      _numbers.add(null);
    }
    _parseTrees.add(node.getExpressionTree());
  }
}