Program: 72967
Project: 72967
Buggy source:
protected void writeFields(DataOutputStream out) throws IOException {
  if (type != -1) {
    IOUtil.writeInt(out,FIELD_TYPE);
    IOUtil.writeInt(out,type);
  }
  if (isDrillThrough()) {
    if (drillThrough.getBookmark() != null) {
      IOUtil.writeInt(out,FIELD_BOOKMARK);
      IOUtil.writeString(out,drillThrough.getBookmark());
    }
  }
 else   if (bookmark != null) {
    IOUtil.writeInt(out,FIELD_BOOKMARK);
    IOUtil.writeString(out,bookmark);
  }
  if (isDrillThrough()) {
    if (drillThrough.isBookmark()) {
      IOUtil.writeInt(out,FIELD_ISBOOKMARK);
      IOUtil.writeBool(out,drillThrough.isBookmark());
    }
  }
  if (hyperlink != null) {
    IOUtil.writeInt(out,FIELD_HYPERLINK);
    IOUtil.writeString(out,hyperlink);
  }
  if (isDrillThrough() && drillThrough.getReportName() != null) {
    IOUtil.writeInt(out,FIELD_REPORTNAME);
    IOUtil.writeString(out,drillThrough.getReportName());
  }
  if (isDrillThrough() && drillThrough.getParameterBindings() != null) {
    IOUtil.writeInt(out,FIELD_PARAMETERBINDINGS);
    IOUtil.writeMap(out,drillThrough.getParameterBindings());
  }
  if (isDrillThrough() && drillThrough.getSearchCriteria() != null) {
    IOUtil.writeInt(out,FIELD_SEARCHCRITERIA);
    IOUtil.writeMap(out,drillThrough.getSearchCriteria());
  }
  if (isDrillThrough() && drillThrough.getTargetWindow() != null) {
    IOUtil.writeInt(out,FIELD_TARGET);
    IOUtil.writeString(out,drillThrough.getTargetWindow());
  }
 else   if (target != null) {
    IOUtil.writeInt(out,FIELD_TARGET);
    IOUtil.writeString(out,target);
  }
  if (isDrillThrough() && drillThrough.getFormat() != null) {
    IOUtil.writeInt(out,FIELD_FORMAT);
    IOUtil.writeString(out,drillThrough.getFormat());
  }
  if (isDrillThrough() && drillThrough.getTargetFileType() != null) {
    IOUtil.writeInt(out,FIELD_TARGETFILETYPE);
    IOUtil.writeString(out,drillThrough.getTargetFileType());
  }
}

Fixed version (ground truth):
protected void writeFields(DataOutputStream out) throws IOException {
  if (type != -1) {
    IOUtil.writeInt(out,FIELD_TYPE);
    IOUtil.writeInt(out,type);
  }
  if (isDrillThrough()) {
    if (drillThrough.getBookmark() != null) {
      IOUtil.writeInt(out,FIELD_BOOKMARK);
      IOUtil.writeString(out,drillThrough.getBookmark());
    }
  }
 else   if (bookmark != null) {
    IOUtil.writeInt(out,FIELD_BOOKMARK);
    IOUtil.writeString(out,bookmark);
  }
  if (isDrillThrough()) {
    if (drillThrough.isBookmark()) {
      IOUtil.writeInt(out,FIELD_ISBOOKMARK);
      IOUtil.writeBool(out,drillThrough.isBookmark());
    }
  }
  if (hyperlink != null) {
    IOUtil.writeInt(out,FIELD_HYPERLINK);
    IOUtil.writeString(out,hyperlink);
  }
  if (isDrillThrough() && drillThrough.getReportName() != null) {
    IOUtil.writeInt(out,FIELD_REPORTNAME);
    IOUtil.writeString(out,drillThrough.getReportName());
  }
  if (isDrillThrough() && drillThrough.getParameterBindings() != null) {
    IOUtil.writeInt(out,FIELD_PARAMETERBINDINGS);
    IOUtil.writeMap(out,drillThrough.getParameterBindings());
  }
  if (isDrillThrough() && drillThrough.getSearchCriteria() != null) {
    IOUtil.writeInt(out,FIELD_SEARCHCRITERIA);
    IOUtil.writeMap(out,drillThrough.getSearchCriteria());
  }
  if (isDrillThrough() && drillThrough.getTargetWindow() != null) {
    IOUtil.writeInt(out,FIELD_TARGET);
    IOUtil.writeString(out,drillThrough.getTargetWindow());
  }
 else   if (target != null) {
    IOUtil.writeInt(out,FIELD_TARGET);
    IOUtil.writeString(out,target);
  }
  if (tooltip != null) {
    IOUtil.writeInt(out,FIELD_TOOLTIP);
    IOUtil.writeString(out,tooltip);
  }
  if (isDrillThrough() && drillThrough.getFormat() != null) {
    IOUtil.writeInt(out,FIELD_FORMAT);
    IOUtil.writeString(out,drillThrough.getFormat());
  }
  if (isDrillThrough() && drillThrough.getTargetFileType() != null) {
    IOUtil.writeInt(out,FIELD_TARGETFILETYPE);
    IOUtil.writeString(out,drillThrough.getTargetFileType());
  }
}