Program: 59378
Project: 59378
Buggy source:
/** 
 * Prepares filter part for a query of findByCriteria
 * @param entity
 * @param filterByAssociations
 * @param datatablesCriterias
 * @param associationMap
 * @param filtersByColumnPredicate
 * @return
 */
private static <T>BooleanBuilder prepareQueryFilterPart(PathBuilder<T> entity,Map<String,List<String>> filterByAssociations,DatatablesCriterias datatablesCriterias,Map<String,PathBuilder<?>> associationMap,BooleanBuilder filtersByColumnPredicate,ConversionService conversionService,MessageSource messageSource){
  for (  ColumnDef column : datatablesCriterias.getColumnDefs()) {
    String searchStr=column.getSearch();
    boolean findInColumn=column.isFilterable() && StringUtils.isNotEmpty(searchStr);
    if (findInColumn) {
      String fieldName=unescapeDot(column.getName());
      Class<?> fieldType=QuerydslUtils.getFieldType(fieldName,entity);
      TypeDescriptor descriptor=QuerydslUtils.getTypeDescriptor(fieldName,entity);
      filtersByColumnPredicate=filtersByColumnPredicate.and(QuerydslUtils.createExpression(entity,fieldName,descriptor,searchStr,conversionService,messageSource));
      List<String> attributes=filterByAssociations.get(fieldName);
      if (attributes != null && attributes.size() > 0) {
        BooleanBuilder filtersByAssociationPredicate=new BooleanBuilder();
        PathBuilder<?> associationPath=associationMap.get(fieldName);
        List<String> associationFields=filterByAssociations.get(fieldName);
        for (        String associationFieldName : associationFields) {
          Class<?> associationFieldType=BeanUtils.findPropertyType(associationFieldName,ArrayUtils.<Class<?>>toArray(fieldType));
          filtersByAssociationPredicate=filtersByAssociationPredicate.or(QuerydslUtils.createExpression(associationPath,associationFieldName,associationFieldType,searchStr));
        }
        filtersByColumnPredicate=filtersByColumnPredicate.and(filtersByAssociationPredicate.getValue());
      }
    }
  }
  return filtersByColumnPredicate;
}

Fixed version (ground truth):
/** 
 * Prepares filter part for a query of findByCriteria
 * @param entity
 * @param filterByAssociations
 * @param datatablesCriterias
 * @param associationMap
 * @param filtersByColumnPredicate
 * @return
 */
private static <T>BooleanBuilder prepareQueryFilterPart(PathBuilder<T> entity,Map<String,List<String>> filterByAssociations,DatatablesCriterias datatablesCriterias,Map<String,PathBuilder<?>> associationMap,BooleanBuilder filtersByColumnPredicate,ConversionService conversionService,MessageSource messageSource){
  for (  ColumnDef column : datatablesCriterias.getColumnDefs()) {
    String searchStr=column.getSearch();
    boolean findInColumn=column.isFilterable() && StringUtils.isNotEmpty(searchStr);
    if (findInColumn) {
      String fieldName=unescapeDot(column.getName());
      Class<?> fieldType=QuerydslUtils.getFieldType(fieldName,entity);
      filtersByColumnPredicate=filtersByColumnPredicate.and(QuerydslUtils.createExpression(entity,fieldName,searchStr,conversionService,messageSource));
      List<String> attributes=filterByAssociations.get(fieldName);
      if (attributes != null && attributes.size() > 0) {
        BooleanBuilder filtersByAssociationPredicate=new BooleanBuilder();
        PathBuilder<?> associationPath=associationMap.get(fieldName);
        List<String> associationFields=filterByAssociations.get(fieldName);
        for (        String associationFieldName : associationFields) {
          Class<?> associationFieldType=BeanUtils.findPropertyType(associationFieldName,ArrayUtils.<Class<?>>toArray(fieldType));
          filtersByAssociationPredicate=filtersByAssociationPredicate.or(QuerydslUtils.createExpression(associationPath,associationFieldName,associationFieldType,searchStr));
        }
        filtersByColumnPredicate=filtersByColumnPredicate.and(filtersByAssociationPredicate.getValue());
      }
    }
  }
  return filtersByColumnPredicate;
}