Program: 59414
Project: 59414
Buggy source:
/** 
 * Return find condition for   {@code entity.fieldName} base on{@code stringExpression} expression
 * @param entity
 * @param from
 * @param fieldName
 * @param stringExpression
 * @param builder
 * @param force require an expression (if not applicable return a{@code false} expression
 * @return condition or null if (field not found || field type not supported|| stringExpression not applicable)
 * @throws EmptyResultException
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static <T>Predicate getFindCondition(EntityType<T> entity,Root<T> from,String fieldName,String stringExpression,CriteriaBuilder builder,boolean force) throws EmptyResultException {
  Attribute<? super T,?> field=null;
  try {
    field=entity.getAttribute(fieldName);
  }
 catch (  IllegalArgumentException e) {
    return null;
  }
  if (field == null) {
    return null;
  }
  Class<?> type=field.getJavaType();
  if (String.class == type) {
    return getStringFindCondition(from,stringExpression,builder,field);
  }
 else   if (Boolean.class == type || boolean.class == type) {
    return getBooleanFindCondition(from,stringExpression,builder,field,force);
  }
 else   if (Number.class.isAssignableFrom(type) || NUMBER_PRIMITIVES.contains(type)) {
    if (NumberUtils.isNumber(stringExpression)) {
      return getTextSearchFindCondition(from,stringExpression,builder,field,false);
    }
 else {
      if (force) {
        throw new EmptyResultException();
      }
      return null;
    }
  }
 else   if (Date.class.isAssignableFrom(type) || Calendar.class.isAssignableFrom(type)) {
    return getTextSearchFindCondition(from,stringExpression,builder,field,true);
  }
 else   if (type.isEnum()) {
    return getEnumFindCondition(from,stringExpression,builder,field,(Class<? extends Enum>)type,force);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return find condition for   {@code entity.fieldName} base on{@code stringExpression} expression
 * @param entity
 * @param from
 * @param fieldName
 * @param stringExpression
 * @param builder
 * @param force require an expression (if not applicable return a{@code false} expression
 * @return condition or null if (field not found || field type not supported|| stringExpression not applicable)
 * @throws EmptyResultException
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static <T>Predicate getFindCondition(EntityType<T> entity,Root<T> from,String fieldName,String stringExpression,CriteriaBuilder builder,boolean force) throws EmptyResultException {
  Attribute<? super T,?> field=null;
  try {
    field=entity.getAttribute(fieldName);
  }
 catch (  IllegalArgumentException e) {
    LOOGER.finer("String_Node_Str".concat(fieldName).concat("String_Node_Str"));
    return null;
  }
  if (field == null) {
    return null;
  }
  Class<?> type=field.getJavaType();
  if (String.class == type) {
    return getStringFindCondition(from,stringExpression,builder,field);
  }
 else   if (Boolean.class == type || boolean.class == type) {
    return getBooleanFindCondition(from,stringExpression,builder,field,force);
  }
 else   if (Number.class.isAssignableFrom(type) || NUMBER_PRIMITIVES.contains(type)) {
    if (NumberUtils.isNumber(stringExpression)) {
      return getTextSearchFindCondition(from,stringExpression,builder,field,false);
    }
 else {
      if (force) {
        throw new EmptyResultException();
      }
      return null;
    }
  }
 else   if (Date.class.isAssignableFrom(type) || Calendar.class.isAssignableFrom(type)) {
    return getTextSearchFindCondition(from,stringExpression,builder,field,true);
  }
 else   if (type.isEnum()) {
    return getEnumFindCondition(from,stringExpression,builder,field,(Class<? extends Enum>)type,force);
  }
  return null;
}