Program: 97912
Project: 97912
Buggy source:
@SuppressWarnings("String_Node_Str") private void loadCache(){
  byte[] nextKey=null;
  Holder<byte[]> keyHolder=rowKeys.nextImpl();
  if (keyHolder != null)   nextKey=keyHolder.getValue();
  if (cachedRows != null && cachedRows.hasNext())   return;
 else   if (nextKey == null)   return;
  List<RowHolder<Row>> results=new ArrayList<RowHolder<Row>>();
  List<byte[]> keysToLookup=new ArrayList<byte[]>();
  while (results.size() < batchSize && nextKey != null) {
    RowHolder<Row> result=cache.fromCache(cf,nextKey);
    if (result == null)     keysToLookup.add(nextKey);
    results.add(result);
    nextKey=null;
    keyHolder=rowKeys.nextImpl();
    if (keyHolder != null)     nextKey=keyHolder.getValue();
  }
  Iterator<com.netflix.astyanax.model.Row<byte[],byte[]>> resultingRows=null;
  if (keysToLookup.size() > 0) {
    if (list != null)     list.beforeFetchingNextBatch();
    ColumnFamily<byte[],byte[]> cf=info.getColumnFamilyObj();
    ColumnFamilyQuery<byte[],byte[]> q2=keyspace.prepareQuery(cf);
    RowSliceQuery<byte[],byte[]> slice=q2.getKeySlice(keysToLookup);
    OperationResult<Rows<byte[],byte[]>> result=execute(slice);
    Rows<byte[],byte[]> rows=result.getResult();
    resultingRows=rows.iterator();
    if (list != null)     list.afterFetchingNextBatch(rows.size());
  }
 else {
    resultingRows=new ArrayList<com.netflix.astyanax.model.Row<byte[],byte[]>>().iterator();
  }
  Map<ByteArray,KeyValue<Row>> map=new HashMap<ByteArray,KeyValue<Row>>();
  while (resultingRows.hasNext()) {
    com.netflix.astyanax.model.Row<byte[],byte[]> row=resultingRows.next();
    KeyValue<Row> kv=new KeyValue<Row>();
    kv.setKey(row.getKey());
    if (!row.getColumns().isEmpty()) {
      Row r=rowProvider.get();
      r.setKey(row.getKey());
      CassandraSession.processColumns(row,r);
      kv.setValue(r);
    }
    ByteArray b=new ByteArray(row.getKey());
    map.put(b,kv);
    cache.cacheRow(cf,row.getKey(),kv.getValue());
  }
  List<KeyValue<Row>> finalRes=new ArrayList<KeyValue<Row>>();
  Iterator<byte[]> keyIter=keysToLookup.iterator();
  for (  RowHolder<Row> r : results) {
    if (r == null) {
      byte[] key=keyIter.next();
      ByteArray b=new ByteArray(key);
      KeyValue<Row> kv=map.get(b);
      finalRes.add(kv);
    }
 else {
      Row row=r.getValue();
      KeyValue<Row> kv=new KeyValue<Row>();
      kv.setKey(r.getKey());
      kv.setValue(row);
      finalRes.add(kv);
    }
  }
  cachedRows=finalRes.listIterator();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void loadCache(){
  if (cachedRows != null && cachedRows.hasNext())   return;
  List<RowHolder<Row>> results=new ArrayList<RowHolder<Row>>();
  List<byte[]> keysToLookup=new ArrayList<byte[]>();
  while (results.size() < batchSize) {
    Holder<byte[]> keyHolder=rowKeys.nextImpl();
    if (keyHolder == null)     break;
    byte[] nextKey=keyHolder.getValue();
    RowHolder<Row> result=cache.fromCache(cf,nextKey);
    if (result == null)     keysToLookup.add(nextKey);
    results.add(result);
  }
  Iterator<com.netflix.astyanax.model.Row<byte[],byte[]>> resultingRows=null;
  if (keysToLookup.size() > 0) {
    if (list != null)     list.beforeFetchingNextBatch();
    ColumnFamily<byte[],byte[]> cf=info.getColumnFamilyObj();
    ColumnFamilyQuery<byte[],byte[]> q2=keyspace.prepareQuery(cf);
    RowSliceQuery<byte[],byte[]> slice=q2.getKeySlice(keysToLookup);
    OperationResult<Rows<byte[],byte[]>> result=execute(slice);
    Rows<byte[],byte[]> rows=result.getResult();
    resultingRows=rows.iterator();
    if (list != null)     list.afterFetchingNextBatch(rows.size());
  }
 else {
    resultingRows=new ArrayList<com.netflix.astyanax.model.Row<byte[],byte[]>>().iterator();
  }
  Map<ByteArray,KeyValue<Row>> map=new HashMap<ByteArray,KeyValue<Row>>();
  while (resultingRows.hasNext()) {
    com.netflix.astyanax.model.Row<byte[],byte[]> row=resultingRows.next();
    KeyValue<Row> kv=new KeyValue<Row>();
    kv.setKey(row.getKey());
    if (!row.getColumns().isEmpty()) {
      Row r=rowProvider.get();
      r.setKey(row.getKey());
      CassandraSession.processColumns(row,r);
      kv.setValue(r);
    }
    ByteArray b=new ByteArray(row.getKey());
    map.put(b,kv);
    cache.cacheRow(cf,row.getKey(),kv.getValue());
  }
  List<KeyValue<Row>> finalRes=new ArrayList<KeyValue<Row>>();
  Iterator<byte[]> keyIter=keysToLookup.iterator();
  for (  RowHolder<Row> r : results) {
    if (r == null) {
      byte[] key=keyIter.next();
      ByteArray b=new ByteArray(key);
      KeyValue<Row> kv=map.get(b);
      finalRes.add(kv);
    }
 else {
      Row row=r.getValue();
      KeyValue<Row> kv=new KeyValue<Row>();
      kv.setKey(r.getKey());
      kv.setValue(row);
      finalRes.add(kv);
    }
  }
  cachedRows=finalRes.listIterator();
}