Program: 104885
Project: 104885
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public Query<T> filter(String condition,Object value){
  String[] parts=condition.trim().split("String_Node_Str");
  if (parts.length < 1 || parts.length > 6)   throw new IllegalArgumentException("String_Node_Str" + condition + "String_Node_Str");
  String prop=parts[0].trim();
  FilterOperator op=(parts.length == 2) ? this.translate(parts[1]) : FilterOperator.EQUAL;
  MappedField mf=null;
  if (validating)   mf=validate(prop,value);
  if (query == null)   query=BasicDBObjectBuilder.start();
  Mapper mapr=ds.getMapper();
  Object mappedValue;
  MappedClass mc=null;
  try {
    if (value != null && !ReflectionUtils.isPropertyType(value.getClass()))     if (mf != null && !mf.isTypeMongoCompatible())     mc=mapr.getMappedClass((mf.isSingleValue()) ? mf.getType() : mf.getSubType());
 else     mc=mapr.getMappedClass(value);
  }
 catch (  Exception e) {
    log.log(Level.FINEST,"String_Node_Str",e);
  }
  if ((mf != null && (mf.hasAnnotation(Reference.class) || mf.getType().isAssignableFrom(Key.class))) || (mc != null && mc.getEntityAnnotation() != null)) {
    try {
      Key<?> k=(value instanceof Key) ? (Key<?>)value : ds.getKey(value);
      mappedValue=k.toRef(mapr);
    }
 catch (    Exception e) {
      log.log(Level.WARNING,"String_Node_Str" + value + "String_Node_Str",e);
      mappedValue=mapr.toMongoObject(value);
    }
  }
 else   if (mf != null && mf.hasAnnotation(Serialized.class))   try {
    mappedValue=mapr.serialize(value);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
 else   mappedValue=Mapper.asObjectIdMaybe(mapr.toMongoObject(value));
  Class<?> type=(mappedValue != null) ? mappedValue.getClass() : null;
  if (type != null && (op == FilterOperator.IN || op == FilterOperator.NOT_IN) && !type.isArray() && !ReflectionUtils.implementsAnyInterface(type,Iterable.class,Collection.class,List.class,Set.class,Map.class)) {
    mappedValue=Collections.singletonList(mappedValue);
  }
  if (FilterOperator.EQUAL.equals(op))   query.add(prop,mappedValue);
 else   query.push(prop).add(op.val(),mappedValue);
  return this;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Query<T> filter(String condition,Object value){
  String[] parts=condition.trim().split("String_Node_Str");
  if (parts.length < 1 || parts.length > 6)   throw new IllegalArgumentException("String_Node_Str" + condition + "String_Node_Str");
  String prop=parts[0].trim();
  FilterOperator op=(parts.length == 2) ? this.translate(parts[1]) : FilterOperator.EQUAL;
  MappedField mf=null;
  if (validating)   mf=validate(prop,value);
  if (query == null)   query=BasicDBObjectBuilder.start();
  Mapper mapr=ds.getMapper();
  Object mappedValue;
  MappedClass mc=null;
  try {
    if (value != null && !ReflectionUtils.isPropertyType(value.getClass()))     if (mf != null && !mf.isTypeMongoCompatible())     mc=mapr.getMappedClass((mf.isSingleValue()) ? mf.getType() : mf.getSubType());
 else     mc=mapr.getMappedClass(value);
  }
 catch (  Exception e) {
    log.log(Level.FINEST,"String_Node_Str",e);
  }
  if ((mf != null && (mf.hasAnnotation(Reference.class) || mf.getType().isAssignableFrom(Key.class))) || (mc != null && mc.getEntityAnnotation() != null)) {
    try {
      Key<?> k=(value instanceof Key) ? (Key<?>)value : ds.getKey(value);
      mappedValue=k.toRef(mapr);
    }
 catch (    Exception e) {
      log.log(Level.WARNING,"String_Node_Str" + value + "String_Node_Str",e);
      mappedValue=mapr.toMongoObject(value);
    }
  }
 else   if (mf != null && mf.hasAnnotation(Serialized.class))   try {
    mappedValue=mapr.serialize(value);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
 else   try {
    mappedValue=Mapper.asObjectIdMaybe(mapr.toMongoObject(value));
  }
 catch (  Exception e) {
    log.log(Level.WARNING,"String_Node_Str" + value.getClass() + "String_Node_Str",e);
    mappedValue=value;
  }
  Class<?> type=(mappedValue != null) ? mappedValue.getClass() : null;
  if (type != null && (op == FilterOperator.IN || op == FilterOperator.NOT_IN) && !type.isArray() && !ReflectionUtils.implementsAnyInterface(type,Iterable.class,Collection.class,List.class,Set.class,Map.class)) {
    mappedValue=Collections.singletonList(mappedValue);
  }
  if (FilterOperator.EQUAL.equals(op))   query.add(prop,mappedValue);
 else   query.push(prop).add(op.val(),mappedValue);
  return this;
}