Program: 73323
Project: 73323
Buggy source:
/** 
 * Generate the initialize code. <p>Generate code that creates the container, actor and ports. <p>Generate code that connects the ports of the inner actor to the ports of the outer actor.
 * @return The initialize code of the containing composite actor.
 * @exception IllegalActionException If thrown while appending to thethe block or processing the macros.
 */
public String generateInitializeCode() throws IllegalActionException {
  StringBuffer code=new StringBuffer();
  String actorClassName=getComponent().getClass().getName();
  Iterator parameters=getComponent().attributeList(Settable.class).iterator();
  while (parameters.hasNext()) {
    Settable parameter=(Settable)parameters.next();
    if (!ptolemy.actor.gui.Configurer.isVisible(getComponent(),parameter)) {
      continue;
    }
    String parameterName=StringUtilities.sanitizeName(parameter.getName()).replaceAll("String_Node_Str","String_Node_Str");
    if (parameterName.equals("String_Node_Str")) {
      continue;
    }
    String parameterValue="String_Node_Str";
    if (parameter instanceof Variable && ((Variable)parameter).getToken() != null) {
      parameterValue=((Variable)parameter).getToken().toString();
      if (((Variable)parameter).isStringMode()) {
        if (parameterValue.startsWith("String_Node_Str") && parameterValue.endsWith("String_Node_Str")) {
          parameterValue=parameterValue.substring(1,parameterValue.length() - 1);
        }
      }
    }
 else {
      parameterValue=parameter.getExpression();
    }
    parameterValue=parameterValue.replaceAll("String_Node_Str","String_Node_Str");
    boolean privateParameter=false;
    try {
      getComponent().getClass().getField(parameterName);
    }
 catch (    NoSuchFieldException ex) {
      privateParameter=true;
      code.append("String_Node_Str" + _eol + "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ parameterName+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ parameter.getName()+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ parameterValue+ "String_Node_Str"+ _eol+ "String_Node_Str"+ actorClassName+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol);
    }
catch (    SecurityException ex2) {
      throw new IllegalActionException(getComponent(),ex2,"String_Node_Str" + parameterName + "String_Node_Str");
    }
    if (!privateParameter) {
      String setParameter="String_Node_Str";
      if (parameter instanceof Parameter) {
        setParameter="String_Node_Str" + parameterName + "String_Node_Str"+ actorClassName+ "String_Node_Str"+ parameterName+ "String_Node_Str"+ _eol+ "String_Node_Str"+ parameterName+ "String_Node_Str"+ parameterValue+ "String_Node_Str"+ _eol;
      }
 else {
        if (parameter instanceof ptolemy.kernel.util.StringAttribute) {
          setParameter="String_Node_Str" + parameterName + "String_Node_Str"+ actorClassName+ "String_Node_Str"+ parameterName+ "String_Node_Str"+ _eol+ "String_Node_Str"+ parameterName+ "String_Node_Str"+ parameterValue+ "String_Node_Str"+ _eol;
        }
      }
      code.append("String_Node_Str" + _eol + setParameter+ "String_Node_Str"+ actorClassName+ "String_Node_Str"+ parameterName+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol);
    }
  }
  String[] splitInitializeParameterCode=getCodeGenerator()._splitBody("String_Node_Str",code.toString());
  String result="String_Node_Str" + _eol + "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ splitInitializeParameterCode[0]+ splitInitializeParameterCode[1]+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol;
  return processCode(result);
}

Fixed version (ground truth):
/** 
 * Generate the initialize code. <p>Generate code that creates the container, actor and ports. <p>Generate code that connects the ports of the inner actor to the ports of the outer actor.
 * @return The initialize code of the containing composite actor.
 * @exception IllegalActionException If thrown while appending to thethe block or processing the macros.
 */
public String generateInitializeCode() throws IllegalActionException {
  StringBuffer code=new StringBuffer();
  String actorClassName=getComponent().getClass().getName();
  String[] splitInitializeParameterCode=getCodeGenerator()._splitBody("String_Node_Str",code.toString());
  String result="String_Node_Str" + _eol + "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ splitInitializeParameterCode[0]+ splitInitializeParameterCode[1]+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol;
  return processCode(result);
}