Program: 44670
Project: 44670
Buggy source:
public static String createObjectCriteria(String property,QueryOperator operator,Object value,boolean propertyIsASimpleProperty,CaseMatching caseMatching,int numberOfNodeLevelsToSearchInTheModelHierarchy){
  if (value == null || QueryOperator.IS_NULL == operator)   return attributeNullCriteria(property);
  if (QueryOperator.CONTAINS == operator)   return addContainsCriteria(property,value.toString(),propertyIsASimpleProperty,numberOfNodeLevelsToSearchInTheModelHierarchy);
  if (QueryOperator.LIKE == operator)   return addLikeCriteria(property,value.toString());
  if (QueryOperator.IS_NOT_NULL == operator)   return attributeNotNullCriteria(property);
  if (value instanceof String) {
    if (caseMatching != null) {
      if (CaseMatching.LOWER_CASE == caseMatching) {
        value=((String)value).toLowerCase();
      }
 else       if (CaseMatching.UPPER_CASE == caseMatching) {
        value=((String)value).toUpperCase();
      }
    }
    return createStringCriteria(property,operator,(String)value);
  }
  if (value instanceof Calendar)   return createDateCriteria(property,operator,(Calendar)value);
  if (value instanceof Date)   return createDateCriteria(property,operator,DateUtils.toCalendar((Date)value));
  if (value instanceof Long)   return createLongCriteria(property,operator,(Long)value);
  if (value instanceof Boolean)   return createBooleanCriteria(property,operator,(Boolean)value);
  if (value instanceof Double)   return createDoubleCriteria(property,operator,(Double)value);
  return createStringCriteria(property,operator,value.toString());
}

Fixed version (ground truth):
public static String createObjectCriteria(String property,QueryOperator operator,Object value,boolean propertyIsASimpleProperty,CaseMatching caseMatching,int numberOfNodeLevelsToSearchInTheModelHierarchy){
  if (value == null || QueryOperator.IS_NULL == operator)   return createNullCriterion(property,propertyIsASimpleProperty);
  if (QueryOperator.CONTAINS == operator)   return addContainsCriteria(property,value.toString(),propertyIsASimpleProperty,numberOfNodeLevelsToSearchInTheModelHierarchy);
  if (QueryOperator.LIKE == operator)   return addLikeCriteria(property,value.toString());
  if (QueryOperator.IS_NOT_NULL == operator)   return createNotNullCriterion(property,propertyIsASimpleProperty);
  if (value instanceof String) {
    if (caseMatching != null) {
      if (CaseMatching.LOWER_CASE == caseMatching) {
        value=((String)value).toLowerCase();
      }
 else       if (CaseMatching.UPPER_CASE == caseMatching) {
        value=((String)value).toUpperCase();
      }
    }
    return createStringCriteria(property,operator,(String)value);
  }
  if (value instanceof Calendar)   return createDateCriteria(property,operator,(Calendar)value);
  if (value instanceof Date)   return createDateCriteria(property,operator,DateUtils.toCalendar((Date)value));
  if (value instanceof Long)   return createLongCriteria(property,operator,(Long)value);
  if (value instanceof Boolean)   return createBooleanCriteria(property,operator,(Boolean)value);
  if (value instanceof Double)   return createDoubleCriteria(property,operator,(Double)value);
  return createStringCriteria(property,operator,value.toString());
}