Program: 175982
Project: 175982
Buggy source:
private <E>List<E> onIndexSearch(OracleNoSQLQueryInterpreter interpreter,EntityMetadata entityMetadata,MetamodelImpl metamodel,List<E> results,List<String> columnsToSelect){
  Map<String,List> indexes=new HashMap<String,List>();
  StringBuilder indexNamebuilder=new StringBuilder();
  for (  Object clause : interpreter.getClauseQueue()) {
    if (clause.getClass().isAssignableFrom(FilterClause.class)) {
      String fieldName=((FilterClause)clause).getProperty();
      Object value=((FilterClause)clause).getValue();
      if (!indexes.containsKey(fieldName)) {
        indexNamebuilder.append(fieldName);
        indexNamebuilder.append("String_Node_Str");
      }
      indexes.put(fieldName,(List)value);
    }
 else {
      if (clause.toString().equalsIgnoreCase("String_Node_Str")) {
        throw new QueryHandlerException("String_Node_Str");
      }
    }
  }
  Table schemaTable=tableAPI.getTable(entityMetadata.getTableName());
  String indexKeyName=indexNamebuilder.deleteCharAt(indexNamebuilder.length() - 1).toString();
  Index index=schemaTable.getIndex(entityMetadata.getIndexProperties().get(indexKeyName).getName());
  IndexKey indexKey=index.createIndexKey();
  for (  String indexName : indexes.keySet()) {
    NoSqlDBUtils.add(schemaTable.getField(indexName),indexKey,indexes.get(indexName).get(0),indexName);
  }
  Iterator<Row> rowsIter=tableAPI.tableIterator(indexKey,null,null);
  Map<String,Object> relationMap=initialize(entityMetadata);
  try {
    results=scrollAndPopulate(null,entityMetadata,metamodel,schemaTable,rowsIter,relationMap,columnsToSelect);
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + e + "String_Node_Str");
    throw new PersistenceException(e);
  }
  return results;
}

Fixed version (ground truth):
private <E>List<E> onIndexSearch(OracleNoSQLQueryInterpreter interpreter,EntityMetadata entityMetadata,MetamodelImpl metamodel,List<E> results,List<String> columnsToSelect){
  Map<String,List> indexes=new HashMap<String,List>();
  StringBuilder indexNamebuilder=new StringBuilder();
  for (  Object clause : interpreter.getClauseQueue()) {
    if (clause.getClass().isAssignableFrom(FilterClause.class)) {
      String fieldName=null;
      String clauseName=((FilterClause)clause).getProperty();
      StringTokenizer stringTokenizer=new StringTokenizer(clauseName,"String_Node_Str");
      if (stringTokenizer.countTokens() > 1) {
        fieldName=stringTokenizer.nextToken();
      }
      fieldName=stringTokenizer.nextToken();
      Object value=((FilterClause)clause).getValue();
      if (!indexes.containsKey(fieldName)) {
        indexNamebuilder.append(fieldName);
        indexNamebuilder.append("String_Node_Str");
      }
      indexes.put(fieldName,(List)value);
    }
 else {
      if (clause.toString().equalsIgnoreCase("String_Node_Str")) {
        throw new QueryHandlerException("String_Node_Str");
      }
    }
  }
  Table schemaTable=tableAPI.getTable(entityMetadata.getTableName());
  String indexKeyName=indexNamebuilder.deleteCharAt(indexNamebuilder.length() - 1).toString();
  Index index=schemaTable.getIndex(entityMetadata.getIndexProperties().get(indexKeyName).getName());
  IndexKey indexKey=index.createIndexKey();
  for (  String indexName : indexes.keySet()) {
    NoSqlDBUtils.add(schemaTable.getField(indexName),indexKey,indexes.get(indexName).get(0),indexName);
  }
  Iterator<Row> rowsIter=tableAPI.tableIterator(indexKey,null,null);
  Map<String,Object> relationMap=initialize(entityMetadata);
  try {
    results=scrollAndPopulate(null,entityMetadata,metamodel,schemaTable,rowsIter,relationMap,columnsToSelect);
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + e + "String_Node_Str");
    throw new PersistenceException(e);
  }
  return results;
}