Program: 143637
Project: 143637
Buggy source:
public IDataRenderer createPortalRenderer(IApplication app,Portal objToRender,Form dataProviderLookup,IScriptExecuter listner,boolean printing,ControllerUndoManager undoManager) throws Exception {
  List<IPersist> allObjectsAsList=objToRender.getAllObjectsAsList();
  List<IFormElement> formElements=new ArrayList<IFormElement>(allObjectsAsList.size());
  for (  IPersist persist : allObjectsAsList) {
    if (persist instanceof IFormElement) {
      formElements.add((IFormElement)persist);
    }
  }
  List<IFormElement> children=new SortedList<IFormElement>(new Comparator<IFormElement>(){
    public int compare(    IFormElement o1,    IFormElement o2){
      int result=-PositionComparator.XY_PERSIST_COMPARATOR.compare(o1,o2);
      if (result == 0) {
        return (o1.getFormIndex() - o2.getFormIndex());
      }
      return result;
    }
  }
,formElements);
  Iterator<IFormElement> e1=children.iterator();
  Map emptyDataRenderers=new LinkedHashMap();
  DataRenderer dr=null;
  int height=objToRender.getRowHeight();
  boolean calculateHeight=(height == 0);
  if (height == 0)   height=100;
  boolean showSelection=objToRender.getShowVerticalLines();
  dr=(DataRenderer)getEmptyDataRenderer(ComponentFactory.getWebID(dataProviderLookup,objToRender),"String_Node_Str" + objToRender.getName(),app,showSelection);
  setBasicSettings(dr,objToRender.getBackground(),new Dimension(objToRender.getSize().width,height),new Point(0,0),printing);
  emptyDataRenderers.put(new Boolean(true),dr);
  dr.setLocation(objToRender.getLocation());
  Border b=ComponentFactoryHelper.createBorder(objToRender.getBorderType());
  Insets ins=new Insets(0,0,0,0);
  if (b != null) {
    ins=b.getBorderInsets(null);
  }
  placeElements(e1,app,dataProviderLookup,listner,emptyDataRenderers,objToRender.getSize().width,-(objToRender.getLocation().x + ins.right),-ins.top,printing,true,undoManager,true,null);
  int biggest_width=10;
  int biggest_height=calculateHeight ? 0 : height;
  Component[] comps=dr.getComponents();
  boolean hasRowBGColorCalc=objToRender.getRowBGColorCalculation() != null;
  for (  Component element : comps) {
    int w=element.getLocation().x + element.getSize().width;
    if (w > biggest_width)     biggest_width=w;
    if (hasRowBGColorCalc && element instanceof JComponent)     ((JComponent)element).setOpaque(false);
    if (calculateHeight) {
      int h=element.getLocation().y + element.getSize().height;
      if (h > biggest_height)       biggest_height=h;
    }
  }
  dr.setSize(new Dimension(biggest_width,biggest_height));
  dr.setPreferredSize(new Dimension(biggest_width,biggest_height));
  if (printing) {
    addSpringsBetweenComponents(app,dr);
  }
  return dr;
}

Fixed version (ground truth):
public IDataRenderer createPortalRenderer(IApplication app,Portal objToRender,Form dataProviderLookup,IScriptExecuter listner,boolean printing,ControllerUndoManager undoManager) throws Exception {
  List<IPersist> allObjectsAsList=objToRender.getAllObjectsAsList();
  List<IFormElement> formElements=new ArrayList<IFormElement>(allObjectsAsList.size());
  for (  IPersist persist : allObjectsAsList) {
    if (persist instanceof IFormElement) {
      formElements.add((IFormElement)persist);
    }
  }
  List<IFormElement> children=new SortedList<IFormElement>(new Comparator<IFormElement>(){
    public int compare(    IFormElement o1,    IFormElement o2){
      int result=-PositionComparator.XY_PERSIST_COMPARATOR.compare(o1,o2);
      if (result == 0) {
        return (o1.getFormIndex() - o2.getFormIndex());
      }
      return result;
    }
  }
,formElements);
  Iterator<IFormElement> e1=children.iterator();
  Map emptyDataRenderers=new LinkedHashMap();
  DataRenderer dr=null;
  int height=objToRender.getRowHeight();
  boolean calculateHeight=(height == 0);
  if (height == 0)   height=100;
  boolean showSelection=objToRender.getShowVerticalLines();
  dr=(DataRenderer)getEmptyDataRenderer(ComponentFactory.getWebID(dataProviderLookup,objToRender),"String_Node_Str" + objToRender.getName(),app,showSelection);
  setBasicSettings(dr,objToRender.getBackground(),new Dimension(objToRender.getSize().width,height),new Point(0,0),printing);
  emptyDataRenderers.put(new Boolean(true),dr);
  dr.setLocation(objToRender.getLocation());
  Border b=ComponentFactoryHelper.createBorder(objToRender.getBorderType());
  Insets ins=new Insets(0,0,0,0);
  if (b != null) {
    ins=ComponentFactoryHelper.getBorderInsetsForNoComponent(b);
  }
  placeElements(e1,app,dataProviderLookup,listner,emptyDataRenderers,objToRender.getSize().width,-(objToRender.getLocation().x + ins.right),-ins.top,printing,true,undoManager,true,null);
  int biggest_width=10;
  int biggest_height=calculateHeight ? 0 : height;
  Component[] comps=dr.getComponents();
  boolean hasRowBGColorCalc=objToRender.getRowBGColorCalculation() != null;
  for (  Component element : comps) {
    int w=element.getLocation().x + element.getSize().width;
    if (w > biggest_width)     biggest_width=w;
    if (hasRowBGColorCalc && element instanceof JComponent)     ((JComponent)element).setOpaque(false);
    if (calculateHeight) {
      int h=element.getLocation().y + element.getSize().height;
      if (h > biggest_height)       biggest_height=h;
    }
  }
  dr.setSize(new Dimension(biggest_width,biggest_height));
  dr.setPreferredSize(new Dimension(biggest_width,biggest_height));
  if (printing) {
    addSpringsBetweenComponents(app,dr);
  }
  return dr;
}