Program: 73841
Project: 73841
Buggy source:
/** 
 * Generate code for putting tokens from the receiver.
 * @param sourcePort The source port.
 * @param offset The offset of the port.
 * @param token The token.    
 * @return The generated put code.
 * @exception IllegalActionException If thrown while getting the component,getting the adapter, getting the director or getting the port reference.
 */
public String generatePutCode(IOPort sourcePort,String offset,String token) throws IllegalActionException {
  TypedIOPort port=(TypedIOPort)getComponent().getContainer();
  int channel=port.getChannelForReceiver(getComponent());
  NamedProgramCodeGeneratorAdapter containingActorAdapter=(NamedProgramCodeGeneratorAdapter)getAdapter(getComponent().getContainer().getContainer());
  ProgramCodeGeneratorAdapter.Channel source=new Channel(sourcePort,0);
  ProgramCodeGeneratorAdapter.Channel sink=new Channel(port,channel);
  token=((NamedProgramCodeGeneratorAdapter)getAdapter(getComponent().getContainer().getContainer())).getTemplateParser().generateTypeConvertStatement(source,sink,0,token);
  token=_removeSink(token);
  boolean forComposite=_forComposite;
  if (getComponent().getContainer().getContainer() instanceof ModularCodeGenTypedCompositeActor && port.isInput()) {
    forComposite=false;
  }
  return _getDirectorForReceiver().getReference(port,new String[]{Integer.toString(channel),offset},forComposite,true,containingActorAdapter) + "String_Node_Str" + token+ "String_Node_Str"+ _eol;
}

Fixed version (ground truth):
/** 
 * Generate code for putting tokens from the receiver.
 * @param sourcePort The source port.
 * @param offset The offset of the port.
 * @param token The token.    
 * @return The generated put code.
 * @exception IllegalActionException If thrown while getting the component,getting the adapter, getting the director or getting the port reference.
 */
public String generatePutCode(IOPort sourcePort,String offset,String token) throws IllegalActionException {
  TypedIOPort port=(TypedIOPort)getComponent().getContainer();
  int channel=port.getChannelForReceiver(getComponent());
  NamedProgramCodeGeneratorAdapter containingActorAdapter=(NamedProgramCodeGeneratorAdapter)getAdapter(getComponent().getContainer().getContainer());
  ProgramCodeGeneratorAdapter.Channel source=new Channel(sourcePort,0);
  ProgramCodeGeneratorAdapter.Channel sink=new Channel(port,channel);
  token=((NamedProgramCodeGeneratorAdapter)getAdapter(getComponent().getContainer().getContainer())).getTemplateParser().generateTypeConvertStatement(source,sink,0,token);
  token=_removeSink(token);
  boolean forComposite=_forComposite;
  if (getComponent().getContainer().getContainer() instanceof ModularCodeGenTypedCompositeActor && port.isInput()) {
    forComposite=false;
  }
  String result=null;
  try {
    result=_getDirectorForReceiver().getReference(port,new String[]{Integer.toString(channel),offset},forComposite,true,containingActorAdapter) + "String_Node_Str" + token+ "String_Node_Str"+ _eol;
  }
 catch (  Exception ex) {
    result=_getExecutiveDirectorForReceiver().getReference(port,new String[]{Integer.toString(channel),offset},forComposite,true,containingActorAdapter) + "String_Node_Str" + token+ "String_Node_Str"+ _eol;
  }
  return result;
}