Program: 175975
Project: 175975
Buggy source:
/** 
 * Fetch entity.
 * @param entityClass the entity class
 * @param rowId the row id
 * @param entityMetadata the entity metadata
 * @param relationNames the relation names
 * @param tableName the table name
 * @param results the results
 * @param filter the filter
 * @param filterClausequeue the filter clausequeue
 * @param columns the columns
 * @return the list
 * @throws IOException Signals that an I/O exception has occurred.
 */
private List fetchEntity(Class entityClass,Object rowId,EntityMetadata entityMetadata,List<String> relationNames,String tableName,List results,FilterList filter,Queue filterClausequeue,String... columns) throws IOException {
  List<AbstractManagedType> subManagedType=getSubManagedType(entityClass,entityMetadata);
  if (!subManagedType.isEmpty()) {
    for (    AbstractManagedType subEntity : subManagedType) {
      EntityMetadata subEntityMetadata=KunderaMetadataManager.getEntityMetadata(kunderaMetadata,subEntity.getJavaType());
      results=handler.readData(tableName,subEntityMetadata.getEntityClazz(),subEntityMetadata,rowId,subEntityMetadata.getRelationNames(),filter,columns);
      if (!results.isEmpty()) {
        break;
      }
    }
  }
 else {
    results=handler.readData(tableName,entityMetadata.getEntityClazz(),entityMetadata,rowId,relationNames,filter,columns);
  }
  if (rowId != null) {
    KunderaCoreUtils.printQuery("String_Node_Str" + entityMetadata.getTableName() + "String_Node_Str"+ rowId,showQuery);
  }
 else   if (showQuery && filterClausequeue.size() > 0) {
    KunderaCoreUtils.printQueryWithFilterClause(filterClausequeue,entityMetadata.getTableName());
  }
  return results;
}

Fixed version (ground truth):
/** 
 * Fetch entity.
 * @param entityClass the entity class
 * @param rowId the row id
 * @param entityMetadata the entity metadata
 * @param relationNames the relation names
 * @param tableName the table name
 * @param results the results
 * @param filter the filter
 * @param filterClausequeue the filter clausequeue
 * @param columns the columns
 * @return the list
 * @throws IOException Signals that an I/O exception has occurred.
 */
private List fetchEntity(Class entityClass,Object rowId,EntityMetadata entityMetadata,List<String> relationNames,String tableName,List results,FilterList filter,Queue filterClausequeue,String... columns) throws IOException {
  results=new ArrayList();
  List<AbstractManagedType> subManagedType=getSubManagedType(entityClass,entityMetadata);
  if (!subManagedType.isEmpty()) {
    for (    AbstractManagedType subEntity : subManagedType) {
      EntityMetadata subEntityMetadata=KunderaMetadataManager.getEntityMetadata(kunderaMetadata,subEntity.getJavaType());
      List tempResults=handler.readData(tableName,subEntityMetadata.getEntityClazz(),subEntityMetadata,rowId,subEntityMetadata.getRelationNames(),filter,columns);
      if (tempResults != null && !tempResults.isEmpty()) {
        results.addAll(tempResults);
      }
    }
  }
 else {
    results=handler.readData(tableName,entityMetadata.getEntityClazz(),entityMetadata,rowId,relationNames,filter,columns);
  }
  if (rowId != null) {
    KunderaCoreUtils.printQuery("String_Node_Str" + entityMetadata.getTableName() + "String_Node_Str"+ rowId,showQuery);
  }
 else   if (showQuery && filterClausequeue.size() > 0) {
    KunderaCoreUtils.printQueryWithFilterClause(filterClausequeue,entityMetadata.getTableName());
  }
  return results;
}