Program: 73136
Project: 73136
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){
  _layoutInProgress=true;
  long overallTime=System.currentTimeMillis();
  _report("String_Node_Str");
  long graphOverhead=overallTime;
  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);
  }
  try {
    Parameters parameters=new Parameters(_compositeEntity);
    parameters.configureLayout(parentLayout,getLayoutTarget().getGraphModel());
    _createGraph(composite,parentNode);
    graphOverhead=System.currentTimeMillis() - graphOverhead;
    InstancePool<AbstractLayoutProvider> layouterPool=_getLayouterPool();
    AbstractLayoutProvider layoutProvider=layouterPool.fetch();
    IKielerProgressMonitor progressMonitor=new BasicProgressMonitor();
    layoutProvider.doLayout(parentNode,progressMonitor);
    if (DEBUG) {
      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();
    _applyLayout(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);
  }
  _layoutInProgress=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);
  long overallTime=System.currentTimeMillis();
  _report("String_Node_Str");
  long graphOverhead=overallTime;
  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);
  }
  try {
    Parameters parameters=new Parameters(_compositeEntity);
    parameters.configureLayout(parentLayout,getLayoutTarget().getGraphModel());
    _createGraph(composite,parentNode);
    graphOverhead=System.currentTimeMillis() - graphOverhead;
    InstancePool<AbstractLayoutProvider> layouterPool=_getLayouterPool();
    AbstractLayoutProvider layoutProvider=layouterPool.fetch();
    IKielerProgressMonitor progressMonitor=new BasicProgressMonitor();
    layoutProvider.doLayout(parentNode,progressMonitor);
    if (DEBUG) {
      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();
    _applyLayout(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);
}