Program: 112170
Project: 112170
Buggy source:
private Predicate createPredicateString(IQueryParameterType theParameter,String theResourceName,String theParamName,CriteriaBuilder theBuilder,From<?,ResourceIndexedSearchParamString> theFrom){
  String rawSearchTerm;
  if (theParameter instanceof TokenParam) {
    TokenParam id=(TokenParam)theParameter;
    if (!id.isText()) {
      throw new IllegalStateException("String_Node_Str");
    }
    rawSearchTerm=id.getValue();
  }
 else   if (theParameter instanceof StringParam) {
    StringParam id=(StringParam)theParameter;
    rawSearchTerm=id.getValue();
  }
 else   if (theParameter instanceof IPrimitiveDatatype<?>) {
    IPrimitiveDatatype<?> id=(IPrimitiveDatatype<?>)theParameter;
    rawSearchTerm=id.getValueAsString();
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + theParameter.getClass());
  }
  if (rawSearchTerm.length() > ResourceIndexedSearchParamString.MAX_LENGTH) {
    throw new InvalidRequestException("String_Node_Str" + theParamName + "String_Node_Str"+ rawSearchTerm.length()+ "String_Node_Str"+ ResourceIndexedSearchParamString.MAX_LENGTH+ "String_Node_Str"+ rawSearchTerm);
  }
  String likeExpression=BaseHapiFhirDao.normalizeString(rawSearchTerm);
  likeExpression=createLeftMatchLikeExpression(likeExpression);
  Predicate singleCode=theBuilder.like(theFrom.get("String_Node_Str").as(String.class),likeExpression);
  if (theParameter instanceof StringParam && ((StringParam)theParameter).isExact()) {
    Predicate exactCode=theBuilder.equal(theFrom.get("String_Node_Str"),rawSearchTerm);
    singleCode=theBuilder.and(singleCode,exactCode);
  }
  return combineParamIndexPredicateWithParamNamePredicate(theResourceName,theParamName,theFrom,singleCode);
}

Fixed version (ground truth):
private Predicate createPredicateString(IQueryParameterType theParameter,String theResourceName,String theParamName,CriteriaBuilder theBuilder,From<?,ResourceIndexedSearchParamString> theFrom){
  String rawSearchTerm;
  if (theParameter instanceof TokenParam) {
    TokenParam id=(TokenParam)theParameter;
    if (!id.isText()) {
      throw new IllegalStateException("String_Node_Str");
    }
    rawSearchTerm=id.getValue();
  }
 else   if (theParameter instanceof StringParam) {
    StringParam id=(StringParam)theParameter;
    rawSearchTerm=id.getValue();
    if ((id.isContains()) && (!myCallingDao.getConfig().allowContainsSearches())) {
      throw new MethodNotAllowedException("String_Node_Str");
    }
  }
 else   if (theParameter instanceof IPrimitiveDatatype<?>) {
    IPrimitiveDatatype<?> id=(IPrimitiveDatatype<?>)theParameter;
    rawSearchTerm=id.getValueAsString();
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + theParameter.getClass());
  }
  if (rawSearchTerm.length() > ResourceIndexedSearchParamString.MAX_LENGTH) {
    throw new InvalidRequestException("String_Node_Str" + theParamName + "String_Node_Str"+ rawSearchTerm.length()+ "String_Node_Str"+ ResourceIndexedSearchParamString.MAX_LENGTH+ "String_Node_Str"+ rawSearchTerm);
  }
  String likeExpression=BaseHapiFhirDao.normalizeString(rawSearchTerm);
  if (myCallingDao.getConfig().allowContainsSearches()) {
    if (theParameter instanceof StringParam) {
      if (((StringParam)theParameter).isContains()) {
        likeExpression=createLeftAndRightMatchLikeExpression(likeExpression);
      }
 else {
        likeExpression=createLeftMatchLikeExpression(likeExpression);
      }
    }
 else {
      likeExpression=createLeftMatchLikeExpression(likeExpression);
    }
  }
 else {
    likeExpression=createLeftMatchLikeExpression(likeExpression);
  }
  Predicate singleCode=theBuilder.like(theFrom.get("String_Node_Str").as(String.class),likeExpression);
  if (theParameter instanceof StringParam && ((StringParam)theParameter).isExact()) {
    Predicate exactCode=theBuilder.equal(theFrom.get("String_Node_Str"),rawSearchTerm);
    singleCode=theBuilder.and(singleCode,exactCode);
  }
  return combineParamIndexPredicateWithParamNamePredicate(theResourceName,theParamName,theFrom,singleCode);
}