Program: 60080
Project: 60080
Buggy source:
/** 
 * Builds the layout/renderer tree from scratch. Note: Returned dimension needs to be actual size needed for rendered content, not the available container size. This is relied upon by table layout.
 * @param desiredWidth the desired width
 * @param desiredHeight the desired height
 * @param paddingInsets the padding insets
 * @param yLimit If other than -1, <code>layout</code> will throw <code>SizeExceededException</code> in the event that the layout goes beyond this y-coordinate point.
 * @param floatBounds the float bounds
 * @param sizeOnly the size only
 */
public void layout(int desiredWidth,int desiredHeight,Insets paddingInsets,int yLimit,FloatingBounds floatBounds,boolean sizeOnly){
  if (!SwingUtilities.isEventDispatchThread() && logger.isEnabled(Level.INFO)) {
    logger.warn("String_Node_Str");
  }
  RenderableContainer container=this.container;
  this.paddingInsets=paddingInsets;
  this.yLimit=yLimit;
  this.desiredHeight=desiredHeight;
  this.desiredWidth=desiredWidth;
  this.floatBounds=floatBounds;
  this.isFloatLimit=null;
  this.pendingFloats=null;
  this.sizeOnly=sizeOnly;
  this.lastSeqBlock=null;
  this.currentCollapsibleMargin=this.initCollapsibleMargin();
  this.maxX=paddingInsets.left;
  this.maxY=paddingInsets.top;
  int availw=desiredWidth - paddingInsets.left - paddingInsets.right;
  if (availw < 0) {
    availw=0;
  }
  int availh=desiredHeight - paddingInsets.top - paddingInsets.bottom;
  if (availh == 0) {
    availh=0;
  }
  this.availContentHeight=availh;
  this.availContentWidth=availw;
  this.layoutPass((DOMNodeImpl)this.modelNode);
  Collection delayedPairs=container.getDelayedPairs();
  if (delayedPairs != null && delayedPairs.size() > 0) {
    Iterator i=delayedPairs.iterator();
    while (i.hasNext()) {
      DelayedPair pair=(DelayedPair)i.next();
      if (pair.containingBlock == container) {
        this.importDelayedPair(pair);
      }
    }
  }
  int maxY=this.maxY;
  int maxYWholeBlock=maxY;
  BoundableRenderable lastSeqBlock=this.lastSeqBlock;
  if (lastSeqBlock != null) {
    int effBlockHeight=this.getEffectiveBlockHeight(lastSeqBlock);
    if (lastSeqBlock.getY() + effBlockHeight > maxY) {
      this.maxY=maxY=lastSeqBlock.getY() + effBlockHeight;
      maxYWholeBlock=lastSeqBlock.getY() + lastSeqBlock.getHeight();
    }
  }
  RLine lastLine=this.currentLine;
  Rectangle lastBounds=lastLine.getBounds();
  if (lastBounds.height > 0 || lastBounds.y > maxYWholeBlock) {
    int lastTopX=lastBounds.x + lastBounds.width;
    if (lastTopX > this.maxX) {
      this.maxX=lastTopX;
    }
    int lastTopY=lastBounds.y + lastBounds.height;
    if (lastTopY > maxY) {
      this.maxY=maxY=lastTopY;
    }
  }
  SortedSet<PositionedRenderable> posRenderables=this.positionedRenderables;
  if (posRenderables != null) {
    boolean isFloatLimit=this.isFloatLimit();
    Iterator<PositionedRenderable> i=posRenderables.iterator();
    while (i.hasNext()) {
      PositionedRenderable pr=i.next();
      BoundableRenderable br=pr.getRenderable();
      if (br.getX() + br.getWidth() > this.maxX) {
        this.maxX=br.getX() + br.getWidth();
      }
      if (isFloatLimit || !pr.isFloat()) {
        if (br.getY() + br.getHeight() > maxY) {
          this.maxY=maxY=br.getY() + br.getHeight();
        }
      }
    }
  }
  this.width=paddingInsets.right + this.maxX;
  this.height=paddingInsets.bottom + maxY;
}

Fixed version (ground truth):
/** 
 * Builds the layout/renderer tree from scratch. Note: Returned dimension needs to be actual size needed for rendered content, not the available container size. This is relied upon by table layout.
 * @param desiredWidth the desired width
 * @param desiredHeight the desired height
 * @param paddingInsets the padding insets
 * @param yLimit If other than -1, <code>layout</code> will throw <code>SizeExceededException</code> in the event that the layout goes beyond this y-coordinate point.
 * @param floatBounds the float bounds
 * @param sizeOnly the size only
 */
public void layout(int desiredWidth,int desiredHeight,Insets paddingInsets,int yLimit,FloatingBounds floatBounds,boolean sizeOnly){
  if (!SwingUtilities.isEventDispatchThread() && logger.isEnabled(Level.INFO)) {
    logger.warn("String_Node_Str");
  }
  RenderableContainer container=this.container;
  this.paddingInsets=paddingInsets;
  this.yLimit=yLimit;
  this.desiredHeight=desiredHeight;
  this.desiredWidth=desiredWidth;
  this.floatBounds=floatBounds;
  this.isFloatLimit=null;
  this.pendingFloats=null;
  this.sizeOnly=sizeOnly;
  this.lastSeqBlock=null;
  this.currentCollapsibleMargin=this.initCollapsibleMargin();
  this.maxX=paddingInsets.left;
  this.maxY=paddingInsets.top;
  int availw=desiredWidth - paddingInsets.left - paddingInsets.right;
  if (availw < 0) {
    availw=0;
  }
  int availh=desiredHeight - paddingInsets.top - paddingInsets.bottom;
  if (availh < 0) {
    availh=0;
  }
  this.availContentHeight=availh;
  this.availContentWidth=availw;
  this.layoutPass((DOMNodeImpl)this.modelNode);
  Collection delayedPairs=container.getDelayedPairs();
  if (delayedPairs != null && delayedPairs.size() > 0) {
    Iterator i=delayedPairs.iterator();
    while (i.hasNext()) {
      DelayedPair pair=(DelayedPair)i.next();
      if (pair.containingBlock == container) {
        this.importDelayedPair(pair);
      }
    }
  }
  int maxY=this.maxY;
  int maxYWholeBlock=maxY;
  BoundableRenderable lastSeqBlock=this.lastSeqBlock;
  if (lastSeqBlock != null) {
    int effBlockHeight=this.getEffectiveBlockHeight(lastSeqBlock);
    if (lastSeqBlock.getY() + effBlockHeight > maxY) {
      this.maxY=maxY=lastSeqBlock.getY() + effBlockHeight;
      maxYWholeBlock=lastSeqBlock.getY() + lastSeqBlock.getHeight();
    }
  }
  RLine lastLine=this.currentLine;
  Rectangle lastBounds=lastLine.getBounds();
  if (lastBounds.height > 0 || lastBounds.y > maxYWholeBlock) {
    int lastTopX=lastBounds.x + lastBounds.width;
    if (lastTopX > this.maxX) {
      this.maxX=lastTopX;
    }
    int lastTopY=lastBounds.y + lastBounds.height;
    if (lastTopY > maxY) {
      this.maxY=maxY=lastTopY;
    }
  }
  SortedSet<PositionedRenderable> posRenderables=this.positionedRenderables;
  if (posRenderables != null) {
    boolean isFloatLimit=this.isFloatLimit();
    Iterator<PositionedRenderable> i=posRenderables.iterator();
    while (i.hasNext()) {
      PositionedRenderable pr=i.next();
      BoundableRenderable br=pr.getRenderable();
      if (br.getX() + br.getWidth() > this.maxX) {
        this.maxX=br.getX() + br.getWidth();
      }
      if (isFloatLimit || !pr.isFloat()) {
        if (br.getY() + br.getHeight() > maxY) {
          this.maxY=maxY=br.getY() + br.getHeight();
        }
      }
    }
  }
  this.width=paddingInsets.right + this.maxX;
  this.height=paddingInsets.bottom + maxY;
}