Program: 104643
Project: 104643
Buggy source:
@SuppressWarnings("String_Node_Str") private void readCollection(final Datastore datastore,final Mapper mapper,final Object entity,final EntityCache cache,final MappedField mf,final DBObject dbObject){
  Collection values=null;
  final Object dbVal=mf.getDbObjectValue(dbObject);
  if (dbVal != null) {
    values=mf.isSet() ? mapper.getOptions().getObjectFactory().createSet(mf) : mapper.getOptions().getObjectFactory().createList(mf);
    final List dbValues;
    if (dbVal instanceof List) {
      dbValues=(List)dbVal;
    }
 else {
      dbValues=new BasicDBList();
      dbValues.add(dbVal);
    }
    EphemeralMappedField ephemeralMappedField=!mapper.isMapped(mf.getType()) && isMapOrCollection(mf) && (mf.getSubType() instanceof ParameterizedType) ? new EphemeralMappedField((ParameterizedType)mf.getSubType(),mf,mapper) : null;
    for (    final Object o : dbValues) {
      Object newEntity=null;
      if (o != null) {
        if (mapper.getConverters().hasSimpleValueConverter(mf) || mapper.getConverters().hasSimpleValueConverter(mf.getSubClass())) {
          newEntity=mapper.getConverters().decode(mf.getSubClass(),o,mf);
        }
 else {
          newEntity=readMapOrCollectionOrEntity(datastore,mapper,cache,mf,ephemeralMappedField,(DBObject)o);
        }
      }
      values.add(newEntity);
    }
    if (!values.isEmpty() || mapper.getOptions().isStoreEmpties()) {
      if (mf.getType().isArray()) {
        mf.setFieldValue(entity,ReflectionUtils.convertToArray(mf.getSubClass(),ReflectionUtils.iterToList(values)));
      }
 else {
        mf.setFieldValue(entity,values);
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void readCollection(final Datastore datastore,final Mapper mapper,final Object entity,final EntityCache cache,final MappedField mf,final DBObject dbObject){
  Collection values;
  final Object dbVal=mf.getDbObjectValue(dbObject);
  if (dbVal != null) {
    values=mf.isSet() ? mapper.getOptions().getObjectFactory().createSet(mf) : mapper.getOptions().getObjectFactory().createList(mf);
    final List dbValues;
    if (dbVal instanceof List) {
      dbValues=(List)dbVal;
    }
 else {
      dbValues=new BasicDBList();
      dbValues.add(dbVal);
    }
    EphemeralMappedField ephemeralMappedField=!mapper.isMapped(mf.getType()) && isMapOrCollection(mf) && (mf.getSubType() instanceof ParameterizedType) ? new EphemeralMappedField((ParameterizedType)mf.getSubType(),mf,mapper) : null;
    for (    final Object o : dbValues) {
      Object newEntity=null;
      if (o != null) {
        if (mapper.getConverters().hasSimpleValueConverter(mf) || mapper.getConverters().hasSimpleValueConverter(mf.getSubClass())) {
          newEntity=mapper.getConverters().decode(mf.getSubClass(),o,mf);
        }
 else {
          newEntity=readMapOrCollectionOrEntity(datastore,mapper,cache,mf,ephemeralMappedField,(DBObject)o);
        }
      }
      values.add(newEntity);
    }
    if (!values.isEmpty() || mapper.getOptions().isStoreEmpties()) {
      if (mf.getType().isArray()) {
        mf.setFieldValue(entity,ReflectionUtils.convertToArray(mf.getSubClass(),ReflectionUtils.iterToList(values)));
      }
 else {
        mf.setFieldValue(entity,values);
      }
    }
  }
}