Program: 76897
Project: 76897
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 (isBookmark) {
      IOUtil.writeInt(out,FIELD_ISBOOKMARK);
      IOUtil.writeBool(out,drillThrough.isBookmark());
    }
  }
 else   if (isBookmark) {
    IOUtil.writeInt(out,FIELD_ISBOOKMARK);
    IOUtil.writeBool(out,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());
  }
}

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());
    }
  }
 else   if (isBookmark) {
    IOUtil.writeInt(out,FIELD_ISBOOKMARK);
    IOUtil.writeBool(out,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());
  }
}