Program: 31439
Project: 31439
Buggy source:
@SuppressFBWarnings("String_Node_Str") private void writeDiscardFile(long rowid) throws JournalException {
  if (discardTxtRaf == null) {
    try {
      discardTxtRaf=new RandomAccessFile(discardTxt,"String_Node_Str");
      FileChannel ch=discardTxtRaf.getChannel();
      discardSink=new FlexBufferSink(ch.position(ch.size()),1024 * 1024);
    }
 catch (    IOException e) {
      throw new JournalException(e);
    }
  }
  JournalMetadata m=getMetadata();
  int p=Rows.toPartitionIndex(rowid);
  long row=Rows.toLocalRowID(rowid);
  long rowCount=0;
  try {
    try {
      for (int n=getPartitionCount() - 1; p < n; p++) {
        final Partition partition=getPartition(n,true);
        for (long r=row, psz=partition.size(); r < psz; r++) {
          for (int c=0, cc=m.getColumnCount(); c < cc; c++) {
switch (m.getColumnQuick(c).type) {
case DATE:
              Dates.appendDateTime(discardSink,partition.getLong(r,c));
            break;
case DOUBLE:
          Numbers.append(discardSink,partition.getDouble(r,c),12);
        break;
case FLOAT:
      Numbers.append(discardSink,partition.getFloat(r,c),4);
    break;
case INT:
  Numbers.append(discardSink,partition.getInt(r,c));
break;
case STRING:
partition.getStr(r,c,discardSink);
break;
case SYMBOL:
discardSink.put(partition.getSym(r,c));
break;
case SHORT:
Numbers.append(discardSink,partition.getShort(r,c));
break;
case LONG:
Numbers.append(discardSink,partition.getLong(r,c));
break;
case BYTE:
Numbers.append(discardSink,partition.getByte(r,c));
break;
case BOOLEAN:
discardSink.put(partition.getBool(r,c) ? "String_Node_Str" : "String_Node_Str");
break;
}
if (((++rowCount) & 7) == 0) {
discardSink.flush();
}
}
}
}
}
  finally {
discardSink.flush();
}
}
 catch (IOException e) {
throw new JournalException(e);
}
}

Fixed version (ground truth):
private void writeDiscardFile(long rowid) throws JournalException {
  if (discardTxtRaf == null) {
    try {
      discardTxtRaf=new RandomAccessFile(discardTxt,"String_Node_Str");
      FileChannel ch=discardTxtRaf.getChannel();
      discardSink=new FlexBufferSink(ch.position(ch.size()),1024 * 1024);
    }
 catch (    IOException e) {
      throw new JournalException(e);
    }
  }
  JournalMetadata m=getMetadata();
  int p=Rows.toPartitionIndex(rowid);
  long row=Rows.toLocalRowID(rowid);
  long rowCount=0;
  try {
    try {
      for (int n=getPartitionCount() - 1; p < n; p++) {
        final Partition partition=getPartition(n,true);
        for (long r=row, psz=partition.size(); r < psz; r++) {
          for (int c=0, cc=m.getColumnCount(); c < cc; c++) {
switch (m.getColumnQuick(c).type) {
case DATE:
              Dates.appendDateTime(discardSink,partition.getLong(r,c));
            break;
case DOUBLE:
          Numbers.append(discardSink,partition.getDouble(r,c),12);
        break;
case FLOAT:
      Numbers.append(discardSink,partition.getFloat(r,c),4);
    break;
case INT:
  Numbers.append(discardSink,partition.getInt(r,c));
break;
case STRING:
partition.getStr(r,c,discardSink);
break;
case SYMBOL:
discardSink.put(partition.getSym(r,c));
break;
case SHORT:
Numbers.append(discardSink,partition.getShort(r,c));
break;
case LONG:
Numbers.append(discardSink,partition.getLong(r,c));
break;
case BYTE:
Numbers.append(discardSink,partition.getByte(r,c));
break;
case BOOLEAN:
discardSink.put(partition.getBool(r,c) ? "String_Node_Str" : "String_Node_Str");
break;
default :
break;
}
if (((++rowCount) & 7) == 0) {
discardSink.flush();
}
}
}
}
}
  finally {
discardSink.flush();
}
}
 catch (IOException e) {
throw new JournalException(e);
}
}