Program: 75427
Project: 75427
Buggy source:
private SymbolicScheduleElement _expandAPGAN(PSDFGraph graph,ptolemy.graph.Node node,PSDFAPGANStrategy apgan){
  PSDFGraph childGraph=(PSDFGraph)apgan.getSubgraph(node);
  try {
    if (childGraph == null) {
      PSDFNodeWeight weight=(PSDFNodeWeight)node.getWeight();
      SymbolicFiring firing=new SymbolicFiring((Actor)weight.getComputation(),"String_Node_Str");
      return firing;
    }
 else {
      Schedule schedule=new Schedule();
      Edge edge=(Edge)childGraph.edges().iterator().next();
      ptolemy.graph.Node source=edge.source();
      ptolemy.graph.Node sink=edge.sink();
      SymbolicScheduleElement first=_expandAPGAN(childGraph,source,apgan);
      SymbolicScheduleElement second=_expandAPGAN(childGraph,sink,apgan);
      String producedExpression=apgan.producedExpression(edge);
      String consumedExpression=apgan.consumedExpression(edge);
      if (producedExpression == null) {
        throw new RuntimeException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ edge);
      }
 else       if (consumedExpression == null) {
        throw new RuntimeException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ edge);
      }
      String denominator=PSDFGraphs.gcdExpression(producedExpression,consumedExpression);
      String firstIterations="String_Node_Str" + consumedExpression + "String_Node_Str"+ denominator+ "String_Node_Str";
      String secondIterations="String_Node_Str" + producedExpression + "String_Node_Str"+ denominator+ "String_Node_Str";
      first.setIterationCount(firstIterations);
      second.setIterationCount(secondIterations);
      SymbolicSchedule symbolicSchedule=new SymbolicSchedule("String_Node_Str");
      symbolicSchedule.add((ScheduleElement)first);
      symbolicSchedule.add((ScheduleElement)second);
      Iterator edges=childGraph.edges().iterator();
      while (edges.hasNext()) {
        Edge nextEdge=(Edge)edges.next();
        PSDFEdgeWeight weight=(PSDFEdgeWeight)nextEdge.getWeight();
        IOPort sourcePort=weight.getSourcePort();
        List relationList=sourcePort.linkedRelationList();
        if (relationList.size() != 1) {
          throw new RuntimeException("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + relationList.size() + "String_Node_Str"+ nextEdge+ "String_Node_Str");
        }
        Iterator relations=relationList.iterator();
        Relation relation=(Relation)relations.next();
        String produced=apgan.producedExpression(nextEdge);
        String consumed=apgan.consumedExpression(nextEdge);
        String bufferSizeExpression="String_Node_Str" + produced + "String_Node_Str"+ consumed+ "String_Node_Str"+ PSDFGraphs.gcdExpression(produced,consumed);
        _bufferSizeMap.put(relation,bufferSizeExpression);
      }
      return symbolicSchedule;
    }
  }
 catch (  Exception exception) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str" + exception.getMessage());
  }
}

Fixed version (ground truth):
private SymbolicScheduleElement _expandAPGAN(PSDFGraph graph,ptolemy.graph.Node node,PSDFAPGANStrategy apgan){
  PSDFGraph childGraph=(PSDFGraph)apgan.getSubgraph(node);
  try {
    if (childGraph == null) {
      PSDFNodeWeight weight=(PSDFNodeWeight)node.getWeight();
      SymbolicFiring firing=new SymbolicFiring((Actor)weight.getComputation(),"String_Node_Str");
      return firing;
    }
 else {
      Schedule schedule=new Schedule();
      Edge edge=(Edge)childGraph.edges().iterator().next();
      ptolemy.graph.Node source=edge.source();
      ptolemy.graph.Node sink=edge.sink();
      SymbolicScheduleElement first=_expandAPGAN(childGraph,source,apgan);
      SymbolicScheduleElement second=_expandAPGAN(childGraph,sink,apgan);
      String producedExpression=apgan.producedExpression(edge);
      String consumedExpression=apgan.consumedExpression(edge);
      if (producedExpression == null) {
        throw new RuntimeException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ edge);
      }
 else       if (consumedExpression == null) {
        throw new RuntimeException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ edge);
      }
      String denominator=PSDFGraphs.gcdExpression(producedExpression,consumedExpression);
      String firstIterations="String_Node_Str" + consumedExpression + "String_Node_Str"+ denominator+ "String_Node_Str";
      String secondIterations="String_Node_Str" + producedExpression + "String_Node_Str"+ denominator+ "String_Node_Str";
      first.setIterationCount(firstIterations);
      second.setIterationCount(secondIterations);
      SymbolicSchedule symbolicSchedule=new SymbolicSchedule("String_Node_Str");
      symbolicSchedule.add((ScheduleElement)first);
      symbolicSchedule.add((ScheduleElement)second);
      Iterator edges=childGraph.edges().iterator();
      while (edges.hasNext()) {
        Edge nextEdge=(Edge)edges.next();
        PSDFEdgeWeight weight=(PSDFEdgeWeight)nextEdge.getWeight();
        IOPort sourcePort=weight.getSourcePort();
        List relationList=sourcePort.linkedRelationList();
        if (relationList.size() != 1) {
          throw new RuntimeException("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + relationList.size() + "String_Node_Str"+ nextEdge+ "String_Node_Str");
        }
        Iterator relations=relationList.iterator();
        Relation relation=(Relation)relations.next();
        String produced=apgan.producedExpression(nextEdge);
        String consumed=apgan.consumedExpression(nextEdge);
        String bufferSizeExpression="String_Node_Str" + produced + "String_Node_Str"+ consumed+ "String_Node_Str"+ PSDFGraphs.gcdExpression(produced,consumed);
        _debug("String_Node_Str" + bufferSizeExpression + "String_Node_Str"+ relation.getName()+ "String_Node_Str");
        _bufferSizeMap.put(relation,bufferSizeExpression);
      }
      return symbolicSchedule;
    }
  }
 catch (  Exception exception) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str" + exception.getMessage());
  }
}