Program: 72465
Project: 72465
Buggy source:
/** 
 * Layout the given composite. Main entry point for the layout action. Create a KIELER KGraph data structure corresponding to the Ptolemy model, instantiate a KIELER layout algorithm (AbstractLayoutProvider) and run its doLayout() method on the KGraph. The KGraph is augmented with layout information (position and sizes of objects and bend points for connections). This information is then reapplied to the ptolemy model by stating MoMLChangeRequests with location attributes for nodes. Connection bend points are applied using   {@link LayoutHint}s.
 * @param composite the container of the diagram in terms of a GraphModel.
 */
@Override public void layout(Object composite){
  KielerLayoutConnector.setLayoutInProgress(true);
  KielerLayoutArcConnector.setLayoutInProgress(true);
  long overallTime=System.currentTimeMillis();
  _report("String_Node_Str");
  long graphOverhead=overallTime;
  _graphModel=getLayoutTarget().getGraphModel();
  KNode parentNode=KimlUtil.createInitializedNode();
  KShapeLayout parentLayout=parentNode.getData(KShapeLayout.class);
  if (_top != null) {
    Dimension contentSize=_top.getContentSize();
    parentLayout.setWidth(contentSize.width);
    parentLayout.setHeight(contentSize.height);
  }
  KNode mainModelNode=parentNode;
  KShapeLayout mainModelLayout=parentLayout;
  if (_graphModel instanceof FSMGraphModel) {
    mainModelNode=_createFsmSkeleton(parentNode);
    mainModelLayout=mainModelNode.getData(KShapeLayout.class);
  }
  try {
    Parameters parameters=new Parameters(_compositeEntity);
    parameters.configureLayout(mainModelLayout,getLayoutTarget().getGraphModel());
    _createGraph(composite,mainModelNode);
    graphOverhead=System.currentTimeMillis() - graphOverhead;
    InstancePool<AbstractLayoutProvider> layouterPool=_getLayouterPool();
    AbstractLayoutProvider layoutProvider=layouterPool.fetch();
    IKielerProgressMonitor progressMonitor=new BasicProgressMonitor();
    _recursivelyLayout(parentNode,layoutProvider,progressMonitor);
    if (DEBUG) {
      KimlUtil.persistDataElements(parentNode);
      KielerGraphUtil._writeToFile(parentNode);
    }
    KVector offset=KielerGraphUtil._getUpperLeftCorner(parentNode);
    parentLayout.setXpos(parentLayout.getXpos() - (float)offset.x);
    parentLayout.setYpos(parentLayout.getYpos() - (float)offset.y);
    long momlRequestOverhead=System.currentTimeMillis();
    _recursivelyApplyLayout(parentNode);
    momlRequestOverhead=System.currentTimeMillis() - momlRequestOverhead;
    overallTime=System.currentTimeMillis() - overallTime;
    _report("String_Node_Str" + overallTime + "String_Node_Str"+ graphOverhead+ "String_Node_Str"+ Math.round(progressMonitor.getExecutionTime() * 1000)+ "String_Node_Str"+ momlRequestOverhead+ "String_Node_Str");
    layouterPool.release(layoutProvider);
  }
 catch (  IllegalActionException exception) {
    throw new InternalErrorException(exception);
  }
  KielerLayoutConnector.setLayoutInProgress(false);
  KielerLayoutArcConnector.setLayoutInProgress(false);
}

Fixed version (ground truth):
/** 
 * Layout the given composite. Main entry point for the layout action. Create a KIELER KGraph data structure corresponding to the Ptolemy model, instantiate a KIELER layout algorithm (AbstractLayoutProvider) and run its doLayout() method on the KGraph. The KGraph is augmented with layout information (position and sizes of objects and bend points for connections). This information is then reapplied to the ptolemy model by stating MoMLChangeRequests with location attributes for nodes. Connection bend points are applied using   {@link LayoutHint}s.
 * @param composite the container of the diagram in terms of a GraphModel.
 */
@Override public void layout(Object composite){
  KielerLayoutConnector.setLayoutInProgress(true);
  KielerLayoutArcConnector.setLayoutInProgress(true);
  long overallTime=System.currentTimeMillis();
  _report("String_Node_Str");
  long graphOverhead=overallTime;
  _graphModel=getLayoutTarget().getGraphModel();
  KNode parentNode=KimlUtil.createInitializedNode();
  KShapeLayout parentLayout=parentNode.getData(KShapeLayout.class);
  if (_top != null) {
    Dimension contentSize=_top.getContentSize();
    parentLayout.setWidth(contentSize.width);
    parentLayout.setHeight(contentSize.height);
  }
  KNode mainModelNode=parentNode;
  KShapeLayout mainModelLayout=parentLayout;
  if (_graphModel instanceof FSMGraphModel) {
    mainModelNode=_createFsmSkeleton(parentNode);
    mainModelLayout=mainModelNode.getData(KShapeLayout.class);
  }
  try {
    Parameters parameters=new Parameters(_compositeEntity);
    parameters.configureLayout(mainModelLayout,getLayoutTarget().getGraphModel());
    _createGraph(composite,mainModelNode);
    graphOverhead=System.currentTimeMillis() - graphOverhead;
    InstancePool<AbstractLayoutProvider> layouterPool=_getLayouterPool();
    AbstractLayoutProvider layoutProvider=layouterPool.fetch();
    IKielerProgressMonitor progressMonitor=new BasicProgressMonitor();
    _recursivelyLayout(parentNode,layoutProvider,progressMonitor);
    if (DEBUG) {
      KimlUtil.persistDataElements(parentNode);
      KielerGraphUtil._writeToFile(parentNode);
    }
    KVector offset=KielerGraphUtil._getUpperLeftCorner(parentNode);
    parentLayout.setXpos(parentLayout.getXpos() - (float)offset.x);
    parentLayout.setYpos(parentLayout.getYpos() - (float)offset.y);
    long momlRequestOverhead=System.currentTimeMillis();
    ApplyLayoutRequest layoutRequest=new ApplyLayoutRequest(_compositeEntity);
    _recursivelyApplyLayout(parentNode,layoutRequest);
    _compositeEntity.requestChange(layoutRequest);
    momlRequestOverhead=System.currentTimeMillis() - momlRequestOverhead;
    overallTime=System.currentTimeMillis() - overallTime;
    _report("String_Node_Str" + overallTime + "String_Node_Str"+ graphOverhead+ "String_Node_Str"+ Math.round(progressMonitor.getExecutionTime() * 1000)+ "String_Node_Str"+ momlRequestOverhead+ "String_Node_Str");
    layouterPool.release(layoutProvider);
  }
 catch (  IllegalActionException exception) {
    throw new InternalErrorException(exception);
  }
  KielerLayoutConnector.setLayoutInProgress(false);
  KielerLayoutArcConnector.setLayoutInProgress(false);
}