Program: 72910
Project: 72910
Buggy source:
protected void writeReportItem(DataOutputStream out,ReportItemDesign design) throws IOException {
  writeStyledElement(out,design);
  DimensionType x=design.getX();
  if (x != null) {
    IOUtil.writeShort(out,FIELD_X);
    writeDimension(out,x);
  }
  DimensionType y=design.getY();
  if (y != null) {
    IOUtil.writeShort(out,FIELD_Y);
    writeDimension(out,y);
  }
  DimensionType height=design.getHeight();
  if (height != null) {
    IOUtil.writeShort(out,FIELD_HEIGHT);
    writeDimension(out,height);
  }
  DimensionType width=design.getWidth();
  if (width != null) {
    IOUtil.writeShort(out,FIELD_WIDTH);
    writeDimension(out,width);
  }
  String bookmark=design.getBookmark();
  if (bookmark != null) {
    IOUtil.writeShort(out,FIELD_BOOKMARK);
    IOUtil.writeString(out,bookmark);
  }
  String toc=design.getTOC();
  if (toc != null) {
    IOUtil.writeShort(out,FIELD_TOC);
    IOUtil.writeString(out,toc);
  }
  ScriptExpression onCreateScriptExpr=design.getOnCreate();
  if (onCreateScriptExpr != null) {
    IOUtil.writeShort(out,FIELD_ON_CREATE);
    IOUtil.writeString(out,onCreateScriptExpr.getScriptText());
  }
  ScriptExpression onRenderScriptExpr=design.getOnRender();
  if (onRenderScriptExpr != null) {
    IOUtil.writeShort(out,FIELD_ON_RENDER);
    IOUtil.writeString(out,onRenderScriptExpr.getScriptText());
  }
  ScriptExpression onPageBreakScriptExpr=design.getOnPageBreak();
  if (onPageBreakScriptExpr != null) {
    IOUtil.writeShort(out,FIELD_ON_PAGE_BREAK);
    IOUtil.writeString(out,onPageBreakScriptExpr.getScriptText());
  }
  VisibilityDesign visibility=design.getVisibility();
  if (visibility != null) {
    IOUtil.writeShort(out,FIELD_VISIBILITY);
    writeVisibility(out,visibility);
  }
  ActionDesign action=design.getAction();
  if (action != null) {
    IOUtil.writeShort(out,FIELD_ACTION);
    writeAction(out,action);
  }
  boolean useCachedResult=design.useCachedResult();
  if (useCachedResult) {
    IOUtil.writeShort(out,FIELD_USE_CACHED_RESULT);
    IOUtil.writeBool(out,useCachedResult);
  }
}

Fixed version (ground truth):
protected void writeReportItem(DataOutputStream out,ReportItemDesign design) throws IOException {
  writeStyledElement(out,design);
  DimensionType x=design.getX();
  if (x != null) {
    IOUtil.writeShort(out,FIELD_X);
    writeDimension(out,x);
  }
  DimensionType y=design.getY();
  if (y != null) {
    IOUtil.writeShort(out,FIELD_Y);
    writeDimension(out,y);
  }
  DimensionType height=design.getHeight();
  if (height != null) {
    IOUtil.writeShort(out,FIELD_HEIGHT);
    writeDimension(out,height);
  }
  DimensionType width=design.getWidth();
  if (width != null) {
    IOUtil.writeShort(out,FIELD_WIDTH);
    writeDimension(out,width);
  }
  String bookmark=design.getBookmark();
  if (bookmark != null) {
    IOUtil.writeShort(out,FIELD_BOOKMARK);
    IOUtil.writeString(out,bookmark);
  }
  String toc=design.getTOC();
  if (toc != null) {
    IOUtil.writeShort(out,FIELD_TOC);
    IOUtil.writeString(out,toc);
  }
  ScriptExpression onCreateScriptExpr=design.getOnCreate();
  if (onCreateScriptExpr != null) {
    IOUtil.writeShort(out,FIELD_ON_CREATE);
    IOUtil.writeString(out,onCreateScriptExpr.getScriptText());
  }
  ScriptExpression onRenderScriptExpr=design.getOnRender();
  if (onRenderScriptExpr != null) {
    IOUtil.writeShort(out,FIELD_ON_RENDER);
    IOUtil.writeString(out,onRenderScriptExpr.getScriptText());
  }
  ScriptExpression onPageBreakScriptExpr=design.getOnPageBreak();
  if (onPageBreakScriptExpr != null) {
    IOUtil.writeShort(out,FIELD_ON_PAGE_BREAK);
    IOUtil.writeString(out,onPageBreakScriptExpr.getScriptText());
  }
  VisibilityDesign visibility=design.getVisibility();
  if (visibility != null) {
    IOUtil.writeShort(out,FIELD_VISIBILITY);
    writeVisibility(out,visibility);
  }
  ActionDesign action=design.getAction();
  if (action != null) {
    IOUtil.writeShort(out,FIELD_ACTION_V1);
    writeAction(out,action);
  }
  boolean useCachedResult=design.useCachedResult();
  if (useCachedResult) {
    IOUtil.writeShort(out,FIELD_USE_CACHED_RESULT);
    IOUtil.writeBool(out,useCachedResult);
  }
}