Program: 168488
Project: 168488
Buggy source:
public Transaction[] getPendingTransactions(){
  final JournalInfoBlock infoBlock=getJournalInfoBlock();
  final ReadableRandomAccessStream journalStream=getJournalDataStream(infoBlock);
  final JournalHeader jh=getJournalHeader(infoBlock,journalStream);
  final long start=jh.getRawStart();
  final long end=jh.getRawEnd();
  final long size=jh.getRawSize();
  if (start < 0)   throw new RuntimeException("String_Node_Str");
  if (end < 0)   throw new RuntimeException("String_Node_Str");
  if (size < 0)   throw new RuntimeException("String_Node_Str");
  if (start == end) {
    return new Transaction[0];
  }
  final LinkedList<Transaction> pendingTransactionList=new LinkedList<Transaction>();
  final LinkedList<BlockList> curBlockListList=new LinkedList<BlockList>();
  final LinkedList<BlockInfo> curBlockInfoList=new LinkedList<BlockInfo>();
  boolean wrappedAround=false;
  byte[] tmpData=new byte[Math.max(BlockListHeader.length(),BlockInfo.length())];
  journalStream.seek(start);
  for (long i=start; i != end; ) {
    if (wrappedReadFully(journalStream,tmpData,0,BlockListHeader.length())) {
      if (!wrappedAround) {
        wrappedAround=true;
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
    BlockListHeader curHeader=new BlockListHeader(tmpData,0,jh.isLittleEndian());
    if (curHeader.getNumBlocks() < 1) {
      throw new RuntimeException("String_Node_Str");
    }
    i=(i + BlockListHeader.length()) % size;
    curBlockInfoList.clear();
    for (int j=0; j < curHeader.getNumBlocks(); ++j) {
      if (wrappedReadFully(journalStream,tmpData,0,BlockInfo.length())) {
        if (!wrappedAround) {
          wrappedAround=true;
        }
 else {
          throw new RuntimeException("String_Node_Str");
        }
      }
      curBlockInfoList.add(new BlockInfo(tmpData,0,jh.isLittleEndian()));
      i=(i + BlockInfo.length()) % size;
    }
    BlockList curBlockList=new BlockList(curHeader,curBlockInfoList.toArray(new BlockInfo[curBlockInfoList.size()]));
    curBlockListList.add(curBlockList);
    if (curBlockList.getBlockInfo(0).getNext() == 0) {
      pendingTransactionList.add(new Transaction(curBlockListList.toArray(new BlockList[curBlockListList.size()])));
      curBlockListList.clear();
    }
  }
  return pendingTransactionList.toArray(new Transaction[pendingTransactionList.size()]);
}

Fixed version (ground truth):
public Transaction[] getPendingTransactions(){
  final JournalInfoBlock infoBlock=getJournalInfoBlock();
  final ReadableRandomAccessStream journalStream=getJournalDataStream(infoBlock);
  final JournalHeader jh=getJournalHeader(infoBlock,journalStream);
  final long start=jh.getRawStart();
  final long end=jh.getRawEnd();
  final long size=jh.getRawSize();
  final int blockListHeaderSize=jh.getRawBlhdrSize();
  if (start < 0)   throw new RuntimeException("String_Node_Str");
  if (end < 0)   throw new RuntimeException("String_Node_Str");
  if (size < 0)   throw new RuntimeException("String_Node_Str");
  if (blockListHeaderSize < 0)   throw new RuntimeException("String_Node_Str");
  if (start == end) {
    return new Transaction[0];
  }
  final LinkedList<Transaction> pendingTransactionList=new LinkedList<Transaction>();
  final LinkedList<BlockList> curBlockListList=new LinkedList<BlockList>();
  final LinkedList<BlockInfo> curBlockInfoList=new LinkedList<BlockInfo>();
  boolean wrappedAround=false;
  byte[] tmpData=new byte[Math.max(BlockListHeader.length(),BlockInfo.length())];
  journalStream.seek(start);
  for (long i=start; i != end; ) {
    long curBytesRead=0;
    if (wrappedReadFully(journalStream,tmpData,0,BlockListHeader.length())) {
      if (!wrappedAround) {
        wrappedAround=true;
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
    BlockListHeader curHeader=new BlockListHeader(tmpData,0,jh.isLittleEndian());
    if (curHeader.getNumBlocks() < 1) {
      throw new RuntimeException("String_Node_Str");
    }
    curBytesRead+=BlockListHeader.length();
    curBlockInfoList.clear();
    for (int j=0; j < curHeader.getNumBlocks(); ++j) {
      if (wrappedReadFully(journalStream,tmpData,0,BlockInfo.length())) {
        if (!wrappedAround) {
          wrappedAround=true;
        }
 else {
          throw new RuntimeException("String_Node_Str");
        }
      }
      curBlockInfoList.add(new BlockInfo(tmpData,0,jh.isLittleEndian()));
      curBytesRead+=BlockInfo.length();
    }
    byte[] curReserved=new byte[(int)(blockListHeaderSize - curBytesRead)];
    if (wrappedReadFully(journalStream,curReserved)) {
      if (!wrappedAround) {
        wrappedAround=true;
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
    curBytesRead+=curReserved.length;
    LinkedList<byte[]> curBlockDataList=new LinkedList<byte[]>();
    for (Iterator<BlockInfo> it=curBlockInfoList.iterator(); it.hasNext(); ) {
      final BlockInfo bi=it.next();
      if (curBlockDataList.size() < 1) {
        curBlockDataList.add(new byte[0]);
        continue;
      }
      final int bsize=bi.getRawBsize();
      if (bsize > Integer.MAX_VALUE) {
        throw new RuntimeException("String_Node_Str" + bi.getBsize() + "String_Node_Str");
      }
      final byte[] data=new byte[bsize];
      if (wrappedReadFully(journalStream,data)) {
        if (!wrappedAround) {
          wrappedAround=true;
        }
 else {
          throw new RuntimeException("String_Node_Str");
        }
      }
      curBytesRead+=data.length;
      curBlockDataList.add(data);
    }
    BlockList curBlockList=new BlockList(curHeader,curBlockInfoList.toArray(new BlockInfo[curBlockInfoList.size()]));
    curBlockListList.add(curBlockList);
    if (curBlockList.getBlockInfo(0).getNext() == 0) {
      pendingTransactionList.add(new Transaction(curBlockListList.toArray(new BlockList[curBlockListList.size()])));
      curBlockListList.clear();
    }
    i=(i + curBytesRead) % size;
  }
  return pendingTransactionList.toArray(new Transaction[pendingTransactionList.size()]);
}