Program: 70090
Project: 70090
Buggy source:
protected Dimension calculateMinimumSize(IFigure container,int wHint,int hHint){
  if (wHint > -1)   wHint=Math.max(0,wHint - container.getInsets().getWidth());
  if (hHint > -1)   hHint=Math.max(0,hHint - container.getInsets().getHeight());
  int maxWidth;
  maxWidth=wHint;
  hHint=-1;
  if (maxWidth < 0) {
    maxWidth=Integer.MAX_VALUE;
  }
  Dimension prefSize=new Dimension();
  List children=container.getChildren();
  int width=0;
  int height=0;
  IFigure child;
  IFigure lastChild=null;
  Dimension childSize;
  for (int i=0; i < children.size(); i++) {
    child=(IFigure)children.get(i);
    Insets fmargin=getFigureMargin(child);
    if (wHint != -1) {
      wHint=Math.max(0,wHint - fmargin.getWidth());
    }
    if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(layoutPreference) && child instanceof IFixLayoutHelper) {
      updateChild(child,wHint);
      int display=ReportItemConstraint.BLOCK;
      display=getDisplay(child);
      if (display == ReportItemConstraint.INLINE && child instanceof LabelFigure && (lastChild != null && getDisplay(lastChild) == ReportItemConstraint.INLINE)) {
        childSize=((IFixLayoutHelper)child).getFixMinimumSize(wHint - width - getMinorSpacing() <= 0 ? -1 : wHint - width - getMinorSpacing(),hHint);
      }
 else {
        childSize=((IFixLayoutHelper)child).getFixMinimumSize(wHint,hHint);
      }
    }
 else {
      childSize=child.getMinimumSize(wHint,hHint);
    }
    if (i == 0) {
      width=childSize.width + fmargin.getWidth();
      height=childSize.height + fmargin.getHeight();
    }
 else     if ((getDisplay(child) == ReportItemConstraint.NONE)) {
    }
 else     if ((width + childSize.width + fmargin.getWidth()+ getMinorSpacing() <= maxWidth) && ((getDisplay(child) == ReportItemConstraint.INLINE) && (getDisplay(lastChild) == ReportItemConstraint.INLINE))) {
      width+=childSize.width + fmargin.getWidth() + getMinorSpacing();
      height=Math.max(height,childSize.height + fmargin.getHeight());
    }
 else {
      prefSize.height+=height + getMajorSpacing();
      prefSize.width=Math.max(prefSize.width,width);
      width=childSize.width + fmargin.getWidth();
      height=childSize.height + fmargin.getHeight();
    }
    lastChild=child;
  }
  prefSize.height+=height;
  prefSize.width=Math.max(prefSize.width,width);
  prefSize.width+=container.getInsets().getWidth();
  prefSize.height+=container.getInsets().getHeight();
  prefSize.union(getBorderPreferredSize(container));
  return prefSize;
}

Fixed version (ground truth):
protected Dimension calculateMinimumSize(IFigure container,int wHint,int hHint){
  if (wHint > -1)   wHint=Math.max(0,wHint - container.getInsets().getWidth());
  if (hHint > -1)   hHint=Math.max(0,hHint - container.getInsets().getHeight());
  int maxWidth;
  maxWidth=wHint;
  hHint=-1;
  if (maxWidth < 0) {
    maxWidth=Integer.MAX_VALUE;
  }
  Dimension prefSize=new Dimension();
  List children=container.getChildren();
  int width=0;
  int height=0;
  IFigure child;
  IFigure lastChild=null;
  Dimension childSize;
  for (int i=0; i < children.size(); i++) {
    child=(IFigure)children.get(i);
    Insets fmargin=getFigureMargin(child);
    if (wHint != -1) {
      wHint=Math.max(0,wHint - fmargin.getWidth());
    }
    if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(layoutPreference) && child instanceof IFixLayoutHelper) {
      updateChild(child,wHint);
      int display=ReportItemConstraint.BLOCK;
      display=getDisplay(child);
      if (display == ReportItemConstraint.INLINE && child instanceof LabelFigure && (lastChild != null && getDisplay(lastChild) == ReportItemConstraint.INLINE)) {
        childSize=((IFixLayoutHelper)child).getFixMinimumSize(wHint - width - getMinorSpacing() <= 0 ? -1 : wHint - width - getMinorSpacing(),hHint);
        if (childSize.width == wHint - width - getMinorSpacing()) {
          childSize=((IFixLayoutHelper)child).getFixMinimumSize(-1,hHint);
        }
      }
 else {
        if (display == ReportItemConstraint.INLINE) {
          childSize=((IFixLayoutHelper)child).getFixMinimumSize(-1,hHint);
        }
 else {
          childSize=((IFixLayoutHelper)child).getFixMinimumSize(wHint,hHint);
        }
      }
    }
 else {
      childSize=child.getMinimumSize(wHint,hHint);
    }
    if (i == 0) {
      width=childSize.width + fmargin.getWidth();
      height=childSize.height + fmargin.getHeight();
    }
 else     if ((getDisplay(child) == ReportItemConstraint.NONE)) {
    }
 else     if ((width + childSize.width + fmargin.getWidth()+ getMinorSpacing() <= maxWidth) && ((getDisplay(child) == ReportItemConstraint.INLINE) && (getDisplay(lastChild) == ReportItemConstraint.INLINE))) {
      width+=childSize.width + fmargin.getWidth() + getMinorSpacing();
      height=Math.max(height,childSize.height + fmargin.getHeight());
    }
 else {
      if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(layoutPreference) && child instanceof IFixLayoutHelper) {
        int display=ReportItemConstraint.BLOCK;
        display=getDisplay(child);
        if (display == ReportItemConstraint.INLINE) {
          childSize=((IFixLayoutHelper)child).getFixMinimumSize(-1,hHint);
        }
 else {
          childSize=((IFixLayoutHelper)child).getFixMinimumSize(wHint,hHint);
        }
      }
      prefSize.height+=height + getMajorSpacing();
      prefSize.width=Math.max(prefSize.width,width);
      width=childSize.width + fmargin.getWidth();
      height=childSize.height + fmargin.getHeight();
    }
    lastChild=child;
  }
  prefSize.height+=height;
  prefSize.width=Math.max(prefSize.width,width);
  prefSize.width+=container.getInsets().getWidth();
  prefSize.height+=container.getInsets().getHeight();
  prefSize.union(getBorderPreferredSize(container));
  return prefSize;
}