Program: 74145
Project: 74145
Buggy source:
/** 
 * This method creates port variables for the actor passed in as a parameter.
 * @param actor- Actor whose port variables need to be declared
 * @return
 * @throws IllegalActionException
 */
private String _generatePortVariableDeclarations(Actor actor) throws IllegalActionException {
  StringBuffer code=new StringBuffer();
  code.append("String_Node_Str" + _getActorName(actor) + "String_Node_Str"+ _eol);
  if (actor instanceof CompositeActor) {
    Director myDir=actor.getExecutiveDirector();
    if (myDir != null) {
      Iterator inputPorts=actor.inputPortList().iterator();
      while (inputPorts.hasNext()) {
        TypedIOPort inputPort=(TypedIOPort)inputPorts.next();
        code.append("String_Node_Str" + targetType(inputPort.getType()) + "String_Node_Str"+ generateName(inputPort)+ "String_Node_Str"+ targetType(inputPort.getType())+ "String_Node_Str"+ Integer.toHexString(_getThenIncrementCurrentSharedMemoryAddress(inputPort)));
        if (inputPort.isMultiport()) {
          code.append("String_Node_Str" + inputPort.getWidthInside() + "String_Node_Str");
        }
        int bufferSize=getBufferSize(inputPort);
        if (bufferSize > 1) {
          code.append("String_Node_Str" + bufferSize + "String_Node_Str");
        }
        code.append("String_Node_Str" + _eol);
      }
    }
  }
  Iterator outputPorts=actor.outputPortList().iterator();
  while (outputPorts.hasNext()) {
    TypedIOPort outputPort=(TypedIOPort)outputPorts.next();
    if (true) {
      code.append("String_Node_Str" + targetType(outputPort.getType()) + "String_Node_Str"+ generateName(outputPort)+ "String_Node_Str"+ targetType(outputPort.getType())+ "String_Node_Str"+ Integer.toHexString(_getThenIncrementCurrentSharedMemoryAddress(outputPort)));
      if (outputPort.isMultiport()) {
        code.append("String_Node_Str" + outputPort.getWidthInside() + "String_Node_Str");
      }
      int bufferSize=getBufferSize(outputPort);
      if (bufferSize > 1) {
        code.append("String_Node_Str" + bufferSize + "String_Node_Str");
      }
      code.append("String_Node_Str" + _eol);
    }
 else {
      System.out.println("String_Node_Str");
    }
  }
  return code.toString();
}

Fixed version (ground truth):
/** 
 * This method creates port variables for the actor passed in as a parameter.
 * @param actor- Actor whose port variables need to be declared
 * @return Port variables associated with this actor
 * @throws IllegalActionException
 */
private String _generatePortVariableDeclarations(Actor actor) throws IllegalActionException {
  StringBuffer code=new StringBuffer();
  code.append("String_Node_Str" + _getActorName(actor) + "String_Node_Str"+ _eol);
  if (actor instanceof CompositeActor) {
    Director myDir=actor.getExecutiveDirector();
    if (myDir != null) {
      Iterator inputPorts=actor.inputPortList().iterator();
      while (inputPorts.hasNext()) {
        TypedIOPort inputPort=(TypedIOPort)inputPorts.next();
        code.append("String_Node_Str" + targetType(inputPort.getType()) + "String_Node_Str"+ generateName(inputPort)+ "String_Node_Str"+ targetType(inputPort.getType())+ "String_Node_Str"+ Integer.toHexString(_getThenIncrementCurrentSharedMemoryAddress(inputPort)));
        if (inputPort.isMultiport()) {
          code.append("String_Node_Str" + inputPort.getWidthInside() + "String_Node_Str");
        }
        int bufferSize=getBufferSize(inputPort);
        if (bufferSize > 1) {
          code.append("String_Node_Str" + bufferSize + "String_Node_Str");
        }
        code.append("String_Node_Str" + _eol);
      }
    }
  }
  Iterator outputPorts=actor.outputPortList().iterator();
  while (outputPorts.hasNext()) {
    TypedIOPort outputPort=(TypedIOPort)outputPorts.next();
    if (true) {
      code.append("String_Node_Str" + targetType(outputPort.getType()) + "String_Node_Str"+ generateName(outputPort)+ "String_Node_Str"+ targetType(outputPort.getType())+ "String_Node_Str"+ Integer.toHexString(_getThenIncrementCurrentSharedMemoryAddress(outputPort)));
      if (outputPort.isMultiport()) {
        code.append("String_Node_Str" + outputPort.getWidthInside() + "String_Node_Str");
      }
      int bufferSize=getBufferSize(outputPort);
      if (bufferSize > 1) {
        code.append("String_Node_Str" + bufferSize + "String_Node_Str");
      }
      code.append("String_Node_Str" + _eol);
    }
 else {
      System.out.println("String_Node_Str");
    }
  }
  return code.toString();
}