Program: 104653
Project: 104653
Buggy source:
public DBCursor prepareCursor(){
  final DBObject query=getQueryObject();
  final DBObject fields=getFieldsObject();
  if (LOG.isTraceEnabled()) {
    LOG.trace("String_Node_Str" + dbColl.getName() + "String_Node_Str"+ query+ "String_Node_Str"+ fields+ "String_Node_Str"+ offset+ "String_Node_Str"+ limit);
  }
  final DBCursor cursor=dbColl.find(query,fields);
  cursor.setDecoderFactory(ds.getDecoderFact());
  if (offset > 0) {
    cursor.skip(offset);
  }
  if (limit > 0) {
    cursor.limit(limit);
  }
  if (batchSize != 0) {
    cursor.batchSize(batchSize);
  }
  if (snapshotted) {
    cursor.snapshot();
  }
  if (sort != null) {
    cursor.sort(sort);
  }
  if (indexHint != null) {
    cursor.hint(indexHint);
  }
  if (null != readPref) {
    cursor.setReadPreference(readPref);
  }
  if (noTimeout) {
    cursor.addOption(Bytes.QUERYOPTION_NOTIMEOUT);
  }
  if (tail) {
    cursor.addOption(Bytes.QUERYOPTION_TAILABLE);
    if (tailAwaitData) {
      cursor.addOption(Bytes.QUERYOPTION_AWAITDATA);
    }
  }
  if (snapshotted && (sort != null || indexHint != null)) {
    LOG.warning("String_Node_Str");
  }
  if (tail && (sort != null)) {
    LOG.warning("String_Node_Str");
  }
  if (maxScan != null) {
    cursor.addSpecial("String_Node_Str",maxScan);
  }
  if (max != null) {
    cursor.addSpecial("String_Node_Str",max);
  }
  if (min != null) {
    cursor.addSpecial("String_Node_Str",min);
  }
  if (comment != null) {
    cursor.addSpecial("String_Node_Str",comment);
  }
  if (returnKey) {
    cursor.returnKey();
  }
  return cursor;
}

Fixed version (ground truth):
public DBCursor prepareCursor(){
  final DBObject query=getQueryObject();
  final DBObject fields=getFieldsObject();
  if (LOG.isTraceEnabled()) {
    LOG.trace("String_Node_Str" + dbColl.getName() + "String_Node_Str"+ query+ "String_Node_Str"+ fields+ "String_Node_Str"+ offset+ "String_Node_Str"+ limit);
  }
  final DBCursor cursor=dbColl.find(query,fields);
  cursor.setDecoderFactory(ds.getDecoderFact());
  if (offset > 0) {
    cursor.skip(offset);
  }
  if (limit > 0) {
    cursor.limit(limit);
  }
  if (batchSize != 0) {
    cursor.batchSize(batchSize);
  }
  if (snapshotted) {
    cursor.snapshot();
  }
  if (sort != null) {
    cursor.sort(sort);
  }
  if (indexHint != null) {
    cursor.hint(indexHint);
  }
  if (null != readPref) {
    cursor.setReadPreference(readPref);
  }
  if (noTimeout) {
    cursor.addOption(Bytes.QUERYOPTION_NOTIMEOUT);
  }
  if (tail) {
    cursor.addOption(Bytes.QUERYOPTION_TAILABLE);
    if (tailAwaitData) {
      cursor.addOption(Bytes.QUERYOPTION_AWAITDATA);
    }
  }
  if (snapshotted && (sort != null || indexHint != null)) {
    LOG.warning("String_Node_Str");
  }
  if (tail && (sort != null)) {
    LOG.warning("String_Node_Str");
  }
  if (maxScan != null) {
    cursor.addSpecial("String_Node_Str",maxScan);
  }
  if (maxTime != null && maxTimeUnit != null) {
    cursor.maxTime(maxTime,maxTimeUnit);
  }
  if (max != null) {
    cursor.addSpecial("String_Node_Str",max);
  }
  if (min != null) {
    cursor.addSpecial("String_Node_Str",min);
  }
  if (comment != null) {
    cursor.addSpecial("String_Node_Str",comment);
  }
  if (returnKey) {
    cursor.returnKey();
  }
  return cursor;
}