Program: 97913
Project: 97913
Buggy source:
private DirectCursor<IndexColumnInfo> processRangeExpression(ExpressionNode root,Set<ViewInfo> alreadyJoinedViews){
  StateAttribute attr;
  if (root.getType() == NoSqlLexer.BETWEEN) {
    ExpressionNode grandChild=root.getChild(ChildSide.LEFT).getChild(ChildSide.LEFT);
    attr=(StateAttribute)grandChild.getState();
  }
 else {
    attr=(StateAttribute)root.getChild(ChildSide.LEFT).getState();
  }
  DboColumnMeta info=attr.getColumnInfo();
  ViewInfoImpl viewInfo=attr.getViewInfo();
  ScanInfo scanInfo=createScanInfo(viewInfo,info);
  alreadyJoinedViews.add(viewInfo);
  if (info.isIndexed()) {
    AbstractCursor<IndexColumn> scan;
    if (root.getType() == NoSqlLexer.EQ) {
      byte[] data=retrieveValue(info,root.getChild(ChildSide.RIGHT));
      Key key=new Key(data,true);
      scan=session.scanIndex(scanInfo,key,key,batchSize);
    }
 else     if (root.getType() == NoSqlLexer.GT || root.getType() == NoSqlLexer.GE || root.getType() == NoSqlLexer.LT || root.getType() == NoSqlLexer.LE || root.isInBetweenExpression()) {
      Key from=null;
      Key to=null;
      if (root.isInBetweenExpression()) {
        ExpressionNode node=root.getGreaterThan();
        ExpressionNode node2=root.getLessThan();
        from=createLeftKey(node,info);
        to=createRightKey(node2,info);
      }
 else       if (root.getType() == NoSqlLexer.GT || root.getType() == NoSqlLexer.GE) {
        from=createLeftKey(root,info);
      }
 else       if (root.getType() == NoSqlLexer.LT) {
        to=createRightKey(root,info);
      }
 else       throw new UnsupportedOperationException("String_Node_Str");
      scan=session.scanIndex(scanInfo,from,to,batchSize);
    }
 else     throw new UnsupportedOperationException("String_Node_Str" + root.getType());
    DirectCursor<IndexColumnInfo> processKeys=processKeys(viewInfo,info,scan);
    return processKeys;
  }
 else   if (info.getOwner().getIdColumnMeta().getColumnName().equals(info.getColumnName())) {
    AbstractCursor<KeyValue<Row>> scan;
    if (root.getType() == NoSqlLexer.EQ) {
      byte[] data=retrieveValue(info,root.getChild(ChildSide.RIGHT));
      byte[] virtualkey=info.getOwner().getIdColumnMeta().formVirtRowKey(data);
      List<byte[]> keyList=new ArrayList<byte[]>();
      keyList.add(virtualkey);
      scan=session.find(info.getOwner(),keyList,false,true,batchSize);
    }
 else     throw new UnsupportedOperationException("String_Node_Str" + root.getType());
    DirectCursor<IndexColumnInfo> processKeys=processKeysforPK(viewInfo,info,scan);
    return processKeys;
  }
 else   throw new IllegalArgumentException("String_Node_Str" + info.getColumnName() + "String_Node_Str"+ info.getColumnName()+ "String_Node_Str");
}

Fixed version (ground truth):
private DirectCursor<IndexColumnInfo> processRangeExpression(ExpressionNode root,Set<ViewInfo> alreadyJoinedViews){
  StateAttribute attr;
  if (root.getType() == NoSqlLexer.BETWEEN) {
    ExpressionNode grandChild=root.getChild(ChildSide.LEFT).getChild(ChildSide.LEFT);
    attr=(StateAttribute)grandChild.getState();
  }
 else {
    attr=(StateAttribute)root.getChild(ChildSide.LEFT).getState();
  }
  DboColumnMeta info=attr.getColumnInfo();
  ViewInfoImpl viewInfo=attr.getViewInfo();
  ScanInfo scanInfo=createScanInfo(viewInfo,info);
  alreadyJoinedViews.add(viewInfo);
  if (info.isIndexed()) {
    return processIndexColumn(root,scanInfo,viewInfo,info);
  }
 else   if (info.getOwner().getIdColumnMeta().getColumnName().equals(info.getColumnName())) {
    AbstractCursor<KeyValue<Row>> scan;
    if (root.getType() == NoSqlLexer.EQ) {
      byte[] data=retrieveValue(info,root.getChild(ChildSide.RIGHT));
      byte[] virtualkey=info.getOwner().getIdColumnMeta().formVirtRowKey(data);
      List<byte[]> keyList=new ArrayList<byte[]>();
      keyList.add(virtualkey);
      scan=session.find(info.getOwner(),keyList,false,true,batchSize);
    }
 else     throw new UnsupportedOperationException("String_Node_Str" + root.getType());
    DirectCursor<IndexColumnInfo> processKeys=processKeysforPK(viewInfo,info,scan);
    return processKeys;
  }
 else   throw new IllegalArgumentException("String_Node_Str" + info.getColumnName() + "String_Node_Str"+ info.getColumnName()+ "String_Node_Str");
}