Program: 69442
Project: 69442
Buggy source:
private SizeBasedContent createSizeBasedContent(ContainerArea area){
  SizeBasedContent sizeBasedContent=new SizeBasedContent();
  if (area.content instanceof AbstractContentWrapper) {
    sizeBasedContent.content=((AbstractContentWrapper)area.content).getContent();
  }
 else {
    sizeBasedContent.content=area.content;
  }
  if (area instanceof BlockTextArea) {
    BlockTextArea blockText=(BlockTextArea)area;
    sizeBasedContent.floatPos=0;
    ArrayList<BlockTextArea> list=(ArrayList<BlockTextArea>)area.content.getExtension(IContent.LAYOUT_EXTENSION);
    if (list.size() > 1) {
      Iterator<BlockTextArea> i=list.iterator();
      int offsetInContent=0;
      int lastHeight=0;
      while (i.hasNext()) {
        offsetInContent+=lastHeight;
        BlockTextArea current=i.next();
        if (current == area) {
          break;
        }
        lastHeight=current.getHeight();
      }
      sizeBasedContent.offsetInContent=offsetInContent;
    }
 else {
      sizeBasedContent.offsetInContent=0;
    }
    sizeBasedContent.dimension=blockText.getHeight();
    sizeBasedContent.width=blockText.getWidth();
  }
 else   if (area instanceof InlineTextArea) {
    InlineTextArea inlineText=(InlineTextArea)area;
    InlineTextExtension ext=(InlineTextExtension)area.content.getExtension(IContent.LAYOUT_EXTENSION);
    ext.updatePageHintInfo(inlineText);
    sizeBasedContent.floatPos=ext.getFloatPos();
    sizeBasedContent.offsetInContent=ext.getOffsetInContent();
    sizeBasedContent.dimension=ext.getDimension();
    sizeBasedContent.width=ext.getWidthRestrict();
  }
 else {
    sizeBasedContent.floatPos=0;
    sizeBasedContent.offsetInContent=0;
    sizeBasedContent.dimension=0;
    sizeBasedContent.width=0;
  }
  return sizeBasedContent;
}

Fixed version (ground truth):
private SizeBasedContent createSizeBasedContent(ContainerArea area){
  SizeBasedContent sizeBasedContent=new SizeBasedContent();
  if (area.content instanceof AbstractContentWrapper) {
    sizeBasedContent.content=((AbstractContentWrapper)area.content).getContent();
  }
 else {
    sizeBasedContent.content=area.content;
  }
  if (area instanceof BlockTextArea) {
    BlockTextArea blockText=(BlockTextArea)area;
    sizeBasedContent.floatPos=0;
    ArrayList<BlockTextArea> list=(ArrayList<BlockTextArea>)area.content.getExtension(IContent.LAYOUT_EXTENSION);
    if (list.size() > 1) {
      Iterator<BlockTextArea> i=list.iterator();
      int offsetInContent=0;
      int lastHeight=0;
      while (i.hasNext()) {
        offsetInContent+=lastHeight;
        BlockTextArea current=i.next();
        if (current == area) {
          break;
        }
        lastHeight=current.getHeight();
      }
      sizeBasedContent.offsetInContent=offsetInContent;
    }
 else {
      sizeBasedContent.offsetInContent=0;
    }
    sizeBasedContent.dimension=blockText.getHeight();
    sizeBasedContent.width=blockText.getWidth();
  }
 else   if (area instanceof InlineTextArea) {
    InlineTextArea inlineText=(InlineTextArea)area;
    InlineTextExtension ext=(InlineTextExtension)area.content.getExtension(IContent.LAYOUT_EXTENSION);
    ext.updatePageHintInfo(inlineText);
    sizeBasedContent.floatPos=ext.getFloatPos();
    sizeBasedContent.offsetInContent=ext.getOffsetInContent();
    sizeBasedContent.dimension=ext.getDimension();
    sizeBasedContent.width=ext.getWidthRestrict();
  }
 else {
    sizeBasedContent.floatPos=-1;
    sizeBasedContent.offsetInContent=-1;
    sizeBasedContent.dimension=-1;
    sizeBasedContent.width=-1;
  }
  return sizeBasedContent;
}